Skip to main content
Threads are the durable conversation context behind multi-turn agent runs. Each thread is scoped to a single computer and stores the full message history so the AI can build on what it has already done. Pass a thread’s ID into Create chat completion to continue a session.
Threads are created implicitly. Every call to POST /v1/chat/completions with a computer_id either continues an existing thread (when thread_id is passed) or creates a new one and returns its ID. Use these endpoints to list, inspect, rename, archive, or delete threads - you rarely need to create them by hand.

Endpoints

Base URL: https://www.orgo.ai Auth: Authorization: Bearer sk_live_... on every request.

List threads

Returns every thread the authenticated user owns for the given computer, including full message history.

Query parameters

string
required
UUID of the computer (the id field from Create computer). Threads are scoped per-computer; to list across computers, call this endpoint once per computer.

Response

array
Array of thread objects, most recent first.

Example


Create thread

Creates an empty thread bound to a computer. Only needed when you want a thread ID before making the first completion - otherwise, omit this call and let POST /v1/chat/completions create one for you.

Request

string
required
UUID of the computer to attach the thread to.
string
Optional client-side identifier. Echoed back as externalId in the response so clients can reconcile local and remote threads.

Response

Returns 201 Created.
string
The new thread’s UUID. Use this as thread_id in subsequent chat completions.
string
Mirror of localId from the request. Omitted if not supplied.

Example


Get thread

Fetches a single thread with its full message history. 403 if the thread belongs to another user; 404 if it does not exist.

Response

string
Thread UUID.
string
active or archived.
string
Title if set, otherwise omitted.
array
Full message history in chronological order.

Update thread

Updates title, replaces messages, or toggles archive state. Archive takes precedence over other fields when both are present.

Request

string
New human-readable title.
array
Replaces the entire stored message history with this array. Use with care - this is a full overwrite, not an append.
boolean
Set to true to archive. Archived threads are hidden from default list views but remain fetchable by ID.
boolean
Set to true to restore an archived thread.

Response

string
Thread UUID.
string
Updated status (active or archived).
string
Updated title if set.

Example


Delete thread

Permanently deletes the thread and its message history. Prefer PATCH with archive: true if you might need the conversation back.

Response


Generate title

Generates a short (3–6 word) title from the first few messages using Claude Haiku and saves it to the thread. Returns an assistant-ui-compatible text stream rather than JSON.

Request

array
required
The messages to summarize. Only the first three are considered. Each message is { role, content } where content may be a string or an array of { type: "text", text } blocks.

Response

text/plain stream in the assistant-ui format:
The generated title is also persisted to the thread, so a subsequent GET will include it in the title field.

Using threads with completions

Threads compose with chat completions - you almost never manage them directly in production code:

Errors

Error responses are JSON with a single error field: