Error format
error.message to the user. Use error.code when you need reliable branching in code.
Common error codes
| Category | Codes |
|---|---|
| Auth and billing | invalid_api_key, billing_canceled, billing_delinquent |
| Limits | rate_limit_exceeded, quota_exceeded |
| Payload and routing | invalid_payload, model_not_found |
| Infrastructure | service_unavailable, internal_error, email_send_failed |
Common status patterns
401or403: missing or invalid authentication404: unknown route or unknown model alias422: invalid payload or validation error503: dependency unavailable or service not configured
Endpoint-specific notes
Some endpoints document extra error details:POST /v1/email/sendcan returnemail_send_failedif the downstream email send fails
Best practices
- Treat
error.messageas the human-readable message - Treat
error.codeas the stable machine-readable field - Retry only when the failure is clearly transient, such as
service_unavailable

