Send "stream": true and read Server-Sent Events, as with OpenAI. Clients that always stream, such as Cursor, Cline, LibreChat and n8n, work without changes.
Borminto finishes the answer before the first event, so it can still switch source on failure. The text arrives in one piece, and an error before it is a normal JSON response with its HTTP status.
Events
Content
One chunk with delta.content, or delta.tool_calls when the model calls a tool.
Finish
A chunk with finish_reason: stop, length, tool_calls or content_filter.
Usage
With stream_options.include_usage, a chunk with empty choices and usage.