02 · CONCEPTS

Errors

Every non-2xx response has exactly one shape. Codes tell your agent what to do next — most of them are not “try again.”

Error envelope
{
  "error": {
    "code": "insufficient_credits",
    "message": "available credits below the maximum cost of this call",
    "request_id": "…",      // when a request was created
    "details": { }              // code-specific context
  }
}
1

Codes & the retry matrix

CodeHTTPRetry?What to do
unauthorized401noMissing or revoked key. Create one in the console.
forbidden403noKey lacks the required scope, or the workspace needs review for external actions.
confirmation_required403after approvalA human must approve this action in the console. Get a fresh preview, have them approve, retry with the token.
insufficient_credits402after top-upTop up in the console. Quote tokens survive this — no need to re-quote.
rate_limited429yes, backoff300 requests/min per key. Back off and retry.
idempotency_conflict409noSame Idempotency-Key, different parameters. Use a new key for a new request.
invalid_request400noSchema/validation failure — the message says which field.
suppressed_recipient422noRecipient is suppressed. This is permanent and by design.
not_found404noWrong id, or it belongs to another workspace.
operation_unknown_state409poll, don't retryExternal outcome is ambiguous and being reconciled. Poll the request/operation; never blind-retry a purchase or launch.
provider_unavailable503yes, laterEvery route exhausted. Nothing was charged. Retry with the same Idempotency-Key.
internal500yes, laterOur fault. The request_id helps support trace it.
🔁 Retrying safely: reuse the same Idempotency-Key and you can never be double-charged — a completed request replays its original result; an in-flight one returns 202 in_progress.