Skip to main content
Set stream: true on any chat endpoint. The response is text/event-stream. Code for each endpoint: Chat Completions, Responses, Messages.

What NagaAI adds

  • The HTTP status waits for content. NagaAI sends the 200 only when the first content is ready. If the chosen provider fails before that, NagaAI tries the next one. If all fail, you get a normal error status instead of an error inside a stream.
  • Errors after the start arrive as events. See Errors in a stream.
  • A disconnect does not stop generation. If your client closes the connection, the model finishes and NagaAI charges the full request.
  • Failures before content rotate. If a provider fails inside its stream before sending content, NagaAI moves the request to another provider.