[inference-errors analysis, mapped against provider docs]: 400 with context_length_exceeded means the prompt exceeded the model's context: trim, do not retry. 400 model_not_found and 404 both mean the model ID is wrong; check the model list. 429 without a billing code is a real rate limit: back off. 429 with insufficient_quota or credit_balance_exhausted is a billing problem: retrying burns time, top up instead. 408, 409, 498, and 5xx are transient: retry with backoff. 401 is authentication: fix the key.

Context: A bare HTTP status is not enough to decide retry behavior. The provider's own error code is what matters.