Error Codes & Retry Strategy
| HTTP | Error Code | Cause | Recommendation |
|---|
| 400 | INVALID_PARAM | Invalid parameter | Fix input and retry |
| 401 | UNAUTHORIZED | Authentication failed | Check or rotate API key |
| 403 | PLAN_RESTRICTED | Plan limit reached | Upgrade plan or switch zone |
| 429 | RATE_LIMITED | Rate limit exceeded | Use exponential backoff |
| 502/503 | UPSTREAM_UNAVAILABLE | Upstream instability | Short retries or switch zone |
Recommended Retry Window
500ms, 1s, 2s, 4s
Retry only 429/502/503 for up to 4 attempts
Fail fast on 400/401/403 and raise alerts
Observability Metrics
- Success rate (2xx ratio)
- P95 latency
- Error distribution per zone
- Hourly quota burn rate
Next: Billing & Quotas