Errors and Retries

Do not retry every failure. Fix 400, 401, 403, and 404 errors before sending the request again. Retry timeouts, 429, and transient 5xx responses only a limited number of times with exponential backoff and jitter.

StatusFirst action
400Validate fields, protocol, and model capabilities
401Check the API key and authentication header
403Check key, model, group, and IP restrictions
404Check the final URL, endpoint, and model ID
429Check quota and concurrency, then back off
5xxRetry a limited number of times

GetRouter does not guarantee that every 429 includes Retry-After. Respect it when present; otherwise use bounded exponential backoff. Protect tool calls, media jobs, and other side effects against duplicate execution.

Log the timestamp, status, endpoint, model ID, request ID, and retry count. Never log the full API key.