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.

{
"error": {
"message": "The request exceeded the model's context window (max_model_len=131072). Reduce the prompt length, compact your conversation, or lower max_tokens.",
"type": "invalid_request_error",
"param": null,
"code": "context_length_exceeded",
"model": "qwen/qwen2.5-7b-instruct",
"context_length_limit": 131072,
"request_id": "fd025fb80f35"
}
}
FieldMeaning
typeError category.
codeThe specific reason. Branch on this in your code.
messageHuman-readable description. Do not parse it.
paramThe request field at fault, when known.
request_idThe 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

StatusTypeRetry?Meaning
400invalid_request_errorNoThe request is invalid for this API or model. Fix it before retrying.
401authentication_errorNoMissing or invalid API key.
402insufficient_creditsAfter top-upYour credit balance is too low for the request.
403permission_errorNoYour key cannot use this model.
404not_found_errorNoUnknown path or model.
413invalid_request_errorNoRequest body over 50 MiB.
429rate_limit_errorYesTemporary 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

Request validation (400)

Credits (402)

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)

Rate limits

We do not publish fixed requests-per-minute or tokens-per-minute limits. Two things return 429:

429 responses include Retry-After in seconds. If you need guaranteed throughput, contact contact@abhigya.ai.

Retries

Errors during streaming

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.

curl -sS https://api.abhigya.ai/v1/chat/completions \
-H "Authorization: Bearer $ABHIGYA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen/qwen2.5-7b-instruct",
"messages": [{"role": "user", "content": "Hi"}],
"reasoning_effort": "turbo"
}'
{
"error": {
"message": "reasoning_effort 'turbo' is not supported for this model",
"type": "invalid_request_error",
"param": "reasoning_effort",
"code": "unsupported_value",
"request_id": "561a1a2e0e36"
}
}