Response transport affects recovery
A confirmed completion may arrive in one response, while an uncertain provider outcome returns a durable job. A generic streaming parser can mishandle either branch or treat JSON as event-stream data. The integration should check HTTP status and object shape before deciding what the user sees.
What to do next
- 01
Remove streaming defaults
Inspect your SDK or chat widget configuration for an automatically inserted stream flag. Keep only the documented request fields and send stream=false explicitly.
- 02
Use a bounded wait
Set a reasonable client timeout and preserve the original idempotency identifier before transmission. If the client stops waiting, recover the same task rather than generating another chat completion.
- 03
Render confirmed content
When choices are present, display the returned assistant message and retain usage. When a durable job is returned, show pending or uncertain status and follow that existing record.
A concrete example
Illustrative mismatch: a frontend expects lines beginning with data: but receives a JSON completion. The parser reports an error even though the model finished. Correct response handling before requesting another paid answer.
Before you call it ready
- The transmitted flag is false.
- The parser expects JSON rather than events.
- A timeout preserves the existing task identity.
When to stop or choose another method
If live token streaming is essential to your product, treat it as an unmet requirement in the current API. Do not advertise it based only on a familiar endpoint name.
