When a request fails, the API returns a non-200 HTTP status code and an error message. Record the request id in the response; you can use it to look up the request in Call Diagnostics in the console or share it with support.AI Model API#
Error responses follow the OpenAI format (APIs using the Anthropic or Gemini protocol return their own standard error formats):{
"error": {
"code": "",
"message": "无效的令牌 (request id: 20261024045136443822397f1ThV5v7)",
"type": "server_error"
}
}
| HTTP status | Typical message | Cause and fix |
|---|
| 400 | Parameter error, invalid_request_error | The request body or parameters do not meet the model's requirements. Check the JSON format, parameter names, and value ranges |
| 401 | 无效的令牌 (invalid token) | The key is wrong, deleted, or from another site. Confirm the key in the console |
| 401 / 403 | 该令牌已过期 (token expired), 该令牌额度已用尽 (token quota exhausted), 该令牌状态不可用 (token unavailable) | The key has expired, hit its quota limit, or been disabled. Adjust it in Model API key |
| 403 | 用户额度不足 (insufficient account balance) | Your account balance is too low. Top up |
| 403 | error code: 1010 | Blocked by the security layer because the request has no User-Agent. Use an official SDK or set a User-Agent |
| 404 | Invalid URL, 404 page not found | Wrong path, usually one /v1 too many or too few in the base URL. See Base URL and SDKs |
| 404 / 503 | 模型不存在或已下架 (model not found or retired), 分组 xxx 下模型 xxx 无可用渠道 (no available channel for model xxx in group xxx) | The model name is misspelled, or your key's group does not support this model. Switch to Stability First or use a group that supports the model |
| 429 | 当前分组上游负载已饱和,请稍后再试 (group is at capacity, try again later) | Too many requests or resources are busy. Reduce concurrency and retry with exponential backoff |
| 500 / 502 | upstream error, do request failed | Upstream service error. Retry later; if it persists, contact support with the request id |
| 504 / 524 | Gateway timeout | Generation took too long. Enable streaming ("stream": true) or increase your client timeout |
Retry 429, 500, 502, 503, and 504 automatically with exponential backoff (for example 1s, 2s, 4s, up to 3–5 attempts). 400, 401, 403, and 404 are caused by the request itself, so retrying will not help.
Search & Reader API#
On success, code is 0. On failure, the response uses one of these shapes:{ "code": 40001, "data": null, "message": "parameters err" }
{ "error": "Invalid api key" }
| HTTP status | code / error | Description and fix |
|---|
| 400 | 40001 parameters err | A parameter is missing or malformed, for example no q or url |
| 400 | 40003 Invalid protocol | Invalid URL scheme; only http / https are supported |
| 400 / 500 | 32003 Unsupported content type | The file or page content type cannot be parsed |
| 401 | Invalid api key | The key is wrong, or a Model API key was used by mistake |
| 403 | search quota exceeded / reader quota exceeded | Search or reader credits are used up. Buy a plan |
| 429 | Rate limit exceeded | Rate limit exceeded. See Rate limits and billing rules |
| 500 | 32000 Failed to extract content | The page content could not be extracted. Try another URL or adjust waitUntil |
| 500 | 32001 Target URL is unreachable | The target URL cannot be reached |
| 500 | 32002 Request timeout | Reading timed out. Increase timeout and retry |
| 500 | 32004 SSL certificate error | The target site has an SSL certificate problem |
| 500 | 50001 internal server error | Internal server error. Retry later; if it persists, contact support |
Failed requests do not consume credits.Get help#
When contacting support, include your account email, the request time, the request id, and the full error message.