Reference
Errors
Error response format and common HTTP status codes.
Error response shape
All error responses follow a consistent JSON structure with a human-readable message and a machine-readable code.
{
"error": {
"message": "Human-readable error message",
"code": "machine_readable_code"
}
}HTTP status codes
| HTTP status | Code | Meaning |
|---|---|---|
| 400 | validation_ | Invalid request body or parameters. |
| 400 | bad_ | Request was syntactically valid but cannot be processed. |
| 400 | unknown_ | X- names a project that does not exist in the active personal or org scope. |
| 401 | unauthorized | Missing or invalid API key. |
| 402 | payment_ | Payment required. |
| 402 | insufficient_ | Not enough credits to complete the request. |
| 403 | forbidden | The account cannot access the resource or action. |
| 403 | feature_ | A feature flag or account gate is disabled for this account. |
| 404 | not_ | Resource not found or API not enabled for the account. |
| 409 | conflict | Request conflicts with the current state of the resource. |
| 409 | project_ | A project with that normalized name already exists in the active scope. |
| 410 | gone | Endpoint or operation has been retired. The response message may include a migration hint. |
| 429 | rate_ | Too many requests. |
| 429 | throttled | A safety or action gate blocked the request and may include retry metadata such as deferUntil. |
| 500 | internal_ | Internal server error. |
The code field is always present in error responses. A 400 from request validation uses validation_; other generic 400 errors use bad_. A 402 uses insufficient_ when the error message mentions insufficient credits, and payment_ otherwise.
Example
{
"error": {
"message": "'model' is required",
"code": "validation_error"
}
}