AI Help

Why did an AI API response stop halfway through its answer?

Inspect the final response status and transport outcome to distinguish token-limit truncation, interruption and incomplete processing.

Steps to follow

  1. Save the response ID, status, incomplete details and stream termination information available from the endpoint.
  2. Check output-token limits and whether the client consumed the whole stream. A dropped connection can occur while server-side work continues.
  3. Retrieve the response when supported and reconcile existing output before retrying. Request a continuation with clear boundaries when appropriate.

Example in practice

Illustrative example. A response ending mid-table with an output-limit reason needs a smaller scope or a larger supported limit before the table is accepted.

Related AI help

Official guidance

OpenAI documentation