Limits and errors
Limits​
| Limit | Value |
|---|---|
| Tokens per request | 131,072, state and questions together |
| Questions per request | 64 |
| Options per choice | Tested up to 151 |
| Images per request | 8, as base64 data URLs |
thinking_budget | 16 to 4096 tokens |
Span max_tokens | 1 to 96 |
Spans max_items | 1 to 64 |
Errors​
| Status | When | Body |
|---|---|---|
| 400 | model is missing | {"error": "Model name not provided"} |
| 400 | Unknown model name, such as jev-latest | {"error": "Model not found"} |
| 400 / 422 | Invalid request: unknown thinking value, bad question shape, state too long, raw text state on chat completions | {"error": {"code": ..., "message": "..."}} |
| 401 | No Authorization header, or not in the form Bearer sk-... | {"error": {"code": "authentication_error", "message": "Authorization header missing or invalid format. ..."}} |
| 403 | API key not valid | {"error": {"code": "authentication_error", "message": "Access forbidden"}} |
| 429 | Rate limit for your key | No 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.