Documentation

Error Handling

Updated: Nov 11, 2026

Error response formats, error codes, and recommended handling for Chat and Images APIs.

This page applies to Chat and Images APIs.

These APIs can return two types of errors, each with its own response format: API errors and native model errors.

1. API Errors

If a request fails validation or cannot be processed by the platform, the response body has the following format:

{
  "requestId": "7f0d6ef8-a3c9-4f61-8e6f-1d5c8a720134",
  "code": 40000,
  "message": "bad request:model must be not empty"
}
FieldTypeDescription
requestIdstringRequest ID. Matches the X-Vod-Request-Id response header.
codeintegerPlatform error code. Use it together with the HTTP status code to identify the error.
messagestringError message. Details may follow the colon.

The API can return the following error codes:

HTTP StatuscodemessageCommon Causes
40040000bad requestInvalid JSON, missing model, or an X-Vod-Request-Id that is not 16–64 characters long
40140100unauthorizedMissing, malformed, or expired API Key, or an unavailable account
40340300forbiddenThe client IP is not on the API Key's allowlist
40440400not foundThe request path does not exist
40440402model not existThe requested model does not exist
40440403model not exist in this pathThe model is not available on this native API path
40540500method not allowedThe path exists, but the HTTP method is not supported
40940900conflictThe same account reused an X-Vod-Request-Id within 8 hours
42942900rate limitingThe request rate, concurrency, or token quota was exceeded
50050000internal errorAn internal error occurred while processing the request
50250200bad gatewayThe upstream model service is temporarily unavailable
50350300service unavailableThe API or model service is temporarily unavailable

2. Native Model Errors

If a request passes validation and reaches the model, any error returned by the model is passed through unchanged. These errors follow the format of the protocol you call (OpenAI, Anthropic, or Gemini) rather than the requestId/code/message format above. An OpenAI-format error looks like this:

{
  "error": {
    "message": "The requested model is unavailable.",
    "type": "invalid_request_error",
    "param": "model",
    "code": "model_not_found"
  }
}

Fields and values are defined by the model provider. The main differences between protocols are:

  • OpenAI: error.code is usually a string.
  • Anthropic: error.type indicates the error type.
  • Gemini: error.code is usually a number.
  1. If the response body contains a top-level integer code greater than 0, handle it as an API error.
  2. Otherwise, parse the error according to the protocol you called (OpenAI, Anthropic, or Gemini).
  3. Then act on the HTTP status code:
    • 400, 401, 403, 404, 405, 409: Correct the request, credentials, or path before trying again.
    • 429: Reduce the request rate or concurrency, then retry.
    • 500, 502, 503: Retry a limited number of times with backoff, using a new X-Vod-Request-Id for each retry.

When contacting support, include the X-Vod-Task-Id from the response headers.