docs/Billing & Security
Error Codes & Status Codes
HTTP status codes, error payload schemas, and remediation steps.
HTTP Status Codes
| Status | Error Code | Description & Remediation |
|---|---|---|
| 400 Bad Request | invalid_request_error | Missing parameter, empty messages array, or invalid JSON syntax. |
| 401 Unauthorized | invalid_api_key | Missing or incorrect API key. Pass 'Authorization: Bearer sk-unlocked-...' or set ANTHROPIC_AUTH_TOKEN. |
| 402 Payment Required | insufficient_credits | Account credit balance exhausted. Top up credits at /pricing. |
| 403 Forbidden | account_suspended | Account has been suspended for policy violations. |
| 429 Rate Limit | rate_limit_exceeded | Too many concurrent requests. Retry using exponential backoff. |
| 502 Bad Gateway | upstream_error | Upstream AI provider outage or timeout. Pass a 'models' fallback array. |
| 503 Service Unavailable | maintenance | The Unlocked AI Gateway is undergoing brief maintenance. |
Error Response Schema
{
"error": {
"message": "Insufficient credits. Top up your balance at https://unlockedai.net/pricing",
"type": "invalid_request_error",
"code": "insufficient_credits"
}
}Need an Unlocked AI Key or Credits?
Generate secret API keys backed by non-expiring pay-as-you-go credits starting at $5. No monthly minimums.