Merkium

Search Merkium

API reference

Streaming

Set "stream": true to receive the response as it is generated. The API sends server-sent events in the OpenAI streaming format.

Make a streaming request

curl -N https://chat.merkium.nl/api/v1/chat/completions \
  -H "Authorization: Bearer $MERKIUM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "ganymede-1.1",
    "messages": [{ "role": "user", "content": "Is 91 prime? One sentence." }],
    "stream": true
  }'

Event format

The response has Content-Type: text/event-stream. Each event is a line starting with data: followed by a JSON chat.completion.chunk, and events are separated by a blank line. The stream may open with an SSE comment line (: open), which clients should ignore.

text/event-stream (shortened)
: open

data: {"id":"chatcmpl-a0da861baf51","object":"chat.completion.chunk","created":1792542511,"model":"ganymede-1.1","choices":[{"index":0,"delta":{"reasoning_content":"The"},"finish_reason":null}]}

data: {"id":"chatcmpl-a0da861baf51","object":"chat.completion.chunk","created":1792542511,"model":"ganymede-1.1","choices":[{"index":0,"delta":{"reasoning_content":" user asks: Is"},"finish_reason":null}]}

data: {"id":"chatcmpl-a0da861baf51","object":"chat.completion.chunk","created":1792542511,"model":"ganymede-1.1","choices":[{"index":0,"delta":{"content":"7 times"},"finish_reason":null}]}

data: {"id":"chatcmpl-a0da861baf51","object":"chat.completion.chunk","created":1792542511,"model":"ganymede-1.1","choices":[{"index":0,"delta":{"content":" 13 equals "},"finish_reason":null}]}

data: {"id":"chatcmpl-a0da861baf51","object":"chat.completion.chunk","created":1792542511,"model":"ganymede-1.1","choices":[{"index":0,"delta":{"content":"91."},"finish_reason":"stop"}]}

data: {"id":"chatcmpl-a0da861baf51","object":"chat.completion.chunk","created":1792542511,"model":"ganymede-1.1","choices":[],"usage":{"prompt_tokens":2801,"completion_tokens":54,"total_tokens":2855}}

data: [DONE]

Chunk fields

object
Always "chat.completion.chunk". Every chunk in a stream shares the same id.
choices[].delta.reasoning_content
The next piece of reasoning text. Reasoning chunks arrive before the answer. See Reasoning.
choices[].delta.content
The next piece of the answer text.
choices[].delta.tool_calls
Tool call fragments, keyed by index. See streaming tool calls.
choices[].finish_reason
null until the last content chunk, which carries the reason, such as "stop", "tool_calls" or "length".
usage
Sent once, in a final chunk with an empty choices array, after the last content chunk.

End of stream

The stream always ends with a literal data: [DONE] line. It is not JSON, so stop reading when you see it instead of parsing it. The OpenAI SDKs handle this for you.

Questions or problems with the API: mail@merkium.nl. Last verified against the live API on October 20, 2026.