Skip to content
Docs

Requests and responses

JSON error envelope

Errors always return { error: { code, message, retryable } }.

Overview

Failures use a single top-level error object. CORS failures and unknown routes still follow this shape when the Cloud API handles them.

json
{
  "error": {
    "code": "invalid_argument",
    "message": "Human-readable message",
    "retryable": false
  }
}
FieldRequiredDescription
codeYesStable machine code — branch on this in app logic
messageYesHuman-readable text. It may be replaced with a generic message, so do not parse it.
retryableYesHint: safe to retry with backoff when true

Handling tip

Never parse message for control flow. Messages can change or be replaced with generic public strings. Use code and retryable. Details: Error object shape.

Errors use HTTP { "error": { "code", "message", "retryable" } }. Branch on code, not the message text.

CodeHTTPWhen
unauthorized401Missing or invalid credentials
invalid_argument400Bad query, body, or chain id
credits_exhausted402The organization has used its credit allowance
plan_feature_denied403Your plan does not include this feature
rate_limit_exceeded429Throttle — honor retryable and backoff (retryable)
json
{
  "error": {
    "code": "unauthorized",
    "message": "Human-readable detail (may be sanitized).",
    "retryable": false
  }
}