Errors
Status codes and error response shape.
Errors use conventional HTTP status codes and a consistent JSON body.
{
"error": {
"code": "invalid_request",
"message": "Field 'text' is required."
}
}Status codes
| Status | Meaning |
|---|---|
400 | The request was malformed or a parameter was invalid. |
401 | Missing or invalid API key. |
403 | Key revoked, or project lacks access to the endpoint. |
404 | Resource not found. |
429 | Rate limit exceeded — back off and retry. |
500 | Server error — safe to retry with exponential backoff. |
503 | Upstream temporarily unavailable. |
Retries
Retries are safe on 429, 500, 502, 503, 504. Use exponential backoff
with jitter and cap at a few attempts.