AI Help
How do I tell whether an AI API failure is temporary or needs a code change?
Classify the provider's status and error code before retrying. Temporary availability failures, invalid inputs and quota problems require different handling.
Steps to follow
- Capture the error type, status, request ID and relevant documented details.
- Use bounded backoff for eligible transient errors. Fix invalid parameters, authentication, access or exhausted quota through the appropriate configuration path.
- Route unresolved failures to review and preserve the job for safe recovery. Reconcile ambiguous completed work before repeating it.
Example in practice
Illustrative example. An invalid model identifier needs a configuration correction, while a temporary server error may qualify for a limited retry.
Related AI help
- What should my app log when an AI API request times out?
- How do I measure time to first token versus total response time in a streaming AI app?