TESSEN Platform
Documentation
Docs/Model capabilities
MODEL CAPABILITIES

Streaming

Show the answer as it is written, and read the cost from the last frame.

Set stream: true and read the response as server-sent events. The first text arrives quickly, so interfaces can show progress instead of waiting for the full answer. Streaming is supported on Z1, Z1 Code, H1 and Project ZERO.

STREAMING COMPLETION
curl -N https://api.tessen.ai/v1/chat/completions \  -H "Authorization: Bearer $TESSEN_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "model": "z1",    "stream": true,    "max_tokens": 256,    "messages": [{"role": "user", "content": "Say hello in five words."}]  }'
WHAT ARRIVES
data: {"id":"85fef9589fba4d84af7a76e0a4581c6b","object":"chat.completion.chunk","created":1793282257,"model":"z1","choices":[{"index":0,"delta":{"content":"o"},"finish_reason":null}]} data: {"id":"85fef9589fba4d84af7a76e0a4581c6b","object":"chat.completion.chunk","created":1793282257,"model":"z1","choices":[{"index":0,"delta":{"content":"k"},"finish_reason":"stop"}]} data: {"id": "85fef9589fba4d84af7a76e0a4581c6b", "object": "chat.completion.chunk", "created": 1793282257, "model": "z1", "choices": [], "usage": {"prompt_tokens": 11, "completion_tokens": 2, "total_tokens": 13, "cost_usd": 2.85e-05, "cost_provenance": "family_price", "rate_id": "commercial-v1-2026-10-25"}} data: [DONE]

Three things to handle

  • Error frames. A refusal (for example 402 or 400) arrives as data: {"error": {...}} inside an HTTP 200 stream, with type where a plain response has code. Check for error before reading choices.
  • The usage frame. The last data frame has choices: [] and usage; on Tessen's families it includes cost_usd, the settled cost. Do not treat the empty choices as a failure.
  • The terminator. The stream ends with data: [DONE].
Note

Reasoning models spend output tokens thinking before the first answer token, and that reasoning is not streamed. H1 can pause before its first text appears.

Search documentation

Titles, headings and guides↑ ↓ navigate · Enter open
Streaming · Tessen Docs