Skip to main content

The shape

When a call fails, the body has an error and no data:
  • code is stable. Build on it, not on the message.
  • message is for people. It may change.
  • details appears when there is more to say: which field failed, how long to wait, which id already exists.
  • request_id is also in the X-Request-Id header. Quote it when you contact support.
Each endpoint page lists the codes it can return. Over MCP the same body comes back as the tool’s error text.

Every code

Key and plan

Retry only these

RATE_LIMITED, AUTH_RATE_LIMITED, PROMPTS_DAILY_CAP and QUERY_TIMEOUT after the wait they ask for. INTERNAL once. Everything else will fail the same way again until you change something.