Skip to content
AppmakeDocs
Log inGet started
Kalle by Appmake API · Endpoints

Streaming

Get the reply piece by piece as it is written, so people see the answer straight away.

Base URLhttps://api.kalle.build/v1AuthBearer kalle_sk_…VersionKalle-Version: 2026-11-01

Stream a message

Set stream to true. The response is a stream of server-sent events. The SDKs give you a helper that yields the text as it arrives.

POST/v1/messages
curl https://api.kalle.build/v1/messages --no-buffer \
  -H "Authorization: Bearer $KALLE_API_KEY" \
  -H "Kalle-Version: 2026-11-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kalle-turbo-max",
    "max_tokens": 1024,
    "messages": [
      {
        "role": "user",
        "content": "Write a short welcome text for a yoga studio in Copenhagen."
      }
    ],
    "stream": true
  }'
Open in Appmake

Event types

EventWhen
message_startOnce, with the message ID and model
content_block_startWhen a text or tool block starts
content_block_deltaEach new piece of text, in delta.text
content_block_stopWhen a block is finished
message_deltaAt the end, with stop_reason and final usage
message_stopThe last event
pingSent every 15 seconds to keep the connection open
Raw events
event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Welcome to "}}

event: message_stop
data: {"type":"message_stop"}

Errors during a stream

If something goes wrong after the stream has started, you get an error event with the same shape as a normal error, and the stream ends.