Skip to main content
The Runner wire API is internal. Applications should normally use the Conductor API.

Base URL

State-changing endpoints that do not return data use 204 No Content. Errors use:

Runner Info

Get Runner Info

Returns the runner identity used by the conductor pool.
hash is SHA256(RUNNER_BASE_URL)[:8]. Session IDs embed this hash so any conductor can route a session back to its owning runner. substrates is the sorted set of worker substrates this runner can launch; defaultSubstrate is the one used when a sandbox-worker profile does not make an explicit choice. Read the list together with substratesKnown: true with an empty list means this runner definitively launches no workers, while an omitted or false value means an older runner did not report the capability.

Runtime Introspection

List Runtimes

Returns the runtime slots served by this runner, including how each slot is wired and its current process-wide session count:
mode is sidecar when the runner is bound to an agent-worker base URL, stub when it uses the in-process adapter, or unknown when the runtime cannot expose its slot configuration. url is the configured sidecar base URL and is empty for stub slots; it may front multiple worker replicas and is not an instance identity. activeSessions counts live sessions resolved to that runtime across all tenants on the runner. Runtimes that cannot provide a cross-tenant session snapshot report 0.

Get Runner Topology

Returns an on-demand snapshot of the runner process, session counts by runtime, and the sidecar instances observed behind each configured runtime slot:
sessionsByRuntime and each slot’s activeSessions are process-wide counts across tenants. Slot states are stub, live, cold, degraded, or unreachable: cold means a configured slot has no recent successful observation, while unreachable means its latest probe or transport attempt failed without a recent success. The runner observes instance IDs passively from run responses and probes a quiet sidecar endpoint’s /health endpoint on demand for process stats. An observedInstances list is therefore a lower bound on replicas behind the configured endpoint, not an exact fleet count; load-balancer connection pinning can leave running replicas unseen. Unprobed instance stats are null. When multiple runtime slots share one endpoint, as in a MODE=all poly sidecar, those slots report the same observed instances and health state and the endpoint is probed only once. Do not sum observedInstances across such slots: that would count the same worker processes multiple times.

Profiles

List Profiles

Create Profile

Conductors call this to seed or broadcast profile definitions.
Response: 204 No Content

Delete Profile


Pools

List Pools

Create Pool

Delete Pool


Sessions

List Sessions

Runner session status is the raw enum from types.SessionStatus: 0=idle, 1=running, 2=errored, 3=shutdown.

Create Session

Response 201 Created:

Get Session

Session Health

When unhealthy, the response is still 200 OK with healthy: false and an error string.

List VFS Leases

Returns the active per-session VirtualFS leases on this runner. The response is always an array; runners without a VFS manager return [].
An empty allowedMounts array means the VirtualFS session is unrestricted.

Get Session VFS Lease

Returns the VirtualFS lease for one session.
Returns 404 with { "error": "no vfs session" } when the session has no active VFS lease.

List Sandbox Worker Leases

