Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

エラーコード

Lazu のエラーは OpenAI 互換の envelope を使います。

{
  "error": {
    "message": "Human-readable description",
    "type": "invalid_request_error",
    "code": "missing_required_parameter",
    "param": "purpose",
    "request_id": "req_lazu_01ABCDEF..."
  }
}

プログラムでは message ではなく、安定した code を見てください。 request_idX-Lazu-Request-Id header にも入ります。

HTTP status

Status種類対応
400Bad requestbody や params を修正
401Auth failedAPI Key を修正。修正なしに retry しない
403Forbiddenkey disabled、IP allowlist、quota を確認
404Not foundpath、model、file_id を確認
413Payload too largefile や参照内容が大きすぎる
422Validation failedschema は合うが値が不正
429Rate limitRetry-After 後に retry
5xxLazu/upstreamexponential backoff で retry

よく使う code

Code意味
invalid_api_keykey がない、形式不正、削除済み
insufficient_quota残高が不足
ip_not_allowedkey の IP allowlist 外
token_disabledkey が手動で無効化された
token_expiredkey が期限切れ
missing_required_parameter必須 field がない
model_not_foundmodel が存在しない、または key がアクセスできない
file_not_foundfile_id がない、または現在の key のものではない
file_too_largefile または dereference 合計が上限超過
pricing_not_configuredmodel はあるが lane 価格が未設定
request_rate_limit_exceededaccount tier の RPM 上限
token_rate_limit_exceededAPI Key の RPM/TPM 上限
upstream_errorupstream が非 2xx を返した
upstream_timeoutupstream timeout
no_available_channelmodel+lane を処理できる channel がない

retry 方針

429500502503504、upstream 5xx は retry できます。 400401403404422 は先にリクエスト、認証、quota を修正してください。

関連ページ