Skip to main content

Request headers

Authorization (required)

Required for all endpoints except GET /api/v1/status.

X-Request-ID (optional)

Supply your own request identifier for correlation. The API echoes it back in the response. If omitted, the API generates a UUID. Recommended format: {app-name}-{uuid} or plain UUID.

Response headers

X-Request-ID

Always present. Contains either your supplied ID or an API-generated UUID.

X-Process-Time

Processing time in seconds (3 decimal places):

Rate limit headers

Present on authenticated endpoints after the rate-limit check runs:
If a /generate request is rejected due to a monthly quota (REQUEST_LIMIT_EXCEEDED), the response may not include X-RateLimit-* headers because quota checks happen before rate limiting.

Retry-After

Only on rate-limit 429 responses (RATE_LIMIT_EXCEEDED). Seconds to wait before retrying:
For quota 429 responses (REQUEST_LIMIT_EXCEEDED), do not retry immediately — wait for the quota reset or increase your quota.

Content-Disposition (PDF only)

For PDF responses, includes a suggested filename:

Handling rate limits

When you receive a 429 response:
  1. Check the JSON error field:
    • RATE_LIMIT_EXCEEDED: read Retry-After (seconds) and retry after waiting
    • REQUEST_LIMIT_EXCEEDED: you’re out of quota — wait for reset or upgrade
  2. Implement exponential backoff for repeated RATE_LIMIT_EXCEEDED responses
Example retry logic (pseudocode):

Header summary

*Not required for GET /api/v1/status