error.code and a human-readable error.message.
Error response structure
All error responses share the same shape:HTTP status codes
Common error codes
Authentication
See Authentication for how to pass credentials.
Validation
Resource errors
Gateway errors
Rate limits
Validation error details
Validation failures include adetails object mapping each field to its error messages:
Handling errors
1
Check the HTTP status
Use the status code to decide whether to retry, surface the error to the user, or log it silently.
2
Branch on `error.code`
Never parse
error.message. Codes are stable across releases; messages are not.3
Retry safely
Retry on
429, 500, 502, and 503 with exponential backoff. Always send an Idempotency-Key on retries.4
Log the full envelope
Persist
error.code, error.message, and error.details alongside the request ID for debugging.