Skip to main content
Every non-2xx response uses the same envelope:
error is always present and written for a person to read. error_code is present on every refusal a route produces, and the HTTP status follows it. Four answers have no code, so branch on their status: 401, the 403 for an account with no agent access, the 403 for a key without read permission, and the 429 for the request budget. A 500 also carries a request_id.
For what each error_code means, see Error codes.

Status codes

A mistake in the request should get a 400, not a 500. If a request you built gets a 500, include its request_id when you report it. POST /agent-feedback takes a request_id.

Next steps