잡 제출
POST/v1/jobs
스크립트를 새 macOS VM에서 실행하는 잡을 제출합니다, VM은 잡이 끝나면 지워집니다
API 키 권한 run 또는 콘솔 세션으로 부릅니다, 콘솔 세션은 조직 역할 owner, admin, developer만 됩니다
- 제출 시 한 트랜잭션에서 세 가지를 검사합니다, 사용 가능 잔액이 1분 요금 이상인지(
insufficient_credit), 워크스페이스 월 한도(workspace_spend_limit), 티어 월 한도(tier_monthly_limit) - 빈 러너가 없으면 대기열에 넣습니다(
queued_reason=capacity), 티어 동시 실행 한도(Tier 1도 8개)를 넘을 때도 거절하지 않고 기다립니다(queued_reason=tier_concurrency_limit), 조직 대기열까지 가득 찼을 때만429 tier_concurrency_limit입니다 - 러너는
runner로 고릅니다, 러너 목록에서status가available인 ID만 받고 준비 중인 러너는400 runner_not_available, 없는 ID는400 unknown_runner입니다 - 요금은 고른 러너의 분당 단가로 초 단위 계산합니다, 잡마다 최소 1분이고 금액은 센트 단위로 반올림합니다
script와recipe_id중 하나는 있어야 하고 둘 다 보내면 400입니다, 레시피의required_env가 빠지면 VM을 띄우지 않고 400(details.missing_env,details.guide)으로 거절합니다- Xcode는 요청
xcode> 레시피default_xcode> 워크스페이스 기본 Xcode > 이미지 기본값 순으로 정해집니다
참고 서버 구현(2026-10-12 dev 기준)이 계약 초안과 다른 점
- 같은 Idempotency-Key로 다시 보내면 처음 만든 잡을 201로 돌려줍니다(200이 아님)
Headers
- Authorization: optional string
Bearer xci_live_…워크스페이스 API 키, 키 권한run(read 키는 403 insufficient_permission), 콘솔 세션 쿠키로 대신할 수 있습니다 - Origin: optional string콘솔 세션으로 상태를 바꿀 때 같은 출처(https://xenoci.com)여야 합니다, API 키 요청에는 필요 없습니다
- Idempotency-Key: optional string24시간 안에 같은 키로 다시 보내면 처음 응답을 그대로 돌려줍니다, 같은 키에 다른 본문이면 409 idempotency_conflict255자 이하
Body
script 또는 recipe_id 중 하나는 필수
- workspace_id: optional string콘솔 세션은 필수, API 키는 생략하거나 키의 워크스페이스와 같아야 합니다
- script: optional stringVM에서 실행할 셸 스크립트65,536자 이하
source: optional object { upload_id, git_url, ref }
업로드(upload_id) 또는 공개 git(git_url, ref) 중 하나- upload_id: optional stringPOST /v1/uploads 로 올린 소스 압축 파일 ID
- git_url: optional string클론할 Git 저장소 주소
- ref: optional string체크아웃할 브랜치, 태그 또는 커밋
- image: optional string베이스 이미지 라벨, 공통 베이스 이미지 하나라 보통 생략합니다
- xcode: optional stringXcode 버전, 환경 목록이 돌려주는 값 중 하나
- timeout_minutes: optional integer제한 시간(분), 넘으면 timed_out으로 끝납니다기본값
60, 최소 1, 최대 360 - env: optional object스크립트에 넣을 환경 변수
- artifacts: optional array of string모을 결과물 글로브, 빌드 폴더 기준최대 50개
- repository: optional stringowner/name, 사용량 CSV 표시용
- source_kind: optional "cli" or "mcp" or "github_action" or "api"어디서 제출했는지, CLI와 MCP와 Action은 스스로 채웁니다기본값
"api" - recipe_id: optional string기본 제공 또는 워크스페이스 레시피, script가 없으면 레시피 스크립트를 씁니다(둘 다 있으면 400)
- runner: optional string러너 ID, 러너 목록에서 available인 것만기본값
"macos-m4" - commit_sha: optional string빌드하는 커밋(분쟁 증거, 로그와 사용량 CSV에 표시)형식
^[0-9a-fA-F]{7,64}$
Returns
201 접수됨(대기 또는 실행 중) application/json
Job: object
- id: stringID형식
^job_[A-Za-z0-9]+$ - organization_id: optional string조직 ID
- workspace_id: string워크스페이스 ID
- api_key_id: optional string or null제출에 쓴 키, 콘솔에서 제출했으면 null
- status: "queued" or "preparing" or "running" or "succeeded" or "failed" or "cancelled" or "credit_exhausted" or "platform_error" or "timed_out" or "stopped"잡 상태
- queued_reason: optional "tier_concurrency_limit" or "capacity" or null대기 이유, 동시 실행 한도면 tier_concurrency_limit
- end_reason: optional "succeeded" or "failed" or "cancelled" or "credit_exhausted" or "platform_error" or "timed_out" or "abuse_suspected" or "traffic_limit_exceeded" or "organization_suspended" or "workspace_archived" or "api_key_revoked" or "api_key_expired" or "api_key_scope_changed" or "member_removed" or nullsucceeded, failed, cancelled, credit_exhausted, platform_error, timed_out 중 하나, 끝나기 전엔 null
error: optional Error { code, message, retryable, … } or null
끝낸 오류(코드, 메시지), 없으면 null- code: "invalid_request" or "invalid_amount" or "api_key_required" or "invalid_api_key" or "api_key_revoked_leaked" or "session_required" or "insufficient_permission" or "console_only" or "workspace_archived" or "not_found" or "conflict" or "idempotency_conflict" or "last_owner" or "default_workspace_protected" or "invite_expired" or "payment_amount_mismatch" or "payment_reference_reused" or "payment_not_paid" or "topup_expired" or "withdrawal_window_closed" or "insufficient_credit" or "credit_exhausted" or "workspace_spend_limit" or "tier_monthly_limit" or "tier_concurrency_limit" or "traffic_limit_exceeded" or "abuse_suspected" or "rate_limited" or "fx_rate_unavailable" or "payments_unavailable" or "capacity_unavailable" or "internal_error"기계가 읽는 오류 코드, 아래 오류 표 참고
- message: string사람이 읽는 오류 설명
- retryable: boolean같은 요청을 다시 보내도 되는지
- retry_after_s: optional integer or null다시 보내기 전에 기다릴 초최소 0
- fault: "client" or "payment" or "platform"오류 책임 쪽, 요청(client) 또는 서버(server)
- request_id: string요청 ID, 문의할 때 알려 주세요
- docs_url: optional string이 오류를 설명하는 문서 주소
- details: optional object코드별 추가 필드, insufficient_credit와 credit_exhausted는 balance_micro_usd, balance_usd, required_micro_usd, required_usd, topup_url, workspace_spend_limit는 limit_, spent_, tier_* 코드는 tier, limit, resets_at, invalid_request는 fields[]
- exit_code: optional integer or null스크립트 종료 코드
- created_at: string만든 시각RFC 3339 UTC 시각
- started_at: optional string or null과금 시작 시각(VM 준비 뒤)
- ended_at: optional string or null끝난 시각
- run_seconds: optional integer or null실행 초
- billed_minutes: optional integer or null과금 분, ceil(billed_seconds / 60)이고 0초면 0분, 금액은 초 단위로 계산
- rate_micro_usd_per_min: optional integer잡 시작 때 고정된 분당 요율(µUSD, 부가세 포함)
- rate_usd_per_min: optional string같은 요율의 USD 문자열형식
^-?[0-9]+\.[0-9]{4}$ - amount_micro_usd: optional integer이 잡의 금액(µUSD)최소 0
- amount_usd: optional string같은 금액의 USD 문자열형식
^-?[0-9]+\.[0-9]{2}$ credit_low: optional object { balance_micro_usd, balance_usd, topup_url } or null
잡이 끝났을 때 잔액이 낮으면 잔액과 충전 링크, 아니면 null- balance_micro_usd: optional integer금액(µUSD 정수)최소 0
- balance_usd: optional string같은 금액의 USD 문자열(센트, 소수 2자리)형식
^-?[0-9]+\.[0-9]{2}$ - topup_url: optional string충전 링크
- log_url: optional string로그 URL
- repository: optional string or null제출 때 적은 owner/name
- source_kind: optional string제출 경로
- runner: optional string잡이 도는 러너 ID
- billed_seconds: optional integer or null과금 초, 0초면 0, 아니면 max(60, 실행 초)
- billable_started_at: optional string or null과금 구간 시작, VM이 준비되고 사용자 작업(소스 받기나 git clone)이 시작된 시각, 요청 접수와 대기와 VM 준비는 무료RFC 3339 UTC 시각
- billable_ended_at: optional string or null과금 구간의 끝(잡 종료 시각), 실행 중이거나 과금이 없으면 nullRFC 3339 UTC 시각
- net_rx_bytes: optional integer첫 측정 뒤 호스트 vmenet 카운터 차이로 모은 VM 다운로드 바이트최소 0
- net_tx_bytes: optional integer첫 측정 뒤 호스트 vmenet 카운터 차이로 모은 VM 업로드 바이트최소 0
- commit_sha: optional string or null잡이 빌드한 커밋, 제출 때 보낸 값(16진수 7~64자, 소문자로 저장), 분쟁 증거
- request_ip: optional string or null제출 요청의 클라이언트 주소(프록시 뒤에서는 실제 클라이언트), 분쟁 증거
- user_agent: optional string or null제출 요청의 User-Agent(CLI, MCP, Action 버전), 분쟁 증거
오류
- invalid_request: HTTP 400본문이나 쿼리가 검증에 실패했습니다, error.details.fields에 문제 필드가 있습니다
- runner_not_available: HTTP 400준비 중인 러너입니다,
status가available인 러너를 고르세요 - unknown_runner: HTTP 400없는 러너 ID입니다,
details.available에 쓸 수 있는 ID가 있습니다 - api_key_required: HTTP 401API 키 엔드포인트에 Authorization: Bearer 헤더가 없습니다
- api_key_revoked_leaked: HTTP 401공개 유출 신고로 자동 폐기된 키입니다, 새 키를 발급하세요
- invalid_api_key: HTTP 401모르는 키이거나 폐기, 만료, 체크섬 불일치입니다(종료된 xeno_ 접두사 포함)
- session_required: HTTP 401콘솔 엔드포인트를 유효한 콘솔 세션 쿠키 없이 불렀습니다
- insufficient_credit: HTTP 402사용 가능 잔액이 현재 요율의 1분어치보다 적습니다, 본문에 잔액과 topup_url이 있습니다
- tier_monthly_limit: HTTP 402조직이 티어 월 사용 한도에 닿았습니다, 다음 달 1일 00:00 UTC 또는 티어 상향 때 풀립니다
- workspace_spend_limit: HTTP 402워크스페이스 월 지출 한도에 닿았습니다, 소유자나 관리자가 올릴 수 있습니다
- insufficient_permission: HTTP 403역할이나 키 권한(run/read)이 이 요청을 허용하지 않습니다
- ip_not_allowed: HTTP 403요청 IP가 조직 또는 API 키의 IP 허용 목록 밖입니다, details.ip와 details.list(organization 또는 api_key)에 있습니다
- organization_suspended: HTTP 403운영자가 조직을 정지했습니다, 키는 거부되고 실행 중인 잡은 멈춥니다
- workspace_archived: HTTP 403보관된 워크스페이스입니다, 키는 폐기되었고 새 잡은 거절됩니다
- not_found: HTTP 404자원이 없거나 이 호출자에게 보이지 않습니다
- idempotency_conflict: HTTP 409같은 Idempotency-Key를 다른 본문으로 다시 썼습니다
- rate_limited: HTTP 429, 다시 시도 가능이 키 또는 조직의 요청이 너무 많습니다, retry_after_s만큼 기다리세요
- tier_concurrency_limit: HTTP 429, 다시 시도 가능실행 중인 잡이 티어 동시 실행 한도에 닿았고 조직 대기열도 가득 찼습니다, retry_after_s 뒤에 다시 보내세요
- traffic_limit_exceeded: HTTP 429, 다시 시도 가능잡 50 GB 또는 조직 KST 하루 200 GB 초과, 조직 한도는 새 제출도 거절,
details.scope,limit_gb,used_gb,resets_at| 잡 한도면 사용량 줄이기, 조직 한도면 KST 자정 뒤 재제출 - internal_error: HTTP 500, 다시 시도 가능예상하지 못한 오류입니다, 다시 시도하고 반복되면 request_id와 함께 알려 주세요
오류 봉투 모양과 전체 코드 표는 오류 코드에 있습니다