Streaming

All chat endpoints support streaming via stream: true.

OpenAI format

stream = client.chat.completions.create(
    model="gpt-5.5-mini",
    messages=[{"role": "user", "content": "Tell me a story"}],
    stream=True,
)
 
for chunk in stream:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="")

Anthropic format

Set "stream": true in your messages request. Klint passes through SSE events from upstream providers.

Token usage is reported in the final chunk or via the x-klint-usage response header.