Skip to content

REST API ​

The ORC HTTP API: base URL, auth, the OpenAPI spec, the TypeScript SDK and the route groups.

Base URL ​

ItemValue
Base URLhttp://127.0.0.1:7700 (api.host / api.port, or ORC_API_HOST / ORC_API_PORT)
Route prefix/api
OpenAPI 3.1 specGET /openapi.json
Swagger UIGET /docs
Health (no auth)GET /api/health
MCP endpoint/mcp (see MCP)

Errors return { "error": "<message>", "code": "<CODE>" } with a matching status, for example VALIDATION_ERROR (400).

Auth ​

When api.secret (or ORC_API_SECRET) is set, every /api/* route, /openapi.json and /docs require one of:

CredentialHow
API secretAuthorization: Bearer <secret>
Access tokenAuthorization: Bearer <token> from POST /api/auth/token
Browser sessionCookie set by POST /api/auth/session (web dashboard)

With no secret, the API is open. ORC logs a security warning when it binds a non-loopback host without a secret.

Create an access token:

bash
curl -s -X POST http://127.0.0.1:7700/api/auth/token \
  -H "Content-Type: application/json" \
  -d '{"secret":"'"$ORC_API_SECRET"'","expires_at":1767225600}'

expires_at is Unix seconds; it defaults to api.session_days from now and is capped at 365 days.

Unauthenticated exceptions: GET /api/health, the sign-in routes, POST /webhooks/{token} (signed deliveries), and signed short-lived capability URLs (skill downloads, scratchpad content, session uploads).

Usage ​

Desktop preview ​

The desktop panel uses authenticated /api/desktop-preview/* routes: GET session?session_id=… resolves a trusted session; GET file?session_id=…&target=… reads bounded workspace text/images; PUT file saves text using {session_id,target,content,original} and returns 409 if disk content changed. Paths are constrained to that session's working folder and execution host.

POST clients registers {client_id,session_id,agent_access,browser_ready} and returns a private lease. Renewal, GET clients/{id}/requests, POST clients/{id}/close and POST requests/{id}/ack require X-Preview-Lease as well as normal API auth. GET clients?session_id=… lists targets (agent_access, browser_ready) without exposing leases. POST requests queues {session_id,client_id?,kind:"url"|"file",target}; POST browser queues {session_id,client_id?,command,tab_id?} only for an opted-in target with an open browser page (browser_ready), otherwise it returns 409. GET requests/{id} reports queued, opened, completed, failed or expired. POST requests/{id}/cancel fails a still-queued request so it never runs late; the MCP server calls it when a browser action is still queued after its 10-second wait. Queued work expires; it is not persisted across daemon restarts.

Browser files stay inside the session workspace: POST artifact?session_id=…&name=… saves a browser download (octet-stream body), POST recording?session_id=… saves a WebM recording, and GET upload?session_id=…&target=… returns a workspace file as base64 for a browser upload. Artifact and recording bodies are capped at 16 MB. See MCP preview tools for browser commands and permission behavior.

GET /api/sessions/live/{id}/cache returns numeric prompt-cache evidence recorded by the agent: latest (including optional recorded time and a conservative may_be_cold_after hint, context_tokens as the agent counts its context, and context_window when the transcript records the model's window, as Codex does) and totals. Claude, Codex and Pi are read from the stored native transcript; OpenCode is read from its own session database on the execution host. Missing or unsupported evidence is null. No prompt text, credentials or transcript paths are returned. The route uses normal API authentication and the session's stored execution host; clients cannot supply a file path. The SDK exposes orc.sessions.cacheUsage(id).

GET /api/sessions/live/{id}/analytics returns the same analytics as the chat route for the chat that owns this native session. It resolves the chat by the session's source link, then by its native session id, and answers 404 when no chat owns the session. The SDK exposes orc.sessions.analytics(id).

GET /api/usage/report returns request-level usage for the selected period: totals, per-agent and per-model distributions, UTC day or hour buckets, and coverage for sessions that are not indexed yet or come from agents without request-level usage. Query parameters are days (1, 7, 30 default, 90, or 0 for all time), granularity (day default or hour), and optional agent and model filters. Pass model=__unknown__ to select requests without a model. Each aggregate includes input, output, cache-read, cache-write, reasoning and unsplit (other) tokens plus request, session and estimated-request counts. Request and estimate counts are sums over represented requests, so a daily rollup counts every request it stands for. Raw requests are kept for 95 days; older usage is rolled up per session, UTC day and model, so days=0 still returns complete totals and distributions without per-request rows. The route returns Cache-Control: no-store and uses normal API authentication. The SDK exposes orc.usage.report({ days: "30" }).

GET /api/usage/history?days=30 remains available for clients that need imported session lifetime totals grouped by agent and UTC session start date. days accepts 7, 30 (default), 90, or 0. These are session cohorts, not tokens consumed during the period.

GET /api/usage/quotas returns local Codex, Claude and Alibaba Cloud quota windows with percentage used, reset timestamps, availability and check time. Alibaba Cloud appears when the Bailian CLI (bl) is installed. Requests share a 60-second cache. None of these routes returns credentials. See Usage in Settings for indexing, estimate and coverage limits. The SDK exposes orc.usage.history("30"), orc.usage.report({ days: "30" }) and orc.usage.quotas().

Pagination ​

GET /api/projects, GET /api/jobs and GET /api/skills take limit and offset and return next_offset; follow it until it is null. Projects and jobs default to 50 per page (max 100); skills default to 30 (max 500).

Examples ​

bash
H="Authorization: Bearer $ORC_API_SECRET"

curl -s -H "$H" http://127.0.0.1:7700/api/projects/by-name/my-app
curl -s -H "$H" "http://127.0.0.1:7700/api/tasks?status=doing&limit=20"
curl -s -H "$H" -X POST "http://127.0.0.1:7700/api/jobs/<job-id>/trigger?sync=true"
curl -s -H "$H" -H "Content-Type: application/json" -X POST http://127.0.0.1:7700/api/kb/search \
  -d '{"query":"rollback procedure"}'

TypeScript SDK ​

@orc/sdk (packages/sdk) wraps the API. It reads ORC_API_BASE (or the configured host and port) and api.secret unless you pass them.

ts
import { createOrcClient } from "@orc/sdk";

const orc = createOrcClient({ baseUrl: "http://127.0.0.1:7700", secret: process.env.ORC_API_SECRET });
const { data, error } = await orc.tasks.list({ status: "doing" });
OptionPurpose
baseUrlAPI origin, without /api
secretBearer secret or access token
project_idActive project for knowledge scope
actor{ name, session_id } attribution for knowledge reads and writes
sourceCall source for knowledge edit rights (api by default)

Every method returns { data, error }; error is { error, code } and never throws. Types generated from the OpenAPI spec live in packages/sdk/src/openapi.gen.ts (regenerate with bun run generate in packages/sdk).

Route groups ​

All paths below are under /api unless shown otherwise. GET /openapi.json lists every route with its schema.

Projects, tasks, flows and goals ​

MethodPathPurpose
GET POST/projectsList (status, tag, limit, offset) / create
GET PATCH DELETE/projects/{id}Read / update / delete
GET/projects/by-name/{name}Look up by name (case-insensitive)
GET/projects/{id}/summaryTask, memory and job counts
GET POST/projects/{id}/commentsProject comments
GET/workspacesPrepared workspaces (project_id, path)
GET POST/tasksList (project_id, status, tag, limit) / create
POST/tasks/batchCreate tasks with dependency links atomically
GET PATCH DELETE/tasks/{id}Read / update / delete
GET POST/tasks/{id}/commentsTask comments
GET POST/tasks/{id}/linksTask links, both directions
DELETE/tasks/{id}/links/{linkId}Remove a link
GET POST/flowsList / create flow graphs
GET/flows/{name}Read a flow
POST/flows/validateValidate without saving
GET POST/tasks/{id}/flowGet a task's run / attach a flow
POST/tasks/{id}/flow/resumeResolve a human node
POST/tasks/{id}/flow/haltStop a running flow
GET POST/goalsList goals / start a goal (worker + external check loop)
GET/goals/{id}Live goal status and check history
POST/goals/{id}/stopStop a goal's flow
GET/tasks/{id}/goalThe goal attached to a task, or null
GET/tagsUnique tags across resources
GET/searchSearch all projects and resources

Projects accept an optional workspace object with setup_script, dev_script, setup_timeout_secs, port_base, port_count and env. env is the same { name, value, secret } array as job environments: secret values are encrypted at rest, read back as value: null, and retained when that saved null placeholder is sent again. Omitting workspace on update preserves it; sending one without a stored secret's value returns 400. An invalid or missing stored value falls back to defaults: no scripts, a 900-second setup timeout, ten ports starting from 3100, and no variables.

GET /workspaces returns workspace records with setup_status, setup_output, the allocated port_base/port_count block, preview_url and the owning project. Filter by project_id, or pass path for exactly one folder; a folder inside a managed worktree returns that worktree's record. Records exist only for projects with a setup script, a dev script or a custom port range. Setup runs once per managed worktree; a project's main checkout gets a port block but no setup.

Memory ​

MethodPathPurpose
GET POST/memoriesList (project_id, q, sort, limit) / create
GET PATCH DELETE/memories/{name}Read / update / delete
GET/memories/{name}/historyChange history
POST/memories/{name}/revertRevert a change
GET/memory-limitsSize limits
GET/memory-transfer/sourcesNative memory folders
POST/memory-transfer/import, /memory-transfer/export (+ /preview)Import / export native memory files

Knowledge bases ​

MethodPathPurpose
GET POST/kb/basesList / create knowledge bases
GET PATCH DELETE/kb/bases/{id}Read / update / delete
GET POST/kb/bases/{id}/documentsList / create Markdown documents
POST/kb/bases/{id}/uploadUpload a file
GET PATCH DELETE/kb/documents/{id}Read / update / delete a document
POST/kb/documents/{id}/editPartial edit against expected_revision
GET/kb/documents/{id}/revisionsRevision history
POST/kb/searchSearch (exact, full-text, vector, fused)
POST/kb/evidenceBudgeted evidence pack with citations
GET/kb/citations/{handle}Resolve kb:<doc>@<rev>#<n>
GET POST/kb/bases/{id}/commentsComments
GET PUT DELETE/kb/bases/{id}/digestDigest agent; POST .../digest/run starts one
GET POST/kb/bases/{id}/sourcesSynced local folders
GET PATCH/kb/settingsParser and embedding settings
GET/kb/statusCounts, jobs, embeddings, parsers

Skills, agents and packages ​

MethodPathPurpose
GET POST/skillsList (q, project_id, source, limit, offset, include_hidden) / create
GET DELETE/skills/{name}Read / delete
PUT/skills/{name}/instructionsAudited instruction edit
PUT/skills/{name}/fileEdit or add a supporting file
GET/skills/{name}/historyInstruction history; POST .../revert reverts
GET PUT/skills/{name}/projectsProject assignments
POST/skills/{name}/downloadMint a ten-minute signed file download
POST/skills/discover, /skills/importDiscover / import GitHub skills
POST/skills/{name}/syncSync an imported skill
GET/skills/local-agentsSkills in local agent folders; POST .../import copies them in
POST/skills/export (+ /preview)Export as native skill folders
GET PUT/skills/settings/visibilityDiscovery visibility
GET POST/agentsList / create agent profiles
GET PUT DELETE/agents/{id}Read / update / delete
GET POST/agent-packagesList / import packages
GET PUT DELETE/agent-packages/{name}Read / update / delete
POST/agent-packages/{name}/exportExport a package

Jobs, webhooks and channels ​

MethodPathPurpose
GET POST/jobsList (enabled, project_id, limit, offset) / create
GET PATCH DELETE/jobs/{id}Read / update / delete
POST/jobs/{id}/triggerRun now; ?sync=true waits and returns output
GET/jobs/{id}/runsRun history
GET/jobs/{id}/runs/{runId}/logsRun logs
GET/jobs/{id}/runs/{runId}/sessionResolve this run's native conversation; returns { session_id } for the session viewer, or null if unavailable
GET POST/webhooksList / create webhooks
PATCH DELETE/webhooks/{id}Update / delete
POST/webhooks/{token} (no /api)Receive a signed delivery
GET/channels, /channels/providersChannels and providers
POST/channels/{id}/route-testPreview the first matching inbound rule, without invoking an agent
POST/channels/messagesSend a message to a fixed destination; * (any chat) destinations only carry replies and refuse API sends
GET PUT/channels/notification-policyRead/save global forwarding opt-in and ORC link origin
POST/channels/notification-previewTest draft type/category/severity/outcome/project filters without sending
GET/channels/notification-deliveriesRecent delivery status and safe errors; limit 1–100

Jobs accept optional settings and environment in create/update requests. settings is replaced as a whole when supplied: host is an SSH alias, null pins the local host, and omission follows the selected execution host; timezone is an IANA timezone for cron. shell is { executable, args }, with the script appended as the final argument. workspace is { mode: "directory" | "worktree", base_ref, cleanup_on_success } for agent jobs. Legacy jobs without settings retain their previous shell and directory behavior. inherit_project_directory: false preserves a command job’s host working directory when adding settings to a legacy job; new jobs otherwise inherit their project path. The Jobs response includes working_dir, settings, schedule_timezone and a timezone-aware next_run_at for enabled cron jobs.

environment is an array of { name, value, secret }. Secret values are encrypted at rest and read back as value: null; submitting that saved name with secret: true and value: null retains its value. Omitting the array preserves all entries; supplying an array replaces it, and an empty array clears it. Names are unique (case-insensitive), ORC_ names are reserved, and values are single-line. Exact secret values are redacted from job logs and saved agent summaries. Legacy env_vars inputs remain supported as nonsecret values; reads expose them through environment. Do not supply both forms in one write. An agent action is { type: "agent", prompt } plus the agent spec shared with channel rules: agent, optional model, profile (an agent profile used as the persona) and options (the validated launch options for that agent), and permissions: ask (default), read_only, accept_edits or auto. Jobs run unattended, so tool requests the level does not cover are denied. Launch options that approve more than permissions allows are rejected. Jobs saved with the older backend and auto_approve fields read back in this shape.

Job runs expose session_id for the audit record and native_session_id for the provider identity. The run-session resolver checks run ownership and discovers only that native conversation on its recorded execution host. It does not switch the global execution host. Existing authentication protects both endpoints.

GET /chat/models returns each model's id and label, plus description and efforts (supported effort values) when the agent reports them. It also accepts optional host and cwd for a job destination. Omit host to follow the selected host, use __local__ to pin local, or supply an SSH alias. An existing threadId owns its host/directory and rejects these overrides. GET /chat/commands?agent= returns the agent's own slash commands and skills (Claude, Codex and OpenCode; other agents return none) and GET /chat/files?path= lists one folder under the working directory; both take the same threadId, host and cwd.

Sessions, chat and terminals ​

MethodPathPurpose
GET/sessionsRecorded agent sessions
GET/sessions/{id}Session detail with events
GET/sessions/liveTop-level coding-agent sessions seen by the file watcher; include_hidden=true also returns hidden ones, include_children=true adds the subagent sessions of the listed ones at any depth (Claude Code, Codex, Cursor, OpenCode), each with parent_id set to its parent's id. spawned_from_id is the id of the session that started a top-level session as an independent one (Claude Desktop start_session). model is the model the transcript last reported and permission_mode the latest permission mode (Claude permissionMode, Codex approval_policy/sandbox_policy, OpenCode agent such as build or plan); both are null when unknown. waiting_for says why a session waits for a human (permission, question or dialog) and which tool waits (Claude permissions and questions; Codex request_user_input questions; OpenCode questions, with tool null); background_work is true while a session idles between turns with background work still running (Claude Code background shells); working_children and waiting_children count child sessions and native subagents with a turn in flight or parked on a human question or approval, so a parent whose own turn ended still reads as working while its children work — its status itself stays turn-truth
GET/sessions/live/{id}One discovered session, for the read-only viewer
PATCH/sessions/live/{id}Link a task, rename (display_title) or hide (hidden) a live session
GET/sessions/live/{id}/transcriptPaged transcript
GET/sessions/live/{id}/analyticsAnalytics for the chat that owns this session
GET/sessions/live/{id}/cacheRecorded prompt-cache usage
GET/sessions/live/{id}/subagentsThe subagents a session ran at any depth, in start order, each with tool_call_id: the tool call that started it (null for Cursor, which records none), and parent_id: the subagent that spawned it, or null when the session itself did
GET/sessions/live/{id}/childrenSessions this session started, each with its status and the same working_children / waiting_children / stopping rollup
GET POST/sessions/live/{id}/messagesRead or queue a message for a live session
POST/session-messagesQueue a message from an agent session (X-ORC-Session)
POST/session-messages/{id}/cancelCancel a queued message
POST/session-messages/{id}/moveReorder a queued message
GET/sessions/live/searchSearch sessions
GET/sessions/live/{id}/send-previewWhat a Send to host move would carry, and whether the session is eligible
POST/sessions/live/{id}/send-toMove a session to another ORC installation (destination URL, token, headers and project in the body; credentials are used for the request only). Orchestration failures return the recorded send with status: error
GET/sessions/live/{id}/sendsThe session's send history, newest first
GET/sessions/archiveSearch archived session passages
POST/session-handoffsStart a session handoff
GET POST/chat/threadsChat threads; each carries workingChildren / waitingChildren (child work rollup) and stopping (a Stop was requested and the turn has not ended yet)
GET/chat/threads/{id}/sessionNative session state for a thread: changed, running, workingChildren, waitingChildren, stopping, the settled live status and queued human answers
GET/chat/threads/by-message/{id}Find the thread holding a user message id (send recovery)
POST/chat/threads/{id}/forkFork a chat at an assistant response
GET/chat/threads/{id}/analyticsChat, tool, turn, context and compaction analytics
POST/chat/streamStream a chat turn
GET POST/terminalsList / start terminals
GET PATCH DELETE/terminals/{id}Read / rename / kill
GET/terminals/{id}/git/statusGit status of a terminal or chat-session checkout
GET/git/worktreesCheckouts of a repo
GET/git/branchesLocal, remote and default branches of a repo

Chat streams include turn events with startedAt (Unix milliseconds), followed at completion by finishedAt, durationMs and outcome (completed, stopped, or failed). The same optional turn object is persisted on assistant messages. durationMs prefers the backend's reported duration and otherwise uses server elapsed time. Replay includes the original start; legacy messages may omit turn. Before a tool call, a narration event moves accumulated prose out of the current reply and into its folded activity. Its text preserves that prose for expansion.

Assistant messages record the model that produced the turn when the session has one selected; it is additive, so older transcripts simply omit it. Agents that publish a checklist emit plan events with an id, an optional title and entries (id, status — pending, in_progress, completed or failed — and content). Providers re-send the whole plan, so a repeated identical update changes nothing and an entry keeps one row as its status advances. A provider without a plan signal emits no plan event. Stored activity kinds this build does not know are kept as a providerActivity passthrough instead of being dropped or failing the transcript.

A turn opens with a thread event carrying the conversation metadata and only that turn's user message; the full transcript is read from GET /chat/threads/{id}. GET /chat/threads/{id}/analytics counts messages, turns, tool calls and failures from the stored chat transcript for every coding agent. When the agent's native session records token usage, it adds context growth, cache reuse and compaction markers. Agents without readable usage return context.supported: false with a reason instead of failing the request. POST /chat/stream accepts an optional clientMessageId (UUID) and stores it as the user message id, rejecting a repeat with 409. If a first send's response is lost, poll GET /chat/threads/by-message/{clientMessageId} — 404 until the server stores the message, then the full thread — and attach to /chat/threads/{id}/live instead of sending the message again.

A first send may include workspace with host, cwd, worktree and base. When worktree is true, the server creates an isolated orc/<id> worktree from base (a local or remote-tracking branch already present in the checkout); omitting base uses the checkout's current HEAD.

First sends reserve clientMessageId before agent and workspace preparation. Repeating that ID without a thread returns 409 with code CHAT_MESSAGE_EXISTS, including while preparation is pending. Recover the original thread by message ID; retrying the same queued message does not start another turn. The web client bounds recovery requests and backoff to 15 seconds, or 60 seconds after a server error, header timeout or CHAT_MESSAGE_EXISTS, then pauses the message in its queue.

POST /chat/threads/{id}/fork copies the conversation up to one assistant response into a new thread and returns it. It prefers the agent's native session fork, which keeps the provider's own conversation, when the response is the latest one and the adapter supports it (Claude, Codex, Pi, and ACP agents whose handshake advertises session/fork). A native fork is deferred until the new chat's first message, so no provider process starts for a fork you never use. Otherwise the new chat replays a bounded context (100,000 characters) that includes text, summarized tool calls, results, status entries and attachment names; the opening request is kept when older messages are omitted.

The returned thread records forkedFrom (threadId, messageId, mode — native or context — plus sourceTitle, fallbackReason and partial when relevant), forkPending while a native fork has not started yet, and forkContext (messageCount, truncated, includesActivity) for a context fork. A context fork is rejected with 400 when the source has older native history ORC cannot read, so the copy never silently drops the beginning of a long conversation. Forking is rejected with 409 while the source or another turn is running.

POST /terminals accepts project_id to use that project's workspace environment and ports, and dev: true to run its dev script in a shell terminal. A dev terminal rejects an agent kind or providerId, and fails when the project has no dev script. Terminal responses include project_id, worktree_path, dev and preview_url. For a dev terminal, the first printed http(s) URL becomes preview_url and stays until that terminal exits.

GET /settings returns composer_revision for favorite_models and composer_profiles. A PATCH /settings that saves either must send that revision; a stale one returns 409 so a save from another tab is never overwritten.

POST /terminals accepts model, effort and permissionMode for a new agent terminal and maps them to the CLI's flags (see Terminal workspace). A choice the CLI does not support, or any of them on a shell, dev, setup or resumed terminal, is rejected with 400.

POST /terminals with live_session_id resumes that session's native CLI conversation. Adding fork: true starts a new session from the same history instead: Claude runs --resume <id> --fork-session and Pi runs --fork <id>. The fork is a separate terminal with no live-session link, so the source row, its task link and any resume terminal stay untouched. Backends without a native CLI fork answer 400; fork their conversation in chat instead.

PATCH /sessions/live/{id} takes any of task_id (null unlinks), display_title (a trimmed name of 1–200 characters, or null to fall back to the agent's title) and hidden (true or false). display_title and hidden_at are stored on the session row, so a re-sync that rewrites the agent title or notices new activity keeps both. GET /sessions/live and /sessions/live/search omit hidden rows unless asked with include_hidden=true.

Human requests, rules and scratchpads ​

MethodPathPurpose
GET POST/human-requestsList / create
GET/human-requests/{id}Agent read; marks an answered response seen
GET/human-requests/{id}/viewHuman review without delivery/read side effects
POST/human-requests/{id}/respond, /acknowledge, /cancelAnswer and close
GET/rulesRule history; ?cwd= scopes to current policies covering a directory (hook clients), ?workspace= exact match; history_truncated marks a full 200-row page
GET/rules/catalogRule templates
POST/rules/check, /rules/activate, /rules/revertValidate / activate / revert
GET POST/scratchpadsList / create
GET PATCH DELETE/scratchpads/{id}Read / update / delete

System ​

MethodPathPurpose
GET/healthHealth, version, uptime (no auth)
POST/auth/tokenCreate an access token
GET POST DELETE/auth/sessionWeb UI sign-in
GET PATCH/settingsWorkspace preferences
GET PATCH/settings/mcpMCP defaults and prompts
GET/backendsAgent backends and whether each can run
GET/eventsResource-change event stream
GET PUT/sshSSH execution host
GET/system/aboutServer version, platform, runtime, data folder, start time
POST/system/restartRestart ORC
POST/mcp/toolRun any MCP tool: { "name", "args" }
GET/auditCentral lifecycle and knowledge audit log
GET POST/integrations/connectionsspec-cli connections

/events sends ready, then change events with { "resources": [...] }. sessions means a session's listed fields changed (status, title, model, project and so on); session-activity means only its last activity or token counts moved. When the server knows which sessions changed, the event lists them in sessions (gateway, native and chat thread ids): session-activity with ids means their transcripts moved, and usage with ids means their usage was indexed. desktop-preview means a preview request is waiting for a desktop.

Notifications and audit ​

All paths below use the /api prefix and the normal API authentication.

MethodPathPurpose
GET/notificationsCurrent history, has_more and the unread count for the same scope; optional project_id (or unassigned) scopes both
PATCH/notifications/{id}Shared {read?: boolean, dismissed?: boolean}
POST/notifications/readMark current notifications read; optional project_id (or unassigned) scopes it

Listing accepts limit (1–100, default50), offset (default0) and unread=true|false (defaultfalse). Each notification includes a generic type, source_id, title, body, level (needs-you or done), nullable project_id, internal path, requires_action, and millisecond timestamps created_at, expires_at, read_at, dismissed_at (the last two nullable). Expiry and dismissal do not mutate the source request. SDK methods are client.notifications.list, .update and .markAllRead.

GET /audit accepts entity_type (notification, human_request, job_run, task, settings, job, rule, terminal, auth, memory, skill, kb), session_id, since (Unix seconds), limit (1–100, default50), and project_id or scope=global|all. scope=all includes project and global entries. snapshot=preview substitutes a bounded marker for snapshots larger than4096 bytes; default full preserves the original snapshot. The Audit UI uses previews and displays the latest100 matching events. Audit timestamps use Unix seconds. Both notification and audit reads enforce their configured retention periods; see Notifications.

Agent capabilities and steering ​

GET /backends includes a versioned capabilities object for each integration. GET /chat/capabilities?agent=<id>&threadId=<optional-thread-uuid> returns { backend, capabilities } without starting a provider. Capability flags describe resume, model selection, image input, tool output, approvals, questions, live permissions, native interruption, steering, MCP, fork and rollback. subagents is true for agents whose chats stream a live subagent tree (Claude, Codex, OpenCode) and absent for the rest. approvalFeedback is true when a denial can carry a reason to the agent (Claude, Codex, direct ACP agents such as OpenCode). source is adapter, negotiated or unknown; unsupported and unknown operations are false. Chat SSE emits capabilities events and persists negotiated values with the thread.

POST /chat/runs/{id}/permission answers a pending permission_request with { "requestId": "...", "decision": "approved" | "session" | "denied", "feedback"?: "..." }. session also answers the same request automatically for the rest of the conversation. A request with allowSession: false (the agent asked not to remember it, an ACP agent offered no allow_always, or an ORC rule requires a human answer) rejects session with 400 and is never answered automatically. feedback (up to 4000 characters) is the reason sent with a denial; sending it with another decision returns 400. A request that is no longer pending returns 409.

POST /chat/runs/{id}/answer answers a pending question_request with { "requestId": "...", "answers": { "<question id>": ["..."] } } and returns { ok: true, message }, where message is the user message recorded in the conversation: one readable line per question, secret answers shown as (hidden) and a sole dismissal as (dismissed) (a dismissal reads even for a secret question, since it is the user's own action; alongside real values the dismissal sentinel is dropped). Recording means accepted for delivery: an inbox-backed question resolves on the inbox write, and a later native delivery failure surfaces in the inbox. A request that is no longer pending returns 409; missing or empty answers return 400.

POST /chat/runs/{id}/cancel stops the running turn and returns { ok: true }; a run that already finished returns 409. On interrupt-capable backends (Pi, Codex, OpenCode/direct ACP) it sends the native interrupt and keeps the session resumable, so the next send continues the same conversation; on Claude and ACPX it closes the agent process. Pending approvals and questions are cancelled either way.

POST /chat/runs/{id}/steer takes { "requestId": "<uuid>", "input": "Focus on the failing test" } and returns the updated conversation once the message is dispatched into the active native turn. The web chat calls it by default when a steering-capable backend is responding; the conversation's config.sendWhileRunning ("steer" by default or "queue") decides what Enter/Send does. PATCH /chat/threads/{id}/config takes at least one of agentOptions or sendWhileRunning; sendWhileRunning applies while a turn is running, while agentOptions waits for it to finish. Codex, Claude and Pi confirm native acceptance before returning; OpenCode over direct ACP has no steer acknowledgment, so a later refusal is reported as a status message and steering is turned off for that turn. It requires a live steering-capable session (Codex, Claude, Pi and OpenCode over direct ACP); stale and unsupported runs return 409, and so does a run with an unanswered approval or question, so a new message never reaches the agent in place of the answer. The web chat queues it until the turn ends. A 409 with the code STEER_UNCONFIRMED means the text may already be in the conversation, so the client must not send it again as a new turn; a plain CONFLICT means nothing was delivered and the message can be queued instead. It keeps the original native thread and turn. Empty input is invalid. These routes use the same authentication as the rest of the API. The SDK exposes client.chat.capabilities(agent, threadId?) and client.chat.steer(runId, input, requestId?). Reuse the same request ID and input when retrying. A duplicate ID with different content returns 409; a live run accepts at most 32 distinct steering requests. The message is recorded at dispatch — the moment it was sent is its place in the transcript, independent of when the agent acknowledges delivery. An initial save failure sends nothing. Unconfirmed delivery is retained in history and cannot be resent with the same ID; a delivery-status save failure reports a warning while keeping the saved intent. An agent that explicitly refuses the text rolls the record back (a plain CONFLICT); clients reconcile the transcript at turn end.

A steer or an answer joins the running turn without ending it, and the transcript keeps chronological order: the assistant prose streamed before the human message is sealed as its own assistant message above it, and the rest of the turn follows below. Chat SSE emits an interjection event carrying the recorded user message at that point, then a slim thread event naming the run and a turn event with the turn's start time; a reattach replays only the events after the interjection, because the sealed prose is already stored, and re-emits any approval or question still pending so a replay cutoff never hides a prompt the turn waits on. A tool call (including same-id updates), plan or subagent that spans the split keeps its entry in the segment that started it; its result updates that segment rather than starting a nameless copy below. Once the agent's event stream ends the turn is closed to interjections: a new steer is refused (queue it instead), and a late answer confirmation appends below the completed reply instead of sealing a copy of it.

Released under the MIT License.