Error codes
Look up error formats, HTTP status codes, retry behavior, and streaming errors.
Errors use an HTTP status and a stable machine-readable code. outerlane maps provider error messages to the codes below.
Error response formats
/v1/chat/completions, /v1/responses, /v1/images/generations, /v1/videos, and /v1/models use the OpenAI error format.
{
"error": {
"message": "Invalid API key.",
"code": "invalid_api_key"
}
}/v1/messages uses the Anthropic error format. Identify errors by the HTTP status and error.type.
{
"type": "error",
"error": {
"type": "authentication_error",
"message": "Invalid API key."
},
"request_id": null
}| HTTP status | error.type |
|---|---|
400 | invalid_request_error |
401 | authentication_error |
403 | permission_error |
404 | not_found_error |
413 | request_too_large |
429 | rate_limit_error |
Other statuses (402, 5xx) | api_error |
Errors by status code
| Status | code | Cause | What to do |
|---|---|---|---|
400 | invalid_request, invalid_body | The body is not a JSON object, or a required field such as model, messages, input, prompt, or max_tokens is missing or invalid | Check the request body against the endpoint reference. |
400 | model_not_found | Unknown or unavailable model ID | Check the provider/model-name ID in the model catalog. |
400 | unsupported_feature | Unsupported parameter or capability, such as n other than 1, an incompatible model, or a stateful Responses field | Remove the field or use a compatible endpoint. |
400 | unsupported_tool, unsupported_input | Non-function tool or unsupported tool_choice, input item, or content block | Use function tools and text or image blocks. |
400 | invalid_fallbacks, no_compatible_model | Invalid models fallback list, or no candidate in the route supports the requested capabilities | Pass up to 4 valid text model IDs, or pick a route with a compatible model. |
401 | missing_token | Missing authentication header | Send the key in Authorization or x-api-key. |
401 | invalid_token | Key without an ol_live_ prefix | Check whether a key for another service is in use. |
401 | invalid_api_key | Incorrect or revoked key | Check the key under API keys. |
402 | insufficient_credit | No plan allowance or available credits | Add credits or turn on Use credits when the plan runs out. |
402 | payment_required | Renewal payment has not been confirmed | Check your payment method in Billing. |
402 | budget_exceeded, key_budget_exceeded | Monthly account or API key spend budget reached | Raise or remove the budget in Billing or API keys. |
403 | account_on_hold | Account on hold because of a payment dispute | Contact support. |
403 | key_model_denied | API key is not permitted to call the requested model or route | Update the key's allowed/denied models in API keys. |
404 | model_not_found, video_not_found | Requested model or video job was not found | Check the model or video job ID. |
404 | not_found | Unknown route | Check the base URL and path. |
409 | video_not_ready | Video job has not finished yet | Wait until the job completes before downloading or hiding it. |
413 | payload_too_large | Request body exceeds 4 MiB (20 MiB on /v1/videos) | Reduce conversation history or base64 image size. |
429 | weekly_limit | Plan reached its 7-day cap | Wait the number of seconds in retry-after or upgrade your plan. |
429 | concurrent_limit, key_rate_limit, video_start_busy | Plan concurrency limit, API key per-minute rate limit, or concurrent video creation lock exceeded | Retry after in-flight requests finish or once the rate window resets. |
429 | rate_limited | Provider rate limit | Retry shortly. |
500 | internal_error | outerlane internal error | Retry shortly. |
502 | upstream_error, upstream_payload, upstream_usage, upstream_auth, upstream_unreachable, stream_interrupted | Provider error, invalid response, or connection failure | Retry, then contact support if the issue persists. |
503 | upstream_unavailable, limits_unavailable | Provider or outerlane temporarily unavailable | Retry shortly. |
504 | upstream_timeout | Response did not finish within 5 minutes | Enable streaming or lower the maximum output token count. |
Retries
- Retry
429,500,502,503, and504with exponential backoff. The OpenAI and Anthropic SDKs retry these errors automatically a limited number of times. - For
429 weekly_limit, wait until the time indicated byretry-afterbefore retrying. - For
400,401,402,403,404,409, and413, correct the request or account settings before retrying. - Failed requests are not billed.
Streaming errors
Before streaming starts, the API returns an HTTP error and JSON body. After a stream starts with 200, it sends a protocol-specific error event and closes without the completion event ([DONE], response.completed, or message_stop).
data: {"error":{"code":"stream_interrupted","message":"Upstream stream ended early.","type":"api_error"}}Request ID
Successful responses include an x-outerlane-request-id header and x_outerlane.request_id. Include this ID when contacting support. Requests that fail during a model call also appear with their error codes in Request logs.
Common issues
- Base URL: Use
https://api.outerlane.app/v1for the OpenAI SDK and Codex. Usehttps://api.outerlane.appfor the Anthropic SDK and Claude Code. Including/v1in the Anthropic base URL produces a404. - Existing keys: If you get
401 invalid_token, check whether an existingOPENAI_API_KEYorANTHROPIC_API_KEYin your shell or.envis overriding your outerlane key. - Model ID: Omitting the provider prefix returns
400 model_not_found.