Skip to main content

Error codes

All error responses use a consistent JSON envelope. Use the error field to identify the problem programmatically.

{
  "status": "error",
  "error": "rate_limit_exceeded",
  "message": "Too many requests. Retry after 42 seconds.",
  "details": {}
}
Error codeStatusMeaningResolution
auth_required401Missing or malformed API keyProvide a key via Authorization: Bearer sk_live_... or X-API-Key header.
key_revoked401API key has been revokedGenerate a new key from the Organization → API Keys page.
key_expired401API key is past its expiry dateGenerate a new key. Set a longer expiry or "Never expires" when creating keys.
insufficient_scope403Key lacks a required scope for this endpointGenerate a new key with the required scope (query, tools, conversations, files).
workspace_access_denied403Key is not scoped to the requested workspaceEither use a different key or generate one with access to this workspace.
rate_limit_exceeded429Too many requests from this API keyCheck the Retry-After response header for how many seconds to wait.
quota_exceeded402Organization compute quota exhaustedUpgrade your plan from the Billing page, or wait for quota to reset.
validation_error400Missing or invalid request parametersCheck the errors array in the response body for field-level details.
workspace_required400workspace_id parameter is required for this endpointPass workspace_id as a query parameter or in the request body.
agent_error500The agent encountered an error while processing your requestTransient — retry with exponential backoff. Persistent errors indicate a bug.
not_found404The requested resource does not existCheck the ID and workspace_id are correct.
internal_error500An unexpected server-side error occurredRetry after a short delay. If the problem persists, contact support.

Retry guidance

Safe to retry

  • 429 — after the Retry-After delay
  • 500, 502, 503, 504 — with exponential backoff
  • Network timeouts

Do not retry

  • 400 — fix the request before retrying
  • 401 — fix the API key
  • 403 — key lacks scope or workspace access
  • 402 — upgrade plan first

SDK exception classes

PythonTypeScriptWhen raised
AuthenticationErrorAuthenticationError401 responses
PermissionDeniedErrorPermissionDeniedError403 responses
RateLimitErrorRateLimitError429 responses (includes retry_after / retryAfter)
APIErrorAPIErrorAll other non-2xx responses