Kabin

Errors

Errors share one format. Branch on code, not on the message text.

{
  "ok": false,
  "type": "sandbox.error",
  "status": 409,
  "code": "sandbox_resuming",
  "message": "The sandbox is resuming.",
  "error": { "code": "sandbox_resuming", "message": "...", "status": 409, "details": { "retryable": true } },
  "requestId": "req_01HX..."
}

Quote the requestId when you contact support. Every 429 carries a Retry-After header in seconds. Where error.details.retryable is present it tells you whether a retry can help. The edge in front of the API may answer with the same format (type kabin.error) for authentication failures, rate limits and capacity.

Error codes
StatusCodesWhat to do
400invalid_json, invalid_query, invalid_path, invalid_timeout, invalid_ttl, invalid_env, invalid_name, invalid_key, invalid_files, type_too_small, count_requires_from, trial_auto_stop_required, invalid_amountFix the request. invalid_query names the offending parameter and lists the accepted ones.
401unauthorizedMissing, invalid, revoked or expired key. Repeated failures from one address are rate limited.
402billing_required, subscription_requiredIncluded time and wallet are used up, or the account has no plan. Pay or subscribe, see billing.
403trial_machine_class_not_allowed, trial_saved_snapshots_not_allowed, plan_machine_class_not_allowed, api_key_action_forbidden, api_key_sandbox_forbidden, org_suspendedThe plan or key does not allow it, or the account is suspended (contact support). Do not retry unchanged.
404not_found, snapshot_not_foundUnknown or inaccessible resource; the answer is the same for both cases. Refresh your state.
409sandbox_not_ready, sandbox_starting, sandbox_resuming, sandbox_stopping, invalid_confirm, save_in_progress, snapshot_data_expired, idempotency_in_progress, idempotency_key_reused, api_key_expired, card_required, requires_active_planDepends on the code: sandbox_starting, sandbox_resuming, sandbox_stopping and idempotency_in_progress are transient (retry after Retry-After); sandbox_not_ready means the sandbox is in error or cancelled; the others need a changed request.
413file_too_largeUse a smaller file; error.details has the limit.
429rate_limited, limit_reached, trial_compute_limit_reached, IP_RATE_LIMIT_EXCEEDEDWait Retry-After. rate_limited also carries nextStartAt, the window and what remains.
500internal_failedRetry idempotent calls with jitter; report persistent failures with the requestId.
502sandbox_direct_failedRetry only when error.details.retryable is true.
503out_of_capacityThe platform is full. Retry after retryAfterSeconds (Retry-After).

Retry guidance

  • Send an Idempotency-Key on create and fork so a retry cannot create a second sandbox.
  • Back off exponentially with jitter on 429, 500, 502 (when retryable) and 503; honour Retry-After.
  • Never retry 4xx responses unchanged, except the transient 409 codes above.