Stream tokens over Server-Sent Events. Use it when users benefit from seeing output as it is generated, such as chat, coding, and long-form responses.
import osfrom openai import OpenAIclient = OpenAI(base_url="https://api.sealink.io/v1", api_key=os.environ["SEALINK_API_KEY"])stream = client.chat.completions.create(model="claude-opus-5-5",messages=[{"role": "user", "content": "Stream a 200-word reply."}],stream=True,)for chunk in stream:delta = chunk.choices[0].delta.contentif delta:print(delta, end="", flush=True)print()
import OpenAI from "openai";const client = new OpenAI({baseURL: "https://api.sealink.io/v1",apiKey: process.env.SEALINK_API_KEY,});const stream = await client.chat.completions.create({model: "claude-opus-5-5",messages: [{ role: "user", content: "Stream a 200-word reply." }],stream: true,});for await (const chunk of stream) {const delta = chunk.choices[0]?.delta?.content;if (delta) process.stdout.write(delta);}
curl https://api.sealink.io/v1/chat/completions \-H "Authorization: Bearer $SEALINK_API_KEY" \-H "Content-Type: application/json" \-N \-d '{"model": "claude-opus-5-5","messages": [{"role":"user","content":"Stream please"}],"stream": true}'