Returns the per-session sandbox-worker leases owned by this runner. The conductor-facing alias is GET /api/worker/leases; in conductor mode it fans out across runners and may return partial results if a runner does not answer within the bounded lookup window. Deployments with no worker substrate, and deployments serving only static profiles, return []. Rows are sorted by sessionId on both planes. The broker’s lease map is keyed by session and iterated in map order, so the handler imposes the sort rather than trusting what the runtime returned; paging an unordered set would drop and repeat rows between requests. Tenant scoping. The result is scoped to the tenant on the request context, which the conductor verifies and forwards as X-Tenant-ID for runnerTenantMiddleware to restamp. A request with no tenant on context is the internal/admin fan-out and still sees every lease. GET /api/sessions/{id}/worker scopes the same way and answers 404 for another tenant’s session, matching the 404 a static-profile session already returns so it reveals nothing about whether the id exists. Pagination. The /api/* alias honors ?limit= and ?offset= and sets X-Total-Count to the caller’s full (tenant-scoped) lease count. The /runner/* path is deliberately not paginated: the conductor’s fan-out reads it whole before merging, and a default window there would silently truncate a busy runner and make the merged fleet total wrong.
state is one of starting, running, paused, gone, or unknown, read live from the substrate so it reflects a sandbox stopped or deleted outside Orca. paused is the normal resting state of an idle session and resumes with its conversation intact; gone means the next run launches a replacement worker without it. unknown means the substrate could not be reached, which is not the same as gone. It describes the lease, not worker-process health. A substrate can keep a sandbox available after the worker exits so its diagnostic log can be read.

Get Session Sandbox Worker

Returns one sandbox-worker lease using the same schema. The conductor-facing alias is GET /api/sessions/{sessionId}/worker. A static-profile session, an unknown session, or a sandbox-worker session before its first run returns 404 with { "error": "no sandbox worker" }. An upstream runner failure returns 502.

Delete Session

Shuts down the session and its scoped MCP endpoint.

Hydrate Session

Recreates a session under a caller-supplied id after a runner restart. The conductor uses this to restore the runner record and, when present, push an opaque sidecar state bundle back into the runtime.
stateB64 is optional and carries the exported state bundle as base64. The endpoint is idempotent: if the session already exists on that runner, the hydrate request is a no-op. Response: 204 No Content Returns 400 when the request body fails to decode or stateB64 is not valid base64. Returns 404 when profileName does not match a profile known to this runner, or when sessionId is already in use by a session that belongs to a different tenant.

Export Session State

Exports the sidecar’s opaque state bundle for the session. The response body is the raw bundle, with the envelope carried in headers: Returns 404 when the session is unknown or the sidecar has no exportable state. Export failures such as sidecar 5xx responses, transport errors, or bundles over the runner size cap return 500 so clients do not mistake them for a missing bundle.

Run Execution

Execute Run

The conductor calls this action endpoint on the runner that owns the session. The response is an NDJSON stream of run events.
Response: application/x-ndjson
Event types are progress, session_init, assistant, tool_call, tool_result, usage, result, and error.

Toolkit

List Global Toolkit

Returns every platform tool registered in the runner process.

List Session Toolkit

Returns the profile-scoped toolkit for one session. Unknown sessions return 404.

Invoke Session Tool

Executes a tool through the session-scoped registry. Out-of-scope tools return 403 even if the runner hosts that tool globally.
Response 200 OK:
Tool-level failures also return 200 OK with result.ok: false; non-200 responses are wire-level errors such as bad JSON, missing session, or an out-of-scope tool.

Sandbox Worker Callback API

Profiles with workerMode: "sandbox" use an outbound-only worker. Every request below requires Authorization: Bearer <ORCA_WORKER_TOKEN>. The runner verifies that the token’s tenant and session claims match the requested session. Missing, invalid, expired, or session-mismatched tokens return 401. The JSON error keeps the invalid or missing worker token prefix and identifies whether the request had no token, the service has no usable key, the token expired or is malformed, its session does not match, or the signer and verifier disagree. Unknown sessions return 404, and runners without the dynamic-worker runtime surface return 503. An event upload over 256 MiB returns 413; one that exceeds 4 hours returns 408. Either condition ends the event stream with an error so the run fails instead of appearing to finish with truncated output. State uploads use the runner’s existing state-bundle size cap and return 413 when exceeded.
ORCA_WORKER_TOKEN and the orca_worker_token query parameter embedded in a sandbox worker’s session MCP URL are bearer credentials. Do not write them to logs, traces, or error messages. The worker token has a 24-hour lifetime; the MCP query token is minted per run and normally lasts 2 hours when the run has no deadline. A run deadline replaces that default with the remaining time plus 5 minutes of grace, subject to a 5-minute floor and the runner’s 24-hour signing ceiling.

Sandbox Event Invalidation (Internal)

The conductor uses this runner-internal route after decoding a provider event. It accepts { "provider": "daytona", "sandboxId": "..." }, marks matching worker-lease status caches stale, and returns { "invalidated": 1 }. A zero count is normal when this runner does not own the provider-scoped sandbox ID. Keep this route on the trusted runner network; unlike the public provider ingress, it accepts an already-decoded event.

Session MCP Endpoint

The runner exposes a streamable-HTTP MCP server per session. Sidecars use the URL advertised in the run envelope, and external MCP clients can connect directly when they can reach the runner. Sandbox-worker sessions require their session-scoped worker token; static-sidecar sessions retain the existing unauthenticated runner-network behavior. When an MCP base URL is configured for a sandbox session, the runner refuses to dispatch the run if its signing key is unavailable, token minting fails, or the minter returns an empty token. The run error names the signing configuration or mint failure instead of advertising a bare capability URL that would fail later with 401.
The MCP surface maps to the same session-scoped toolkit as /toolkit/specs and /toolkit/invoke.

Health & Metrics

Health Check

Returns text/plain ok.

Prometheus Metrics

Returns Prometheus text format metrics from the runner process.