AI Help
What should my app log when an AI API request times out?
Log timing, local job and provider request identifiers, retry state and a sanitized error classification so the timeout can be investigated.
Steps to follow
- Record start time, duration, endpoint, model and relevant client timeout configuration.
- Capture the response ID and provider request ID when available, plus whether any stream data or tool result arrived.
- Track each retry and reconcile server-side state before repeating side effects. Apply your data-retention rules to diagnostics.
Example in practice
Illustrative example. A timed-out report request with a known response ID can be checked for completion instead of immediately launching another paid request.
Related AI help
- How do I verify that an AI webhook event came from my provider?
- How do I tell whether an AI API failure is temporary or needs a code change?