API reference
API error codes
Every stable error code the API returns, with its HTTP status and what to do about it.
Every error is RFC 9457 Problem Details (application/problem+json) with a stable code and a request_id. The link in each error's type field points to its entry below. How to read and handle errors: Errors.
- invalid_api_key
- 401. The key is missing, malformed, unknown, revoked or expired.
- api_key_in_query
- 400. A key was sent in the URL. Use the Authorization header.
- ip_not_allowed
- 403. The key has an IP allowlist and this IP is not on it.
- insufficient_scope
- 403. The key lacks the scope named in required_scope.
- idempotency_key_required
- 400. Credit-spending requests need an Idempotency-Key header.
- idempotency_key_invalid
- 400. The Idempotency-Key is empty, too long or not printable ASCII.
- idempotency_key_reused
- 422. The Idempotency-Key was used before with a different request.
- request_in_progress
- 409. The first request with this Idempotency-Key is still running.
- validation_failed
- 422. See errors for each field.
- not_found
- 404. No such resource in this account and mode.
- method_not_allowed
- 405. This method is not allowed on this path.
- rate_limited
- 429. Wait for Retry-After seconds. RateLimit-* headers show your limits.
- insufficient_credits
- 402. Not enough credits. See credits_needed and credits_available.
- credit_cap_reached
- 402. The key reached its monthly credit cap.
- webhook_url_not_allowed
- 422. The webhook URL is not HTTPS on port 443, or points to a private address.
- limit_reached
- 409. An account limit was reached (for example, webhook endpoints).
- forbidden
- 403. The account or key may not do this.
- bad_request
- 4xx. The request could not be read.
- server_error
- 500. Our fault. Retry with the same Idempotency-Key.
Still stuck? Email [email protected] with what you tried and, for API problems, the request_id.