Skip to content

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"
  }
}

Task API business errors commonly use the following shape. Authentication failures still use authentication_error:

json
{
  "error": {
    "type": "TASK_INVALID_REQUEST",
    "message": "params is required"
  }
}

Common HTTP Status Codes

StatusMeaningCommon causes
400Invalid requestInvalid JSON, wrong parameter type, or platform group mismatch.
401Authentication failedMissing or invalid API key.
403Permission deniedInsufficient balance, wrong key type, image generation disabled, or content moderation blocked.
404Endpoint or capability unavailableNon-OpenAI group calling OpenAI synchronous image endpoints, or OpenAI group calling token count.
409State conflictCanceling a task that already finished.
413Request body too largeRequest exceeds the configured body limit.
429Rate limitedToo many concurrent requests or queued tasks.
500Server errorUnexpected server error.
502Provider errorThe model provider returned an error.
503Service unavailableTasks disabled, storage not configured, or no available accounts.
504TimeoutThe request or task timed out.

Task API Errors

ReasonHTTP statusMeaning
authentication_error401API key is missing or invalid.
TASKS_DISABLED503Task API service is disabled.
TASKS_PAUSED503Task API processing is temporarily paused.
TASK_SCOPE_REQUIRED403The API key is not enabled for Task APIs.
TASK_INVALID_REQUEST400Request body is invalid.
TASK_UNSUPPORTED_MODEL400Requested model is not available for Task API.
TASK_UNSUPPORTED_ADAPTER400Requested model does not support this task type.
TASK_NO_CAPABLE_ROUTE400No available channel can preserve the requested parameters or input-asset combination.
TASK_PRICING_UNAVAILABLE503Pricing is unavailable for the requested model or parameters.
TASK_STORAGE_UNAVAILABLE503Result asset storage is unavailable.
TASK_INSUFFICIENT_BALANCE403Balance is insufficient for the estimated task cost.
TASK_QUEUE_LIMIT_EXCEEDED429User or API key queue limit was reached.
TASK_ALREADY_TERMINAL409Task is already finished and cannot be canceled.
TASK_NOT_FOUND404Task does not exist or is not accessible with this API key.

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 typeRecommendation
400, 401, 403, 404Do not retry unchanged; fix request, authentication, group, or permission first.
409Fetch the latest task state before deciding what to do next.
413Reduce request body or uploaded resource size.
429Retry with exponential backoff and reduce concurrency or queued tasks.
500, 502, 503, 504Retry with exponential backoff; for accepted Task API, query task status first to avoid duplicate submissions.

If POST /v1/tasks returned 202, use the returned id for follow-up checks instead of immediately submitting a duplicate task after a client-side timeout.