Skip to main content
Koru
Get started
API reference sections

HTTP API reference

Koru API

The Koru API gateway is the single public API for Koru's apps and your own tools. Store and AI operations keep their own wire formats behind one authenticated gateway, which runs on your device with Koru and listens on the loopback interface only.

This reference is generated from the gateway's OpenAPI contract. Streams (server-sent events and the sync WebSocket) have their own reference, from the AsyncAPI contract.

211 operations on 171 paths · 614 schemas · OpenAPI 3.1.0

Endpoints by section

Base URL

The contract's server is http://127.0.0.1, described as loopback only. It does not fix a port: use the one your running Koru gateway listens on. The examples on these pages write it as $PORT.

A running gateway serves this contract at GET /v1/openapi.json, the streaming contract at GET /v1/asyncapi.json, and its own offline pages at /docs and /docs/asyncapi.

http://127.0.0.1 loopback only

Authentication

Requests carry a bearer token in the Authorization header: Authorization: Bearer <token>. Each operation lists the scopes its token must hold. A missing or unrecognised token answers 401; a token without the operation's scope answers 403.

One operation takes a different token, runBearer:

A run's endpoint token, issued once per attempt by POST /v1/artifacts/authorities and rotated by POST /v1/artifacts/authorities/{run}/generation.

These need no token: GET /v1/openapi.json, GET /docs, GET /docs/asyncapi, GET /v1/asyncapi.json.

Scopes and how many operations require each
ScopeOperations
ai.chat37
ai.manage_providers8
ai.read_usage3
artifacts.read8
artifacts.write11
destroy_workspaces9
edit_documents26
manage_workspaces21
migrate_workspaces2
read_documents30
runs.read5
runs.write14
sessions.attachments.write4
sessions.control13
sessions.metadata.read2
sessions.output.read3
sessions.terminate1
settings.read1
settings.write1
store.read_documents1
workspace.destroy2
workspace.migrate2

Errors

A failed request answers with a JSON body. Store operations use Failure, AI operations use AiFailure. Branch on code, a stable machine-readable token; message is untranslated developer text for logs, not for people.

Session conventions

The terminal session operations declare more about themselves than the others: whether they need the session's controller lease, whether they need an idempotency key, whether they are safe to retry after an unknown outcome, and which stable error code maps to which HTTP status. Each session operation lists these under "Behavior".

Terminal sessions

Streams

Chat turns and retries, Ollama model pulls, run history, schedule lists, the event journal and terminal session output stream as server-sent events, and /v1/sync is a WebSocket. The streaming reference documents the four channels in the AsyncAPI contract: chat turns, Ollama model pulls, session output and sync.

Streaming API reference (AsyncAPI) The streams of the Koru API gateway on your device: server-sent events for chats, model pulls and sessions, and the Loro sync WebSocket, from its AsyncAPI contract.

Every request and response type links to its own schema page, for example GatewayStatus.

Generated from contract version 1. Last updated .

Privacy choices

Choose which optional tools Koru may use on this site. Your choice is saved in a cookie in this browser for 12 months. Privacy policy

Privacy choices

Keep you signed in, protect forms and remember your language and this choice.

Always on

PostHog and Google Analytics 4 measure page views and actions such as downloads, using cookies or local storage.

PostHog records how pages are used, with form inputs masked and private pages excluded. Needs Analytics.

Ahrefs Web Analytics measures visits and where they come from, and Google Ads measures whether our ads led to a visit or download.