Errors
LLMAPI returns HTTP status codes and structured error information where possible. Different protocols keep their corresponding error shapes, so there is not only one JSON error format.
Common Error Shapes
Anthropic/OpenAI compatible endpoints often return:
json
{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "Request body is empty"
}
}OpenAI image endpoints often return:
json
{
"error": {
"type": "not_found_error",
"message": "Images API is not supported for this platform"
}
}Common HTTP Status Codes
| Status | Meaning | Common causes |
|---|---|---|
400 | Invalid request | Invalid JSON, wrong parameter type, or platform group mismatch. |
401 | Authentication failed | Missing or invalid API key. |
403 | Permission denied | Insufficient balance, wrong key type, image generation disabled, or content moderation blocked. |
404 | Endpoint or capability unavailable | Non-OpenAI group calling OpenAI synchronous image endpoints, or OpenAI group calling token count. |
413 | Request body too large | Request exceeds the configured body limit. |
429 | Rate limited | Too many concurrent requests. |
500 | Server error | Unexpected server error. |
502 | Provider error | The model provider returned an error. |
503 | Service unavailable | No available accounts or a required service is unavailable. |
504 | Timeout | The request timed out. |
Platform Restriction Errors
Non-OpenAI group calling an OpenAI synchronous image endpoint:
json
{
"error": {
"type": "not_found_error",
"message": "Images API is not supported for this platform"
}
}OpenAI group calling token count:
json
{
"type": "error",
"error": {
"type": "not_found_error",
"message": "Token counting is not supported for this platform"
}
}Retry Guidance
| Error type | Recommendation |
|---|---|
400, 401, 403, 404 | Do not retry unchanged; fix request, authentication, group, or permission first. |
413 | Reduce request body or uploaded resource size. |
429 | Retry with exponential backoff and reduce concurrency. |
500, 502, 503, 504 | Retry with exponential backoff. |