Skip to main content

Limits and errors

Limits​

LimitValue
Tokens per request131,072, state and questions together
Questions per request64
Options per choiceTested up to 151
Images per request8, as base64 data URLs
thinking_budget16 to 4096 tokens
Span max_tokens1 to 96
Spans max_items1 to 64

Errors​

StatusWhenBody
400model is missing{"error": "Model name not provided"}
400Unknown model name, such as jev-latest{"error": "Model not found"}
400 / 422Invalid request: unknown thinking value, bad question shape, state too long, raw text state on chat completions{"error": {"code": ..., "message": "..."}}
401No Authorization header, or not in the form Bearer sk-...{"error": {"code": "authentication_error", "message": "Authorization header missing or invalid format. ..."}}
403API key not valid{"error": {"code": "authentication_error", "message": "Access forbidden"}}
429Rate limit for your keyNo Retry-After header. Wait a second or two and retry.

Reading validation errors​

The message of a validation error is itself a JSON string. Parse it to get the reason, for example thinking: one of "off", "auto", "auto_forced", "always".

import json

resp = requests.post(url, headers=headers, json=body, timeout=30)
if resp.status_code in (400, 422):
error = resp.json()["error"]
if isinstance(error, dict):
try:
reason = json.loads(error["message"])
except (TypeError, ValueError):
reason = error["message"]
print("Invalid request:", reason)

Retrying​

Retry 429 and 5xx responses with backoff. A 429 has no Retry-After header, so wait a second or two before the first retry and longer after each one. Don't retry 400, 401, 403 or 422: fix the request or the key first.

Getting help​

If you think a response is wrong or the service is misbehaving, contact ASI:Cloud support.