Errors and Rate Limits
Error format, error codes, retry guidance, rate limits, and streaming failures.
Error format
Failed requests return a JSON body with an error object.
| Field | Meaning |
|---|---|
type | Error category. |
code | The specific reason. Branch on this in your code. |
message | Human-readable description. Do not parse it. |
param | The request field at fault, when known. |
request_id | The request ID. Same value as the x-request-id response header. |
Request IDs
Successful responses carry an x-request-id header. Log it, and include it when you contact support. A few 429 responses from the front proxy have no request ID.
Status codes
| Status | Type | Retry? | Meaning |
|---|---|---|---|
400 | invalid_request_error | No | The request is invalid for this API or model. Fix it before retrying. |
401 | authentication_error | No | Missing or invalid API key. |
402 | insufficient_credits | After top-up | Your credit balance is too low for the request. |
403 | permission_error | No | Your key cannot use this model. |
404 | not_found_error | No | Unknown path or model. |
413 | invalid_request_error | No | Request body over 50 MiB. |
429 | rate_limit_error | Yes | Temporary capacity, concurrency, or transient failure. |
We usually return transient server-side failures as 429 with a Retry-After header rather than 5xx, so SDK retry logic for rate limits covers them. Treat any 5xx you do receive as retryable too.
Error codes
Authentication and access
missing_api_key(401): NoAuthorization: Bearerheader.invalid_api_key(401): The key does not exist or was revoked.model_not_allowed(403): The model exists, but your account cannot use it.model_not_found(404): Unknown model, or a model your account cannot access.not_found(404): The path is not a Serverless route.
Request validation (400)
invalid_json_request: The body is not valid JSON, or is not a JSON object.missing_model: The request has nomodel.context_length_exceeded: The request does not fit the context window.unsupported_value: A field has a value the model does not accept.unsupported_feature: The model does not support a requested feature.unsupported_parameter: The API does not support the field.unsupported_response_format: The model does not support theresponse_formattype.tool_schema_invalid: A tool'sparametersis not an object schema.missing_tool_name,duplicate_tool_name: A tool has no name, or two tools share a name.tool_choice_unknown_tool:tool_choicenames a tool that is not intools.missing_tool_call_id,orphan_tool_message: A tool message does not match an earlier tool call.unsupported_input_item,unsupported_content_type: An input type is not supported on this API.model_request_rejected: The model rejected the request. Check it before retrying.
Credits (402)
insufficient_credits: Your balance is below the estimated cost. Add credits at www.abhigya.ai, then retry.member_spend_limit: A spend limit on your account has been reached.
The credit check happens before the request runs. The estimate assumes the request generates its full max_tokens. With a low balance, set a smaller max_tokens.
Rate limits and capacity (429)
server_overloaded: The model is temporarily at capacity. Retry afterRetry-After.concurrency_limit_exceeded: Your account has too many requests in flight.model_service_unavailable,model_request_timeout: Transient failures. Retry afterRetry-After.rate_limited: An unexpected error on our side. Retry; if it repeats, contact support with the request ID.
Rate limits
We do not publish fixed requests-per-minute or tokens-per-minute limits. Two things return 429:
- Model capacity. When a model is busy, new requests are shed with
server_overloadedinstead of being queued for a long time. - Account concurrency. Exceeding your account's in-flight limit returns
concurrency_limit_exceeded.
429 responses include Retry-After in seconds. If you need guaranteed throughput, contact contact@abhigya.ai.
Retries
- Retry
429after theRetry-Afterdelay, using exponential backoff with jitter and a cap on attempts. - Do not retry other
4xxerrors unchanged. Fix the request first. For402, add credits first. - Requests that fail before generation starts are not charged. A stream that fails after it starts may be charged for tokens already generated.
Errors during streaming
- Chat Completions: an error arrives as a
data:line with anerrorobject instead of a chunk. It can still be followed bydata: [DONE], so[DONE]alone does not mean success.
A stream that ends without data: [DONE] failed; retry the request.
Timeouts
A non-streaming request that runs longer than about 15 minutes can fail with server_overloaded. A stream can drop if no data arrives for about 15 minutes. Use streaming for long generations, and set client timeouts to at least 15 minutes.
Request example
This request fails with unsupported_value because reasoning_effort is not a supported value.