code. Branch on code, never on message. This page lists every code you can receive, what causes it, and whether to retry.
The error shape
{
"code": "idempotency_in_progress",
"message": "a request with this Idempotency-Key is already in progress",
"details": {
"field": "Idempotency-Key",
"requestId": "0b6f2c1d-9a4e-4b7f-8c3d-5e6a7b8c9d0e"
}
}
| Field | Use |
|---|---|
code | Stable and machine-readable. Branch on this. |
message | For people. It can change at any time. |
details | Code-specific context, such as field, measured values, limits, or the next call to make. |
details.retryable | true when the same request can succeed later, and false when it must not be retried. When omitted, follow the operation’s generated retry strategy in Endpoints. |
details.requestId | Include this, and the x-request-id response header, when you report a problem. |
How to retry
The operation’s generated retry strategy in Endpoints decides whether replay is allowed.Retry-After only says when to make an allowed retry; it never grants retry permission.
| Situation | What to do |
|---|---|
Retry-After header present | If the operation’s strategy permits replay, wait that long before retrying. It’s sent with some 409, 429 and 503 responses. |
details.retryable: true, no Retry-After | If the operation’s strategy permits replay, retry with exponential backoff and jitter, starting around one second. |
5xx on a keyed mutation | Retry only when the operation’s strategy permits it, using the same Idempotency-Key and request identity described for that endpoint. |
Any other 4xx | Don’t retry unchanged. Fix the request first. |
Request and validation
| Status and code | Cause | Fix | Retry? |
|---|---|---|---|
400 invalid_request | A field, query parameter, or header is missing, malformed, or out of range. details.field names it. Also returned when the body isn’t valid JSON, a tenant-scoped key omits x-organization-id, Idempotency-Key is malformed or repeated, or a page_token (v1) or cursor (v2) has expired or doesn’t match the query. Session-list tokens last one hour. | Fix the named field. For an expired page_token or cursor, restart the list without it. | No |
400 invalid_json | The body is JSON but doesn’t match the operation’s schema, such as a field with the wrong type. details.field names the field when it’s known. | Check the body against Endpoints. | No |
413 payload_too_large | The body is bigger than the operation accepts, for example a skill bundle over 8 MiB or an uploadFileV2 file part over 30 MiB. | Send a smaller body. | After fixing |
415 unsupported_media_type | The body’s media type isn’t accepted. Skill bundles and uploadFileV2 use multipart/form-data; other request bodies use JSON. | Use the operation’s declared media type. | No |
Authentication and access
| Status and code | Cause | Fix | Retry? |
|---|---|---|---|
401 unauthorized | No API key, or the key is malformed, expired, revoked, or no longer active. | Check the Authorization: Bearer header. See API keys. | No |
403 forbidden | The key is valid, but your role in the organization doesn’t allow this operation. | See Organizations and roles. Use an account or key with the developer or admin role. | No |
403 session_start_not_admitted | New work was refused. With details.reason: "out_of_credit", your tenant has used its credits, so new sessions and messages that start a turn are refused. A session that is already running pauses before its next model request, with stop_reason: out_of_credit. With details.reason: "budget_reached", the session reached its budget, so a message that starts a turn is refused. With details.reason: "tenant_suspended", your account is suspended and its running sessions pause with stop_reason: tenant_suspended. | Out of credit: buy credits, then start the session or send the message again. See When credits run out. Budget reached: details.budget_usd is the limit that bound, which can be the agent’s cap; raise the budget, or at the cap move the session to an agent version with a higher cap and then raise it; see Set a budget. Suspended: contact support. | After a top-up, a raised budget, or once support restores the account |
403 model_provider_not_approved | A session held to the approved model providers (one a connected application started, or one that works on such a session, such as an evaluation of it or a session that referenced it from its start) may send its content only to models from OpenAI, Anthropic or Google. A start by that application, or work on such a session (a resume, a message, a move to another agent version, a session that references it), would send it to a model from another provider. | details.field names the setting (model, multiagent, oversight, memory or slack_reply_review) and details.model the model. For a start, change that setting to a model from one of details.approved_providers and start again. A refused move to another agent version leaves the session on its version: pick a version whose models are all approved. A resume or a message fails a running session for good, so change the agent and start a new session. | No |
403 referenced_session_requires_approved_providers | You sent referenced_session_ids naming a session held to the approved model providers, and the session you are sending to is not held to them. Nothing was recorded. | Start a new session that references it. See Referenced sessions. | No |
403 setup_run_not_admitted | A setup test was refused before it was recorded. With details.reason: "out_of_credit", your tenant has used its credits; with details.reason: "tenant_suspended", your account is suspended. | Out of credit: buy credits, then test setup again. See When credits run out. Suspended: contact support. | After a top-up, or once support restores the account |
503 setup_run_admission_unavailable | The setup test’s credit check could not be completed; no run was recorded. | Retry the same request with the same Idempotency-Key. | Yes |
404 not_found | The resource doesn’t exist, or it’s in an organization you can’t reach. Also returned for an x-organization-id you can’t use, and for any path the API doesn’t serve. The cases look the same on purpose. | Check the id, the path, and the organization. | No |
503 service_unavailable | Your key couldn’t be checked right now. The request did not run. | Retry shortly. | Yes |
Conflicts and concurrency
| Status and code | Cause | Fix | Retry? |
|---|---|---|---|
409 conflict | The request conflicts with the resource’s current state, such as a duplicate name, or deleting a session while its hard stop is still finishing. | Read the resource, then change the request. | Only when details.retryable is true. |
409 session_cost_withheld | The session exists, but its cost breakdown is withheld in its current state, as its costUsd is. | Count the session’s cost as unknown, not zero. | No |
409 snapshot_stale | A v2 list changed while you followed its cursor, including when a provider page shrank. | Restart the list from its first page without a cursor. | After restarting |
409 conflict on a session’s agent version | The session can’t be moved to another version: it is a subagent session, a session the service runs itself, a pull request review session, or one that is still stopping or can no longer continue. Reading the version state of a subagent session, or of a session that wasn’t started from an agent, answers the same. | Move or read the root session. See Move a session to another version. | Only when details.retryable is true. |
409 revision_conflict | Someone published a newer agent or skill version after you read it, or an environment’s settings changed while your update was saving. | Read it again, apply your change to the latest version, and retry. | After re-reading |
412 precondition_failed | An environment update sent expected_access that no longer matches its network policy or privileged access. | Read the environment and retry with its current access settings. | After re-reading |
428 precondition_required | An update changes an environment’s stored network policy, or turns on privileged access, without expected_access. | Read the environment and send its current access settings as expected_access. | After re-reading |
412 precondition_failed on If-Match | An automation, event source, or its public representation contract changed after you read it. | Read it again and retry with its new returned ETag. | After re-reading |
428 precondition_required on If-Match | A replace, pause, resume, or delete of an automation or event source sent no If-Match. | Send the complete returned ETag from the current read as If-Match; do not construct it from revision. | After fixing |
Idempotency
| Status and code | Cause | Fix | Retry? |
|---|---|---|---|
409 idempotency_conflict | The Idempotency-Key was already used for a different request. | Use a new key for a new request. Resend the same request identity described for the endpoint to replay. | No |
409 idempotency_in_progress | The first request with this key is still running. | Wait for Retry-After, then send the same request again. | Yes |
503 idempotency_unavailable | The key couldn’t be checked or reserved. The request did not run. | Retry with the same key. | Yes |
Rate limits and capacity
| Status and code | Cause | Fix | Retry? |
|---|---|---|---|
429 rate_limit_exceeded | A request allowance is exhausted or the service is briefly at capacity. | Follow the 429 retry timing when the operation permits replay. | When replay is permitted |
429 rate_limited | Your organization’s request rate limit is exhausted. | Wait for Retry-After. | Yes |
429 tenant_concurrency_limit | Your tenant already has as many working root sessions as it may. details.limit is the cap. | Wait for Retry-After, or for a session to finish its turn. | Yes |
429 session_cost_breakdown_limit | Your organization already has as many session cost breakdowns in flight on the serving process as it may, and none freed within two seconds. details.limit is the cap. | Read fewer at a time; wait for Retry-After. | Yes |
429 setup_run_limit | Your organization has as many setup runs in flight as it may. details.limit is the cap and details.in_flight lists the runs. | Wait for a run to finish, or cancel one. | Yes |
503 service_unavailable | The service is briefly unavailable, or at event-stream capacity. | Retry with backoff. For streams, close ones you no longer need. | Yes |
503 session_cost_unavailable | A session’s cost breakdown couldn’t be read whole right now: a ledger read failed or raced, running compute couldn’t be priced, or the service is reading as many breakdowns as it can. | Wait for Retry-After, then retry. | Yes |
503 session_cost_unconfigured | Cost breakdowns aren’t available on this deployment. | Use costUsd on the session. | No |
Environments and setup
| Status and code | Cause | Fix | Retry? |
|---|---|---|---|
422 environment_not_verified | The environment’s setup script has never passed, failed, changed since it passed, or is still being tested. details.next_action names the call to make. | Follow the next action to test setup or wait for an active run. If it names listEnvironmentTemplates, follow the published setup recovery steps. | Yes, while a test is running |
422 sandbox_provider_disabled | The request names a runtime this deployment doesn’t offer for new work. | Use the Full VM runtime (runs). | No |
409 setup_run_in_progress | A setup run is already in flight for this environment. details.setup_run_id names it. | Wait for it to finish; a manual run or automatic runner refresh can be cancelled by a member allowed to update the environment. | After it ends |
409 setup_run_finished | You tried to cancel a setup run that had already finished. Nothing changed. | None needed. | No |
503 setup_run_not_started | The setup run was recorded but couldn’t start. It’s marked failed. | Start another setup run. | Yes |
Integrations
| Status and code | Cause | Fix | Retry? |
|---|---|---|---|
400 invalid_request on resources or permission | A tool allow-list is empty, has more than 200 tools, names a tool the app doesn’t have, or holds a tool that isn’t read-only under the read preset. A custom Slack app can also reject a tool lacking granted bot scopes or unavailable to customer-owned apps. | Send 1 to 200 tool names from the app’s catalog, or use permission: "write" for a connection granted through builtInIntegrations. See Change an app’s tools. For a custom Slack app, choose from the connection’s availableMcpTools, or Update bot scopes. | No |
400 invalid_request on builtInIntegrations | The agent’s integration grant is invalid. | Read message and the grant rules. | No |
400 invalid_request on nativeIntegrations with “exceed this connection’s tool selection” | The grant names a tool outside the connection’s selected tools. | Read the connection’s tools from GET /tool-selection, then remove the extra tools from the grant or add them to the connection’s selection with PATCH. | No |
422 provider_selection_unsupported on GET /tool-selection | The connection has no desired tool ceiling through this route. | For a tool-catalog connection without a selection, a grant without tools uses every tool the connection lists. View the list in the console under agent access or Details on Integrations. For GitHub or Slack, mcpTools describes usable tools but may include implied tools; retry a pending reservation with the original tools request. For built-in integrations, read its permissions. | No |
422 provider_selection_unsupported on connection selection PATCH | The connection does not support this selection change. | Narrow access in an agent grant with tools when the provider reports toolCatalog: true, or choose the grant’s permission. If the access level was fixed when connecting, add a new connection to change it. | No |
422 slack_app_credentials_rejected | Slack rejected a customer-owned app’s Client ID or Client Secret while refreshing its token for a channel, member, or user-group catalog read. | Disconnect the custom app and set it up again with current credentials. Update its Slack request URLs, agent grants, and automations. | After setup |
503 built_in_catalog_unavailable | The app catalog couldn’t be loaded. | Retry. | Yes |
503 built_in_integrations_unconfigured | The app catalog couldn’t be reached for your organization. | Contact support. | No |
503 integrations_unconfigured | The requested integration service is not configured or available in this deployment. | Retry later. If it persists, contact support. | Yes |
400 invalid_request on provider or connectionId when a provider is not configured | This deployment does not configure the requested integration provider. | Choose an available integration or contact support. | After configuration |
409 pending_connection_limit | The organization has reached the pending connection limit for this provider. | Finish setup or disconnect a pending connection, then retry. | After freeing a slot |
503 slack_user_revoke_failed | Recursion could not confirm that the Slack · User connection was removed or, for the last linked organization, that Slack revoked the authorization. | Try disconnecting again. If it persists, contact support. | Yes |
503 tool_catalog_unavailable | The connection’s server couldn’t be reached to list its tools, or to check the tools an agent’s grant lists when you save the agent or approve its plan. | Retry later. | Yes |
400 invalid_request on nativeIntegrations with “this deployment no longer offers this connection” | An agent grant lists tools of a connection whose server this deployment no longer offers. Every save of that agent is refused until the grant is removed or the deployment offers the connection again. | Remove the grant from the agent, then save again. Don’t remove only the grant’s tool list: the agent would then get every tool the server lists once the connection is offered again. | No |
400 invalid_request on nativeIntegrations or connectionId with “reconnect it” | The connection’s server no longer accepts its sign-in, so its tools can’t be listed or an agent grant’s tool list checked. | Reconnect the connection, or remove the grant from the agent. Don’t remove only the grant’s tool list: the agent would then get every tool the server lists. | After reconnecting |
503 delegate_preparation_unconfigured | The organization’s Google delegate cannot be prepared in this deployment. Agent creation, version save, or import did not commit. | Contact support. | No |
503 delegate_preparation_failed | Recursion could not prepare the organization’s Google delegate for an agent write, import, or Google integration registration. The requested write did not commit. | Retry the same write. If it persists, contact support. | Yes |
429 github_rate_limited | GitHub is limiting requests made for your connection. | Retry after Retry-After. | Yes |
503 github_unavailable | GitHub couldn’t be reached. | Retry later. | Yes |
200, with ok: false and a failure reason. See Test a connection.
Files
| Status and code | Cause | Fix | Retry? |
|---|---|---|---|
413 payload_too_large on uploadFileV2 | The file part is over 30 MiB, or the complete multipart request exceeds the file limit plus its 128 KiB framing and form-field allowance. | Upload a file of at most 30 MiB through the API, or use the console for a larger file. | After fixing |
413 file_quota_exceeded | The upload would take your organization’s live files past its storage quota. details has quota_bytes, used_bytes, and incoming_bytes. | Set expiries on uploads so they stop counting once they expire. | After fixing |
404 not_found on file_id | The file doesn’t exist in your organization, or it expired. | Use a live file id. | No |
409 conflict on resources | An attachment path collides with another, or the session isn’t the root of its tree. | Choose another relative_path, or attach to the root. | After fixing |
Automations and event sources
| Status and code | Cause | Fix | Retry? |
|---|---|---|---|
422 automation_reference_invalid | The automation’s agent version or environment doesn’t exist or can’t be used. | Choose a live agent version and a verified environment. | After fixing |
422 automation_event_source_invalid | A trigger names a missing or incompatible event source. | Use a source of the trigger’s type. | After fixing |
422 automation_run_session_shared | The run continues a Slack thread, or answers a DM, so it shares its session with the thread’s other runs and has no result of its own. | Read the run’s session instead. | No |
409 automation_trigger_id_in_use | A trigger’s triggerId already belongs to another automation. A trigger id is never reused, even after its trigger or automation is deleted. | Give the trigger a new UUID. | After fixing |
422 event_source_verification_credential_invalid | A signed custom source names a verification credential that isn’t a live signing secret in your organization. | Name a live signing secret from your organization, or keep the source’s current one. | After fixing |
409 conflict on eventSourceId | The source is still used by automations, or it’s managed by its connection. | Remove it from triggers first, or manage it through its connection. | After fixing |
503 event_admission_unavailable | A webhook delivery couldn’t be recorded. Returned to the sender. | The sender retries. | Yes |
failed with an error that has its own code, message, and retryable. See Automations.
Models and the session analyst
| Status and code | Cause | Fix | Retry? |
|---|---|---|---|
503 model_gateway_unreachable | The model list, or the model a request names, couldn’t be checked right now. | Retry later. | Yes |
503 session_analyst_busy | Another request to the same session analyst was still running. | Retry. | Yes |
503 session_analyst_model_unavailable | The session analyst’s model isn’t available, or it isn’t from one of the approved model providers and the session is held to them. | The analyst can’t start until its model is available again or, on a held session, until the analyst’s model changes. Contact support if it persists. | No |
503 session_analyst_unconfigured | The session analyst couldn’t be started for your organization. | Contact support. | No |
Fine-tuning
| Code | Cause | Fix | Retry |
|---|---|---|---|
400 invalid_request | A field or query parameter that is missing, unknown, repeated, malformed, out of range, or in an invalid combination (details.field names it); a create or rename body the job refuses: the fine-tuning reference lists every body a create or rename refuses and the code each returns (an unknown or removed field or setting, or an explicit null, is 400 invalid_json with no field); a cursor that is invalid or expired; or the organization is not enabled for fine-tuning. | Fix the request, or ask for fine-tuning or evaluations to be enabled. | No |
409 conflict | Cancelling a succeeded or failed job, resuming a succeeded job, or reusing a create Idempotency-Key after its receipt expired. | Read the job: a succeeded job is final, and a failed job can be resumed. For a reused key, use a new one. | No |
400 invalid_request to organizations that are not enabled for fine-tuning, and:
| Code | Cause | Fix | Retry |
|---|---|---|---|
400 invalid_request | An upload with an unknown fileId, a file with no rows, or rejected lines (details.lineErrors, at most 100, each with its line and error), a removal with ids the version does not hold, repeated ids or malformed ids, or a field outside its limit. details.truncated is true when the listing stopped early: at 100 lines or at about 32 KiB of messages, with more lines rejected or left unchecked. | Fix the named line or field. | No |
404 not_found | An unknown dataset or version, or the rows of a version that is not ready yet (it is building or failed). | Read the dataset’s versions and wait for ready; a failed version never becomes readable, and a build that crashed stays building until a later upload or removal takes it over after 30 minutes of silence. | No |
409 conflict, field baseVersion | The baseVersion is not the dataset’s latest ready version. | Read the dataset and its latest version, redo your edit on that version, and send it with its number as baseVersion; do not resend an older file, which would remove the rows added since. | After the redo |
409 conflict, field datasetId | Another version of the dataset is being built, or this upload’s own version was taken over by a newer upload or removal after it stopped writing for the build lease (30 minutes by default). | Wait a few minutes, then send the same request again with the same baseVersion, which is refused if anyone else wrote. A 201 means your version was built: a build that crashed was taken over by your request. This 409 again means a build is still running; a crashed one is taken over once it has been silent for the build lease. A 409 on baseVersion means another build finished: follow that row. | After the wait |
409 conflict, field Idempotency-Key | A create Idempotency-Key used for a different dataset name after its receipt expired (while the receipt is live the key answers idempotency_conflict). | Use a new key. | No |
Server errors
| Status and code | Cause | Fix | Retry? |
|---|---|---|---|
500 internal_error | An unexpected failure. Details are withheld. | Retry once with the same Idempotency-Key if it was a create. If it persists, report details.requestId. | Once |
500 invariant_violation | An internal consistency check failed. Details are withheld. | Retry once. If it persists, report details.requestId. | Once |
502 bad_gateway | An internal service returned an invalid response. | Retry with backoff. | Yes |
503 managed_agents_unavailable | Managed Agents is temporarily unavailable. | Retry with backoff. | Yes |
504 gateway_timeout | The request took too long. It may or may not have run. | Retry creates with the same Idempotency-Key. Read the resource before retrying other writes. | Yes |
Any other 503 code | A service dependency is temporarily unavailable. | Retry with backoff. If it persists, report details.requestId. | Yes |
Session failure codes
A session that fails has afailure object. These codes are separate from HTTP errors: the request that started the session succeeded, but the work later stopped.
{
"status": "failed",
"failure": {
"code": "sandbox_provision_timeout",
"phase": "provisioning",
"category": "transient",
"retryable": true,
"message": "Agent runner provisioning timed out. The session may succeed when capacity recovers."
}
}
category first:
category | Meaning | What to do |
|---|---|---|
transient | A temporary condition. | Send a follow-up message to resume, or start again later. |
caller_error | Something in your request, configuration, or required input. Retrying as is won’t help. | Fix the named issue, then resume or start a new session. |
internal | A problem on our side. | Report the session_id. |
failure.code | Cause | Fix |
|---|---|---|
sandbox_provision_timeout | Compute wasn’t ready within 5 minutes. | Resume or start again. |
sandbox_capacity_unavailable | Compute capacity was temporarily unavailable. | It’s retried automatically. If it persists, try again later. |
sandbox_image_pull_failed | The image saved by the environment’s last passing setup test couldn’t be loaded. | None. It’s retried automatically without rerunning setup. |
sandbox_configuration_invalid | The environment’s settings can’t be run. | Fix the environment. message says what’s wrong. |
sandbox_provider_unavailable | The runtime was briefly unavailable. | Resume or start again. |
workspace_snapshot_gone | The saved workspace for an evaluation target is no longer available, so its files cannot be inspected. | Run a new target session, then evaluate that session. |
sandbox_gpu_not_ready | The GPU didn’t pass its readiness check. | Report it. Starting again usually reproduces it. |
environment_setup_failed | The environment’s setup failed while preparing the session, or its setup requires a current published template. | Follow setup visibility. |
credential_resolution_failed | A granted credential couldn’t be opened. As a sandbox command error where Recursion adds the GitHub token outside the sandbox, the sandbox’s GitHub access couldn’t be set up right now: the session’s grants couldn’t all be read, or GitHub couldn’t issue the token, or it couldn’t be delivered. | Check the session’s vault grants and that the credentials still exist. For GitHub, the sandbox is started again by the first sandbox command after a wait that grows up to 30 minutes; a command inside the wait fails at once and names when it ends. Once GitHub has recovered, ask the agent to run the command again after the wait. |
model_not_found | The agent’s model isn’t available. | Update the agent to a model from listModels. |
model_authentication_failed | The model provider rejected the platform’s credential for the model. | None on your side. Choose another model or try later, and report the session_id. |
model_rate_limited | The model provider throttled the requests. | Resume later. |
model_provider_unavailable | The model provider was unavailable. | Resume later. |
model_request_failed | The model provider rejected a request. | Check the agent’s model settings, such as reasoning effort. |
model_output_reservation_overflow | The model provider refused the room the platform reserved for the reply: the conversation fits the model’s context window, but not with that reservation, even after one retry with the room the provider counted. | None on your side. Send a message to try again, and report the session_id if it repeats. |
model_prompt_cache_invalid | The agent’s prompt-cache retention settings are invalid or unsupported for its model. No model request was sent. | Clear or correct the agent’s prompt-cache retention settings, then start a new session. |
model_reasoning_capacity_invalid | The reasoning effort doesn’t fit the model’s output capacity. | Lower the agent’s reasoning effort or choose another model. |
model_refused | The model declined to continue the task. | Change the task or instructions. Resuming repeats the refusal. |
model_provider_not_approved | The session is held to the approved model providers, and one of its models, or a delegate’s, is not from OpenAI, Anthropic or Google. No request was sent to it. | Change the agent’s models to ones from those providers, then start a new session. |
roster_agent_unresolved | A subagent in the roster names an agent, version, or model that doesn’t exist. | Fix the roster. See Multi-agent. |
worker_replaced | A service update interrupted the work. | Send a follow-up message to resume if the session is still stopped. |
repository_provider_unavailable | The repository host was unavailable. | Resume later. |
internal_error | An unexpected failure. | Report the session_id. |
failure_code, plus codes only setup runs report, such as setup_template_required for a configuration outside the current catalog, and setup_run_interrupted for a run that stopped before it finished.
Next steps
Troubleshooting
Match a symptom to its cause and fix.
Limits
See the limit behind each size or rate error.
API conventions
Retries, idempotency, and paging.
Event types and states
Look up session statuses and stop reasons.