Errors, limits, credits, and retries
Errors use anerror object with code, message, and requestId. Responses also carry X-Request-Id.
The stable
error.code is intended for program logic; the message adds diagnostic context. Preserve unknown future codes and fall back to the HTTP status.
Contract limits
Rate limits vary by account policy. On
429, read Retry-After, wait that many seconds, add jitter, and keep a maximum attempt or elapsed-time bound. Retry 502/503 with exponential backoff. Do not retry 400, 401, 402, 404, or 422 unchanged.
Idempotency and credits
Reuse the sameIdempotency-Key only for an identical write. Never rotate the key merely because a response timed out. A new key represents a new logical operation and can create new work.
Unknown and other non-verdict outcomes are not billed. Credits do not expire. Read the returned billing fields rather than inferring a charge from the HTTP status.
For help, retain the requestId, HTTP status, timestamp, and endpoint. Do not include the API key or customer email addresses in a support message. See API key safety and feedback and security.