> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orbitrage.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Streaming

> Stream tokens through Orbitrage — the SDK sees a clean OpenAI stream.

Set `stream: true` as usual. Orbitrage streams the response straight through and
records the call when it finishes.

<CodeGroup>
  ```python Python theme={null}
  import os, orbitrage
  orbitrage.init(os.environ["ORBITRAGE_API_KEY"], user_id="customer_42")

  from openai import OpenAI
  stream = OpenAI().chat.completions.create(
      model="minimax-m3",
      messages=[{"role": "user", "content": "Count to five."}],
      stream=True,
  )
  for chunk in stream:
      delta = chunk.choices[0].delta.content
      if delta:
          print(delta, end="", flush=True)
  ```

  ```typescript Node.js theme={null}
  import { orbitrage } from "orbitrage";
  await orbitrage.init({ apiKey: process.env.ORBITRAGE_API_KEY, userId: "customer_42" });

  import OpenAI from "openai";
  const stream = await new OpenAI().chat.completions.create({
    model: "minimax-m3",
    messages: [{ role: "user", content: "Count to five." }],
    stream: true,
  });
  for await (const chunk of stream) {
    process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
  }
  ```
</CodeGroup>

<Note>
  Orbitrage strips its internal routing events from the stream and rewrites
  empty-`choices` frames, so SDKs never crash mid-stream. You just get the
  normal OpenAI chunks.
</Note>

Streamed calls also record first-token latency and inter-token p50/p95, visible
on the call's detail in the dashboard.
