指南
錯誤
所有錯誤的回應主體都相同。僅對 429、500 與 503 重試。
錯誤回應主體
json
{ "error": { "code", "message", "request_id", "param"?, "retry_after_s"? } }
錯誤碼
invalid_parameter | 400 | |
missing_location | 400 | |
invalid_json | 400 | |
invalid_key | 401 | |
unauthorized | 401 | |
key_required | 401 | |
place_not_found | 404 | |
not_found | 404 | |
invalid_promo | 404 | |
method_not_allowed | 405 | |
gone | 410 | |
key_exists | 409 | |
key_limit | 409 | |
already_subscribed | 409 | |
no_subscription | 409 | |
unsupported_media_type | 415 | |
rate_limited | 429 | 重試 |
quota_exceeded | 429 | |
server_error | 500 | 重試 |
unavailable | 503 | 重試 |
accounts_closed | 503 |
llms-full.txt 說明了每個錯誤碼。
如何重試
收到 429 時,等待 Retry-After 秒後再試;回應主體中的 retry_after_s 與之一致。