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

  1. Record start time, duration, endpoint, model and relevant client timeout configuration.
  2. Capture the response ID and provider request ID when available, plus whether any stream data or tool result arrived.
  3. 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

Official guidance

OpenAI documentation