Skip to main content

Error response format

Error responses return JSON with an error code and message:
The X-Request-ID header is always included on all responses. Some error responses may also include a request_id field in the JSON body, but this is not guaranteed for every endpoint/status code. Use the header value when contacting support.

Error code reference

401 - Authentication errors

Invalid key format:
Invalid or inactive key:

422 - Validation errors

Validation errors include a details array with field-level issues:

429 - Rate limit exceeded

Per-endpoint rate limit:
Monthly request quota exceeded (generate only):

500 - Server errors

Server errors include request_id for support:

Rate limit headers

When rate limiting applies, responses include:

Per-endpoint rate limits

Rate limits are enforced per API key:
GET /api/v1/status does not require authentication and is not subject to per-key rate limiting.

Request quotas (billing limits)

Accounts may have monthly request quotas. These are enforced on /generate only and return 429 with REQUEST_LIMIT_EXCEEDED.

Request IDs

Every response includes the X-Request-ID header. You can supply your own X-Request-ID header on requests — the API will echo it back. This is useful for correlating requests in your logs with support inquiries.