Skip to content
Documentation menu

Getting startedDraft

Live stream

What the model is doing, its reasoning, research and tool calls, as server-sent events.

Draft

The KOLDOS API is in development and this specification is a draft. Field names and endpoints can still change before launch.

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.

mascot.gif · sleep.gif
text/event-stream · 0/20

    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.

    A status event
    {
      "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"
      }
    }
    • Queuedqueued

      Waiting for a free slot. Higher plans have higher queue priority.

      /mascot/listen.gif
    • Waking upwaking

      The GPU was off to save cost and is loading the model.

      /mascot/on.gif
    • Decidingdeciding

      The Decision Engine picks the route, the tools and the budget.

      /mascot/converge.gif
    • Planningplanning

      The planner breaks a multi-step goal into steps.

      /mascot/assemble.gif
    • Thinkingthinking

      The model reasons before it answers. The reasoning is streamed.

      /mascot/think.gif
    • Searching the websearching

      Web search is running and pages are being read.

      /mascot/scan.gif
    • Researchingresearching

      Deep research runs several investigations, each with its own reasoning.

      /mascot/research.gif
    • Reading an imagereading-image

      Vision is reading an attached image.

      /mascot/vision.gif
    • Using toolsexecuting

      The executor calls tools in a bounded loop and reads each result.

      /mascot/code.gif
    • Verifyingverifying

      Deterministic checks run on the result before it is returned.

      /mascot/build.gif
    • Writing the answerwriting

      The final answer is being streamed.

      /mascot/wave.gif
    • Donedone

      The turn finished and the credits were charged.

      /mascot/celebrate.gif
    • Errorerror

      The turn stopped. The error event says why.

      /mascot/heartbeat.gif
    • Asleepasleep

      No requests for a while, so the GPU is off. The next request wakes it.

      /mascot/sleep.gif

    Event kinds

    EventWhat it saysFieldsOrigin
    statusWhat the turn is doing right now, with the mascot image for that activity.activity, label, mascot.motion, mascot.gif, mascot.gif_smallNew for the API
    policyThe route the Decision Engine chose and the context it assembled.route, intent, context_tokens, context_budgetEmitted by the engine today
    planThe steps of a multi-step goal, before any of them runs.goal, steps[].id, steps[].goal, steps[].toolsEmitted by the engine today
    thinkingThe model's reasoning, streamed in pieces. Deep reasoning is marked.depth, textNew for the API
    researchOne investigation of a deep research turn: its question, its reasoning and what it found.id, question, state, thinking, findings[], sourcesNew for the API
    stepOne executor tool call and whether it worked.tool, ok, ms, args, pathEmitted by the engine today
    guardA guard stopped something: a repeated call, a blind overwrite, a claim without looking.guard, hintEmitted by the engine today
    contentThe answer text.textEmitted by the engine today
    sourcesThe web sources actually read, including the ones discarded.items[].title, items[].url, items[].usedEmitted by the engine today
    usageTokens generated and credits charged for the turn.generated, creditsEmitted by the engine today
    errorWhy the turn stopped early. The answer is incomplete.errorEmitted by the engine today

    Reasoning and research

    • thinking events carry the model's reasoning in pieces. depth is deep for the longer reasoning before a hard answer. Turn it off with show_thinking: false.
    • A deep research turn sends one research event when each investigation starts and another when it finishes, with its question, its reasoning, its findings and how many sources it read.
    • sources lists 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.

    POST/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

    FieldTypeRequiredDescription
    modelstringYesModel ID, for example koldos-1.
    inputstringYesThe request for this turn.
    conversation_idstringNoContinue a saved conversation.
    functionsarrayNoFunctions the turn may use: text, search, vision, deep_research. Each use costs its credits.
    show_thinkingbooleanNoStream the model's reasoning. On by default.
    streambooleanNoSend events while the turn runs. Without it you get one JSON object at the end.
    Example request body
    {
      "model": "koldos-1",
      "input": "Should sessions live in a cookie or in the database?",
      "functions": ["text", "deep_research"],
      "stream": true
    }
    Response shape
    {
      "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 }
    }