Errors you should correct first
400 indicates invalid input, 401 missing or invalid authentication, and 403 an origin or account restriction. 413 rejects an oversized body; 415 requires JSON. Changing retries will not fix these conditions.
402 means insufficient credits or inactive API access. Inspect the account before submitting more work.
Conflicts and temporary failures
409 can indicate a request still running, a reused key with different content, or a previously failed request. Reuse the same key only to retrieve the same logical request. 429 means a rate limit.
502 or 503 can indicate an invalid provider response, timeout, unavailable configuration, or provider outage. We do not silently switch to another model. Failed account decisions are refunded.
A bounded recovery policy
For an uncertain connection, wait briefly and retry the same logical request at most twice with the same idempotency key. Stop and surface the error if it persists. Include the request identifier when contacting support; do not send API keys or private customer text.