Skip to main content
Errors use standard HTTP status codes and a consistent JSON shape:
{ "error": { "code": "invalid_request", "message": "Provide `text` or a non-empty `thread`." } }
  • code — a stable, machine-readable string. Branch on this.
  • message — a human-readable explanation. Don’t parse it.

Status codes

StatusCodeMeaning
400invalid_requestA parameter is missing or invalid.
401unauthorizedMissing, invalid, or revoked API key.
403forbiddenThe key lacks the required scope.
404not_foundThe resource doesn’t exist (or isn’t yours).
429rate_limitedToo many requests — see Rate limits.
500internal_errorSomething went wrong on our side.
4xx errors are safe to surface to your users after fixing the request. Retry 429 and 5xx with backoff.