錯誤與冪等

標準錯誤、重試、限流與防止重複提交。

錯誤使用 application/problem+json、真實 HTTP 狀態碼與 request_id

建立請求必須使用 8–128 字元的 Idempotency-Key。伺服器僅儲存 Key 的 HMAC 與請求指紋:相同 Key/本文回傳原任務;相同 Key/不同本文回傳 409 idempotency_conflict;原請求仍在處理時回傳 409 request_in_progress。自動重試不可產生新 Key。

常見錯誤包括 invalid_api_keyinvalid_api_key_rate_limitedapi_key_expiredinsufficient_scopevalidation_errorunsupported_modelunsupported_parameterinput_url_not_allowedinsufficient_creditspayment_requiredaccount_suspendednetwork_not_allowedrate_limit_exceededconcurrency_limit_exceededprovider_unavailableservice_unavailable

同一客戶端 IP 連續提交無效憑證也會被限流;系統只儲存經 Pepper HMAC 處理的 IP 指紋。

網路錯誤、429503 可退避重試,但本文與冪等 Key 必須完全相同。Provider 結果無法確認時,API 會拒絕盲目重提。

重新嘗試前務必遵循 Retry-After header。