エラーコード
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_id は X-Lazu-Request-Id header にも入ります。
HTTP status
| Status | 種類 | 対応 |
|---|---|---|
| 400 | Bad request | body や params を修正 |
| 401 | Auth failed | API Key を修正。修正なしに retry しない |
| 403 | Forbidden | key disabled、IP allowlist、quota を確認 |
| 404 | Not found | path、model、file_id を確認 |
| 413 | Payload too large | file や参照内容が大きすぎる |
| 422 | Validation failed | schema は合うが値が不正 |
| 429 | Rate limit | Retry-After 後に retry |
| 5xx | Lazu/upstream | exponential backoff で retry |
よく使う code
| Code | 意味 |
|---|---|
invalid_api_key | key がない、形式不正、削除済み |
insufficient_quota | 残高が不足 |
ip_not_allowed | key の IP allowlist 外 |
token_disabled | key が手動で無効化された |
token_expired | key が期限切れ |
missing_required_parameter | 必須 field がない |
model_not_found | model が存在しない、または key がアクセスできない |
file_not_found | file_id がない、または現在の key のものではない |
file_too_large | file または dereference 合計が上限超過 |
pricing_not_configured | model はあるが lane 価格が未設定 |
request_rate_limit_exceeded | account tier の RPM 上限 |
token_rate_limit_exceeded | API Key の RPM/TPM 上限 |
upstream_error | upstream が非 2xx を返した |
upstream_timeout | upstream timeout |
no_available_channel | model+lane を処理できる channel がない |
retry 方針
429、500、502、503、504、upstream 5xx は retry できます。
400、401、403、404、422 は先にリクエスト、認証、quota を修正してください。