Errors

What the API answers when a request fails, what each status and code means, and what to do next. Every other page links here.

Error Formats

The endpoints that follow the OpenAI API (/v1/chat/completions, /v1/responses, /v1/embeddings, /v1/audio/transcriptions, /v1/conversations) answer in the OpenAI error envelope, so an SDK surfaces error.message and error.code as usual:

{
  "error": {
    "message": "Invalid API key",
    "type": "authentication_error",
    "param": null,
    "code": "invalid_api_key"
  }
}

The other endpoints (agents, schemas, extractions, prompts, providers, knowledge bases and so on) answer with a problem document. Branch on errorCode, which is stable; detail is prose that can be reworded:

{
  "type": "about:blank",
  "title": "Not Found",
  "status": 404,
  "detail": "…",
  "timestamp": "2026-10-22T09:41:07.113Z",
  "errorCode": "SCHEMA_NOT_FOUND"
}

Two answers come from the security layer in front of every /v1 endpoint and have neither shape: a request with no Authorization header gets a bare 401 with no body, and a rejected surface assertion gets a flat {"error": "<code>", "message": "…"}.

Statuses

StatusMeansWhat to do
400The request is malformed or names something that does not exist or is not allowed: a bad body, an unknown model, an invalid policy or continuationRead message or detail; the request will not succeed unchanged
401No key, or the key is rejectedSee Authentication
402Usage is used up with no extra usage available, or the plan does not include the featureSee Usage and plan
403The key's role or your role does not allow this actionUse a key with a higher role, or ask an admin; see API Keys
404The resource does not exist, or you may not address itCheck the id or name, and that the key belongs to the organization that owns it
406The Accept header rules out JSONSend Accept: application/json or none
409The request conflicts with the current state, for example a name that is taken or an agent with no published versionChange the name, or publish a version, then retry
410A file you attached has expiredUpload the file again
413A JSON body over 64 MBSend less per request; file uploads have their own limits on Files
429A limit was reached. There are three different limitsSee 429: which limit
502The model provider failedRetry with a short back-off

Authentication

A rejected key gets 401 with a code:

codeMeaning
invalid_api_keyThe key is malformed or does not exist, for example because it was deleted
key_disabledThe key was disabled on the API keys page
key_expiredThe key is past its expiration date
no_organizationThe key is not linked to an organization; create a new key
forbidden (403)A valid key whose role does not allow this action

Create a new key, or enable the disabled one, on the API keys page. A request with no Authorization header at all gets a bare 401.

429: Which Limit

429 is three different limits. Read error.code and the headers to tell them apart.

LimitcodeWhat to do
The key's rate limit: 50,000 requests per keycode rate_limitedThe key stays rejected until it has gone 24 hours without an accepted request, and there is no Retry-After. Do not retry in a loop; spread the load over more keys and alert on repeats
The key's usage limitcode usage_exceededRaise the limit, or use another key
Too many concurrent callstype rate_limit_error, with a Retry-After headerWait for the seconds in Retry-After, then retry
Too many turns from one end user of an embedded agentstatus only, on POST /v1/responsesSlow the turns down and retry

Usage and Plan

402 is a refusal before any work started, so nothing was spent or queued.

CaseAnswer
Usage is used up and extra usage is off402, type billing_error. An admin can turn on extra usage
An extraction batch needs more usage than is left402; nothing was queued
A knowledge base search on the built-in embedding models when usage is used up402
A provider/model call or a new provider on a plan without BYOK402; creating a provider answers with errorCode LIMIT_EXCEEDED_BYOK

A call that runs on your own provider can also fail because your account with that provider has no credits left or has reached its spend limit. The gateway answers 400 with type billing_error and code provider_quota_exhausted; the message says which of the two it is. Retrying does not help until you add credits or raise the limit with the provider. A stream that has started ends with an error event carrying the same type and code, and a stored or background response is failed with the same code.

Agents

Status and codeWhenWhat to do
400A malformed model reference, a #{model} override the version does not list, a bad file reference or a malformed Backbone-Turn-Id headerFix the request
400 invalid_hitl_policyThe stored approval policy fails validation, so every run of that version is refusedSave a valid policy as a new version
400 invalid_approval_decision, unknown_approval_id, approval_hmac_mismatch, incomplete_tool_outputsA bad approval decision or an unanswered tool callAnswer every pending call, echo the hmac unchanged
400 invalid_conversation_modeA backbone:mode item with a mode that does not existSend plan, ask or auto
400 conversation_in_plan_modeAn approve that Plan mode refusesLeave Plan mode or reject the call
400 conversation_mode_not_offeredA request runs under a mode the agent does not offerPick an offered mode or send "mode": null
404An unknown agent, or one the caller may not addressCheck the name, label and key
409 agent_not_publishedThe agent has no published versionPublish one with POST /v1/agents/{agentId}/versions
409 approval_already_decidedThe same decision sent again after the paused response was continuedFetch the continuation the message names; do not send the decision again
410 file_expiredAn attached file's lifetime ran outUpload it again

Gateway

Status and codeWhen
400 model_not_supportedThe provider prefix serves no embeddings
400 too_many_inputs, empty_input, input_too_largeAn embeddings request with more than 2,048 inputs, an empty input, or more than 1 MiB
400 upstream_errorThe provider refused the request, for example an over-long input or a bad dimensions
404No provider configured for the prefix
413 request_too_largeA JSON body over 64 MB
502 upstream_errorThe provider failed
400 audio_duration_unknownThe built-in whisper-1 could not read the audio's duration; see Audio Transcription

Was this page helpful?