Getting startedDraft
Live stream
What the model is doing, its reasoning, research and tool calls, as server-sent events.
Draft
Send stream: true to POST /turns and the response arrives as server-sent events. Each event is one line starting with data: followed by a JSON object with a kind. The stream ends with data: [DONE].
Now
Waiting for a request
Press play to replay the stream.
An illustration: the field names follow the draft of the stream format, and the question, reasoning and findings are made up for the example.
Status and the mascot
A status event is sent every time the turn changes activity. It names the activity and links the animated KOLDOS logo for it, in 512 and 128 pixels, so your app can show the right image at each moment. Without streaming, GET /turns/{id} returns the current status, and GET /turns/{id}/mascot redirects to the current image.
{
"kind": "status",
"activity": "researching",
"label": "Researching",
"mascot": {
"motion": "research",
"gif": "https://koldos.plodex.xyz/mascot/research.gif",
"gif_small": "https://koldos.plodex.xyz/mascot/research-128.gif"
}
}Researching
researchingDeep research runs several investigations, each with its own reasoning.
/mascot/research.gifUsing tools
executingThe executor calls tools in a bounded loop and reads each result.
/mascot/code.gif
Event kinds
| Event | What it says | Fields | Origin |
|---|---|---|---|
| status | What the turn is doing right now, with the mascot image for that activity. | activity, label, mascot.motion, mascot.gif, mascot.gif_small | New for the API |
| policy | The route the Decision Engine chose and the context it assembled. | route, intent, context_tokens, context_budget | Emitted by the engine today |
| plan | The steps of a multi-step goal, before any of them runs. | goal, steps[].id, steps[].goal, steps[].tools | Emitted by the engine today |
| thinking | The model's reasoning, streamed in pieces. Deep reasoning is marked. | depth, text | New for the API |
| research | One investigation of a deep research turn: its question, its reasoning and what it found. | id, question, state, thinking, findings[], sources | New for the API |
| step | One executor tool call and whether it worked. | tool, ok, ms, args, path | Emitted by the engine today |
| guard | A guard stopped something: a repeated call, a blind overwrite, a claim without looking. | guard, hint | Emitted by the engine today |
| content | The answer text. | text | Emitted by the engine today |
| sources | The web sources actually read, including the ones discarded. | items[].title, items[].url, items[].used | Emitted by the engine today |
| usage | Tokens generated and credits charged for the turn. | generated, credits | Emitted by the engine today |
| error | Why the turn stopped early. The answer is incomplete. | error | Emitted by the engine today |
Reasoning and research
thinkingevents carry the model's reasoning in pieces.depthisdeepfor the longer reasoning before a hard answer. Turn it off withshow_thinking: false.- A deep research turn sends one
researchevent when each investigation starts and another when it finishes, with its question, its reasoning, its findings and how many sources it read. sourceslists the pages actually read, including the ones that were discarded, so the answer never depends on the model remembering to cite them.
Tool calls and guards
Each step is one tool call by the executor: the tool, whether it worked, how long it took and a short form of its arguments. A guard means the engine stopped something, for example the same call repeated without progress, or a file overwritten without reading it first. Showing them lets your users see the work, including the loops the engine caught.
Without streaming
Without stream, you get one JSON object when the turn ends, with the answer, the reasoning, the research, the steps, the guards, the sources, the usage and the final mascot.
/v1/turnsRuns one KOLDOS turn and streams what happens: status with the mascot image, reasoning, research, tool calls, guards, sources and the answer.Request body
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID, for example koldos-1. |
input | string | Yes | The request for this turn. |
conversation_id | string | No | Continue a saved conversation. |
functions | array | No | Functions the turn may use: text, search, vision, deep_research. Each use costs its credits. |
show_thinking | boolean | No | Stream the model's reasoning. On by default. |
stream | boolean | No | Send events while the turn runs. Without it you get one JSON object at the end. |
{
"model": "koldos-1",
"input": "Should sessions live in a cookie or in the database?",
"functions": ["text", "deep_research"],
"stream": true
}{
"id": "turn_example",
"model": "koldos-1",
"status": "done",
"mascot": {
"motion": "celebrate",
"gif": "https://koldos.plodex.xyz/mascot/celebrate.gif",
"gif_small": "https://koldos.plodex.xyz/mascot/celebrate-128.gif"
},
"answer": "...",
"thinking": [{ "depth": "normal", "text": "..." }],
"research": [{ "id": "r1", "question": "...", "thinking": "...", "findings": ["..."], "sources": 3 }],
"steps": [{ "tool": "read_file", "ok": true, "ms": 12 }],
"guards": [],
"sources": [{ "title": "...", "url": "https://...", "used": true }],
"usage": { "generated": 212, "credits": 8 }
}