Error codes
IQx Token Factory uses standard HTTP status codes. The response shape matches the SDK that issued the request — OpenAI SDK calls return OpenAI-style error envelopes, Anthropic SDK calls return Anthropic-style envelopes.
Cross-SDK error handling
| Status | OpenAI type | Anthropic type | Meaning |
|---|---|---|---|
| 400 | invalid_request_error | invalid_request_error | Malformed payload |
| 401 | invalid_api_key | authentication_error | Bad or missing key |
| 403 | permission_denied | permission_error | Plan / scope mismatch |
| 404 | not_found_error | not_found_error | Unknown model or route |
| 429 | rate_limit_error | rate_limit_error | Backoff and retry |
| 500 | api_error | api_error | Provider / gateway error |
Rate limits & backoff
Rate limit exceeded?
Back off with exponential delay + full jitter. Read the
X-RateLimit-Reset-Requests header on every 429 — it tells you the exact cooldown. Cap retries at 5 attempts before surfacing the error.