ドキュメント · 本番運用

エラーコード

Errors use standard HTTP status codes. OpenAI-format endpoints return OpenAI-style error bodies; the Anthropic-format endpoint returns Anthropic-style ones.

本文は現在英語版のみ提供しています。

{
  "error": {
    "message": "Invalid API key",
    "type": "invalid_request_error",
    "code": "invalid_api_key"
  }
}
{
  "type": "error",
  "error": { "type": "authentication_error", "message": "invalid x-api-key" }
}
StatusMeaningWhat to do
400Invalid parameters, malformed JSON, a parameter the model does not support, or input beyond the context lengthFix the request; do not retry
401Missing, wrong or deleted API keyCheck the auth header
403Insufficient balance, or the key is disabled / not allowed to use this modelCheck balance and key settings in the console
404Wrong path or unknown modelCheck the base URL (the OpenAI SDK needs /v1) and the model ID
413Request body too largeShrink images or trim context
429Too many requests, or the upstream is rate-limitingBack off and retry; lower concurrency
500Internal errorSafe to retry
502 / 503Upstream temporarily unavailableRetry after a short delay
504Upstream timed outUse streaming or retry later

Requests that fail with an error are not billed. For retry strategy see Best practices.