Sandbox runtime
Called by the runtime inside a task's sandbox with its run token, which only the gateway issues: the runtime link, model and decision-engine relays, connectors, channels and agent teams seen from a run. Scripts and other systems do not call these; they are listed so the reference is complete.
Forward an authenticated model request
POST /relay/r/{route}/chat/completions
The relay pins the route model, applies route extensions and reasoning policy, and forces streamed usage when configured. Unknown request fields pass through. One usage row is recorded for each forwarded completion, including errors and disconnects.
Sign-in: The run token of a task's sandbox (the runtime only).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
route | path | yes | string | |
X-TQA-Run-ID | header | string |
Request body
application/json: object
Responses
| Status | Meaning | Body |
|---|---|---|
| 401 | Invalid, expired, revoked or wrong-address runtime token | |
| 403 | Route does not belong to the authenticated conversation | |
| 404 | Unsupported route or operation | |
| 409 | team_budget_helpers: the task helps in an agent team past its helpers' share of the budget (GW-I-304); its lead goes on. team_budget: the task leads or helps in an agent team whose token budget or deadline is spent (or that stops for either); team_stopped: the task helps in an agent team that is stopping for another reason (its lead's own calls pass, to finish its answer). Nothing was sent; final, never retried (ADR-0034 point 8). | Error |
| 413 | Request exceeds the configured 16 MiB maximum | |
| 429 | The caller's per-user request bucket is exhausted, or the model route's limiter could not admit the request within relay.queue_wait or relay.queue_max (LLM-U-012). The model is not contacted. | |
| 502 | Upstream transport unavailable | |
| 503 | Credential or database unavailable | |
| 504 | Request header deadline exceeded | |
| default | Upstream status, content type and body bytes are preserved, including error responses and incomplete streams. |
Forward an authenticated model request
POST /relay/r/{route}/responses
The Responses-protocol path of a Responses route; a route of another protocol has no such path (404). The relay pins the route model, forces streaming and store: false, applies route extensions and the reasoning effort policy, and reports usage from the terminal event. Unknown request fields pass through. One usage row is recorded for each forwarded completion, including errors and disconnects.
Sign-in: The run token of a task's sandbox (the runtime only).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
route | path | yes | string | |
X-TQA-Run-ID | header | string |
Request body
application/json: object
Responses
| Status | Meaning | Body |
|---|---|---|
| 401 | Invalid, expired, revoked or wrong-address runtime token | |
| 403 | Route does not belong to the authenticated conversation | |
| 404 | Unsupported route or operation | |
| 409 | team_budget_helpers: the task helps in an agent team past its helpers' share of the budget (GW-I-304); its lead goes on. team_budget: the task leads or helps in an agent team whose token budget or deadline is spent (or that stops for either); team_stopped: the task helps in an agent team that is stopping for another reason (its lead's own calls pass, to finish its answer). Nothing was sent; final, never retried (ADR-0034 point 8). | Error |
| 413 | Request exceeds the configured 16 MiB maximum | |
| 429 | The caller's per-user request bucket is exhausted, or the model route's limiter could not admit the request within relay.queue_wait or relay.queue_max (LLM-U-012). The model is not contacted. | |
| 502 | Upstream transport unavailable | |
| 503 | Credential or database unavailable | |
| 504 | Request header deadline exceeded | |
| default | Upstream status, content type and body bytes are preserved, including error responses and incomplete streams. |
Forward an authenticated model request
POST /relay/r/{route}/messages
The Messages-protocol path of a Messages route; a route of another protocol has no such path (404). The relay pins the route model, forces streaming, applies route extensions, accepts thinking only with a budget the route maps, and sends the pinned protocol version header upstream. Thinking blocks, signatures and cache markers pass through unchanged, and usage split across the stream's events is combined. One usage row is recorded for each forwarded completion, including errors and disconnects.
Sign-in: The run token of a task's sandbox (the runtime only).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
route | path | yes | string | |
X-TQA-Run-ID | header | string |
Request body
application/json: object
Responses
| Status | Meaning | Body |
|---|---|---|
| 400 | Thinking that the route does not map, or another route policy violation; nothing is forwarded | |
| 401 | Invalid, expired, revoked or wrong-address runtime token | |
| 403 | Route does not belong to the authenticated conversation | |
| 404 | Unsupported route or operation | |
| 409 | team_budget_helpers: the task helps in an agent team past its helpers' share of the budget (GW-I-304); its lead goes on. team_budget: the task leads or helps in an agent team whose token budget or deadline is spent (or that stops for either); team_stopped: the task helps in an agent team that is stopping for another reason (its lead's own calls pass, to finish its answer). Nothing was sent; final, never retried (ADR-0034 point 8). | Error |
| 413 | Request exceeds the configured 16 MiB maximum | |
| 429 | The caller's per-user request bucket is exhausted, or the model route's limiter could not admit the request within relay.queue_wait or relay.queue_max (LLM-U-012). The model is not contacted. | |
| 502 | Upstream transport unavailable | |
| 503 | Credential or database unavailable | |
| 504 | Request header deadline exceeded | |
| default | Upstream status, content type and body bytes are preserved, including error responses and incomplete streams. |
Forward an authenticated model request
GET /relay/r/{route}/models
Model discovery shares the per-user request bucket and peer-address authentication. It does not create a usage row.
Sign-in: The run token of a task's sandbox (the runtime only).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
route | path | yes | string |
Responses
| Status | Meaning | Body |
|---|---|---|
| 401 | Invalid, expired, revoked or wrong-address runtime token | |
| 403 | Route does not belong to the authenticated conversation | |
| 404 | Unsupported route or operation | |
| 409 | team_budget_helpers: the task helps in an agent team past its helpers' share of the budget (GW-I-304); its lead goes on. team_budget: the task leads or helps in an agent team whose token budget or deadline is spent (or that stops for either); team_stopped: the task helps in an agent team that is stopping for another reason (its lead's own calls pass, to finish its answer). Nothing was sent; final, never retried (ADR-0034 point 8). | Error |
| 413 | Request exceeds the configured 16 MiB maximum | |
| 429 | Per-user request bucket exhausted | |
| 502 | Upstream transport unavailable | |
| 503 | Credential or database unavailable | |
| 504 | Request header deadline exceeded | |
| default | Upstream status, content type and body bytes are preserved, including error responses and incomplete streams. |
Relay one decision/v1 consultation to the conversation's decision engine
POST /relay/d/{engine}/v1/{point}
Called by the runtime with its token (ADR-0013 point 6). The gateway adds the engine's credential from the secret store; the runtime never holds it. Each consultation shares the per-user request bucket and records a usage row under decision:<engine>.
Sign-in: The run token of a task's sandbox (the runtime only).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
engine | path | yes | string | |
point | path | yes | "before_step", "after_response" |
Request body
application/json: object
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The engine's answer, at most 64 KiB, with only its content type | |
| 400 | Not a decision/v1 request, a point that differs from the path, or history the engine's exposure excludes | |
| 401 | Invalid, expired, revoked or wrong-address runtime token | |
| 403 | The conversation's profile does not name this engine | |
| 404 | Unknown or disabled engine, or an unknown point, or a point the engine's kind doesn't answer (a typed-question engine answers before_step only) | |
| 409 | decision_engine_budget_spent: the engine's budget for its period is spent; nothing was sent, and the task's owner is told once; or team_budget: the task leads or helps in an agent team whose token budget or deadline is spent (or that stops for either); team_stopped: the task helps in an agent team that is stopping for another reason (its lead's own calls pass, to finish its answer). Nothing was sent; final, never retried (ADR-0034 point 8). | Error |
| 413 | Request over 64 KiB | |
| 429 | Per-user request bucket exhausted | |
| 502 | upstream_unavailable: the engine failed, refused its key, or its answer was too large; decision_engine_invalid: a typed-question engine's answer wasn't a usable choice, its service refused the question as invalid, or the question's state was over 16 KiB (never sent) | |
| 503 | The engine's credential or the database is unavailable | |
| 504 | The engine did not answer within its timeout_ms |
Register a runtime WebSocket
GET /runtime/link
WebSocket upgrade. ServerFrame JSON from the runtime, ClientFrame JSON toward it. Runtime tokens identify one sandbox instance and never appear in URLs. Supervisor heartbeat frames update liveness only; they are never stored or streamed. A second link replaces the first with restarting. Ping every 30 seconds, pong deadline 90 seconds. Frames are capped at 256 KiB inside the outer 16 MiB transport limit. The first outbound frame is session.config with the last stored sequence and an explicit secret-free route projection, followed by queued actions. Reserved bootstrap tokens refuse authentication until binding completes; the runtime redials with backoff and the same token file.
Sign-in: The run token of a task's sandbox (the runtime only).
Responses
| Status | Meaning | Body |
|---|---|---|
| 101 | WebSocket established | |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 426 | The runtime's protocol revision (the TQA-Protocol-Revision header; absent means 1) is below the gateway's floor. The error names the needed and the presented revision (needs, has); nothing is exchanged, and the runtime's sandbox is retired without a replacement (ADR-0026). | |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Page stored frames for the authenticated runtime conversation
GET /runtime/history
Conversation and sandbox come only from the token and transport address; forwarded headers cannot change the binding.
Sign-in: The run token of a task's sandbox (the runtime only).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
after | query | integer 0 or more | ||
limit | query | integer 1–1000 |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Stored frames strictly after the cursor, ordered by sequence | object |
| 400 | Invalid or unknown paging parameter | |
| 401 | Missing, reserved, expired, revoked or wrong-address runtime token | |
| 503 | Store unavailable |
Open a connector session's server stream
GET /mcp/{connector}
The session's server-to-client event stream (ADR-0031), relayed event by event (each at most 1 MiB) and ended after 5 minutes without an event. One stream per session.
Sign-in: The run token of a task's sandbox (the runtime only).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
connector | path | yes | string | |
Mcp-Session-Id | header | yes | string | The opaque session id the proxy returned; never the remote's. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The event stream | string (text/event-stream) |
| 400 | No Mcp-Session-Id | Error |
| 401 | No live runtime token from its sandbox's address | Error |
| 403 | connector_not_allowed | Error |
| 404 | Unknown session: another conversation's or connector's, expired, closed, or opened with another credential; initialise again | Error |
| 405 | The remote offers no server stream | |
| 409 | stream_open: this session's stream is already open | Error |
| 424 | connector_credential_missing | Error |
| 502 | connector_unavailable or connector_redirect | Error |
| 503 | Database or secret store unavailable | Error |
| 504 | connector_timeout | Error |
Call a connector's MCP server
POST /mcp/{connector}
The MCP proxy (ADR-0031), streamable HTTP with JSON answers: one JSON-RPC 2.0 message or a batch of at most 32, at most 1 MiB. Only a runtime token from its own sandbox's address is accepted, and only for a connector in the conversation's connector set. Only initialize, notifications/initialized, ping, tools/list, tools/call and notifications/cancelled pass; anything else, or a tools/call for a tool the connector's filter hides, is answered here with a JSON-RPC error. The proxy injects the user's own credential or the connector's shared one, reaches the remote only at checked addresses without following redirects, and filters tools/list answers. An event-stream answer is relayed event by event (each at most 1 MiB; tools/list results filtered). At most 4 calls from a conversation to a connector, and 256 through the proxy, are in flight (429 connector_busy). The remote's Mcp-Session-Id never reaches the runtime: the proxy returns an opaque id bound to the conversation, the connector and the credential source (at most 8 per conversation, 10 minutes idle). A tools/call the runtime abandons is cancelled at the remote with notifications/cancelled. A connector call that fails reaches the task's transcript as a tool error whose code is one of this proxy's refusals, or the runtime's own: mcp_error (the server answered with a JSON-RPC error), mcp_method_not_found (JSON-RPC -32601) or mcp_server_exited (a tool server stopped during the call).
Sign-in: The run token of a task's sandbox (the runtime only).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
connector | path | yes | string | |
Mcp-Session-Id | header | string | The opaque session id the proxy returned on initialize; never the remote's. An unusable one is 404. | |
MCP-Protocol-Version | header | string |
Request body
application/json: object or array of object
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The remote's JSON-RPC answer, or the proxy's JSON-RPC error for a refused method or tool | object or array of object; string (text/event-stream) |
| 202 | Notifications accepted | |
| 400 | Not a JSON-RPC 2.0 message or batch | Error |
| 401 | No live runtime token from its sandbox's address | Error |
| 403 | connector_not_allowed: unknown, disabled, or not in the conversation's connector set | Error |
| 404 | Unknown session: another conversation's or connector's, expired, closed, or opened with another credential; initialise again | Error |
| 413 | Larger than 1 MiB | Error |
| 424 | connector_credential_missing, or connector_credential_rejected when the remote refuses the person's own credential (401 or 403) | Error |
| 429 | connector_busy: 4 calls from this conversation to this connector, or 256 through the proxy, are in flight; or rate_limited: the conversation owner's mcp.calls_per_minute bucket (one per message forwarded, a minute's worth at most) cannot cover this body. The remote is not contacted. | Error |
| 502 | connector_unavailable, connector_redirect or connector_answer_too_large | Error |
| 503 | Database or secret store unavailable | Error |
| 504 | connector_timeout | Error |
End a connector session
DELETE /mcp/{connector}
Ends the session at the remote and forgets it; the opaque id is then 404.
Sign-in: The run token of a task's sandbox (the runtime only).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
connector | path | yes | string | |
Mcp-Session-Id | header | yes | string | The opaque session id the proxy returned; never the remote's. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Ended (the remote's status) | |
| 204 | Ended | |
| 400 | No Mcp-Session-Id | Error |
| 401 | No live runtime token from its sandbox's address | Error |
| 403 | connector_not_allowed | Error |
| 404 | Unknown session: another conversation's or connector's, expired, closed, or opened with another credential; initialise again | Error |
| 405 | The remote does not end sessions this way | |
| 424 | connector_credential_missing | Error |
| 502 | connector_unavailable or connector_redirect | Error |
| 503 | Database or secret store unavailable | Error |
| 504 | connector_timeout | Error |
A run's channels
GET /runtime/channels
The channels the run's conversation belongs to (ADR-0014 point 4). A runtime token only, from its sandbox's address; an empty list means the run gets no channel tools.
Sign-in: The run token of a task's sandbox (the runtime only).
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Successful operation | RuntimeChannels |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Read a channel from a run
GET /runtime/channels/{id}/messages
As the human read, for a member conversation's run, with wait: a long poll that returns as soon as a matching message is past since (ADR-0014 point 7). 403 not_member otherwise, also when removed during a wait. A runtime token only.
Sign-in: The run token of a task's sandbox (the runtime only).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | |
since | query | integer 0 or more | Messages with a greater seq; 0 by default. | |
limit | query | integer 1–200 | At most this many; 50 by default. | |
types | query | string | Comma-separated message types. | |
parent | query | integer 1 or more | Only replies to this message. | |
task_seq | query | integer 1 or more | Only this task's message, its claims and reports. | |
author_kind | query | "conversation", "user", "gateway" | Only messages by this kind of author. | |
wait | query | integer 1–300 | Wait up to this many seconds for a matching message past since; an empty page when none comes. The sandbox sits idle meanwhile. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Successful operation | ChannelMessagePage |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Post to a channel from a run
POST /runtime/channels/{id}/messages
The run posts as its conversation; the author is never taken from the body. 403 not_member, observer or not_claimant; 409 channel_ended. The Idempotency-Key is optional here (the tools send one per call). A runtime token only. A vote must name an open proposal (409 not_a_proposal, proposal_closed); only a person vetoes (403 veto_not_allowed); a vote that decides its proposal is followed by the gateway's decision. 429 channel_rate once the channel has had 5,000 messages in the last 24 hours (ADR-0014), with Retry-After.
Sign-in: The run token of a task's sandbox (the runtime only).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | |
Idempotency-Key | header | string | A retry with the same key returns the first answer; the same key with another body is 422 idempotency_key_reused. |
Request body
application/json: ChannelPost
Responses
| Status | Meaning | Body |
|---|---|---|
| 201 | Successful operation | ChannelMessage |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached; channel_rate past the channel's daily message limit | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Claim a task from a run
POST /runtime/channels/{id}/tasks/{seq}/claim
As the person's claim, for the run's conversation. A runtime token only. 429 channel_rate once the channel has had 5,000 messages in the last 24 hours (ADR-0014), with Retry-After.
Sign-in: The run token of a task's sandbox (the runtime only).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
id | path | yes | string (uuid) | |
seq | path | yes | integer 1 or more |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The claimant already holds a claim: it is returned | ChannelMessage |
| 201 | Successful operation | ChannelMessage |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached; channel_rate past the channel's daily message limit | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Read an agent team's messages from a run
GET /runtime/teams/messages
What is addressed to the run's conversation after its last-read seq (ADR-0034, the slice S1 contract). The answer is recorded under the call's Idempotency-Key for the run in X-TQA-Run-ID: a repeat answers the same, and the seq advances only when that call's tool.result is stored. 403 teams_disabled when agent teams are off, not_a_member outside a team. A runtime token only.
Sign-in: The run token of a task's sandbox (the runtime only).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
limit | query | integer 1–200 | At most this many; 50 by default. | |
wait | query | integer 0–30 | A long poll of at most this many seconds; 0 by default. | |
Idempotency-Key | header | yes | string | The calling tool call's key. |
X-TQA-Run-ID | header | yes | string | The calling run. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Successful operation | object |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Post to an agent team from a run
POST /runtime/teams/messages
A lead's assign, question, decision or person_question, or a member's answer, report or ask, stored with the next seq or refused with a reason (ADR-0034, the slice S1 contract): 403 teams_disabled, not_a_member, not_lead or members_only; 404 unknown_member; 409 team_stopped or member_gone. The Idempotency-Key is required; a retry answers the first seq. A runtime token only.
Sign-in: The run token of a task's sandbox (the runtime only).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
Idempotency-Key | header | yes | string | The calling tool call's key. |
X-TQA-Run-ID | header | yes | string | The calling run. |
Request body
application/json: object
Responses
| Status | Meaning | Body |
|---|---|---|
| 201 | Successful operation | object |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 422 | Unknown reference: question_seq, decision_seq or report_seq names no message of the right type in this agent team | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Start an agent-team member from a run
POST /runtime/teams/members
start_member (ADR-0034, the slice S1 contract): the run's conversation starts a member, a normal task of the same person with the lead's settings or a profile's narrowed to them, working in its own copy of the lead's workspace or in the lead's own; the agent team is created with the first member, and the brief is stored as an assign to the member. 201 with the member, the brief's seq and lead_tools. 400 naming the field; 403 teams_disabled or not_lead; 409 profile_unusable, team_stopped or member_limit (details: limit, by); 422 unknown_reference (profile). The Idempotency-Key is required; a retry answers as the first did. A runtime token only.
Sign-in: The run token of a task's sandbox (the runtime only).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
Idempotency-Key | header | yes | string | The calling tool call's key. |
X-TQA-Run-ID | header | yes | string | The calling run. |
Request body
application/json: object
Responses
| Status | Meaning | Body |
|---|---|---|
| 201 | Successful operation | object |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 422 | Unknown reference or idempotency key reused | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Which agent-team tools a run gets
GET /runtime/teams/role
The run's role at run start (ADR-0034, slice 3): member (its two tools), lead (the ten), may_lead (a task in no team: start_member alone) or none (agent teams are off, or the conversation was ever a member, which never leads). A runtime token only.
Sign-in: The run token of a task's sandbox (the runtime only).
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The role | object |
| 401 | Authentication required | Error |
| 503 | Database unavailable or gateway restarting | Error |
The lead ends its agent team's work (done)
POST /runtime/teams/done
When the administrator set an acceptance check, the lead's runtime runs it first in the lead's workspace (at most 10 minutes) and sends its report as check; done is refused acceptance_failed unless the report is for the check set now and it exited 0, and nothing is stored. Otherwise stores the summary as a done message to every member and sets the team stopping; the stop carries it out and posts the end note to the lead. A repeat with the same key answers the same.
Sign-in: The run token of a task's sandbox (the runtime only).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
Idempotency-Key | header | yes | string | The calling tool call's key. |
X-TQA-Run-ID | header | yes | string | The calling run. |
Request body
application/json: object
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The team is stopping | object |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation; team_stopped, team_ended or not_current_run; acceptance_failed: the check didn't run (an older runtime), ran another command, or failed, the last with details {exit_code, timed_out, output} (the output's last 4,096 bytes) | Error |
| 413 | Request body limit exceeded | Error |
| 422 | Idempotency key reused with another summary or check command | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
The acceptance check the lead's done runs first
GET /runtime/teams/acceptance
The administrator's acceptance check (ADR-0034 point 10), read fresh: the lead's runtime runs it in the lead's workspace before done and sends its report with done. The lead only; a runtime token only.
Sign-in: The run token of a task's sandbox (the runtime only).
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The check | object |
| 401 | Authentication required | Error |
| 403 | teams_disabled, not_a_member or not_lead | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
The lead stops one of its helpers (stop_member)
POST /runtime/teams/members/{name}/stop
Stops the helper and posts a member_stopped notice to the lead, then cancels its active run and drops a queued wake. Stopping a stopped helper answers the same.
Sign-in: The run token of a task's sandbox (the runtime only).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
name | path | yes | string | The helper's name in the team. |
Idempotency-Key | header | yes | string | The calling tool call's key. |
X-TQA-Run-ID | header | yes | string | The calling run. |
Request body
application/json: object
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The helper is stopped | object |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 413 | Request body limit exceeded | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
The lead reads one helper's transcript (read_helper)
GET /runtime/teams/members/{name}/transcript
Where the helper is now (now), then its messages, text, tool calls and tool results after the event since, in order; read-only.
Sign-in: The run token of a task's sandbox (the runtime only).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
name | path | yes | string | The helper's name in the team. |
since | query | integer 0 or more | ||
limit | query | integer 1–200 | ||
X-TQA-Run-ID | header | yes | string | The calling run. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | A page of the helper's transcript | object |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | Record not found | Error |
| 409 | Bootstrap closed, idempotency route conflict or deleted conversation | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
Place a helper's report files in the lead's uploads
POST /runtime/teams/files
take_files (ADR-0034 point 6): the lead places a report's files, all of them or those named by their paths in the report, in its own uploads/ exactly as a person's attachments go there, each named <member>-<path> with / as -, sanitised; a name already taken gets the next free one, so nothing is overwritten. 200 with each file's report path, workspace path and size. Taking a file again places another copy; files placed before a failure stay. 400 invalid_request (the files rule, or X-TQA-Run-ID missing or malformed), or path_invalid naming the file; 403 teams_disabled, not_a_member or not_lead; 404 not_found naming the file (not in that report, or its member task deleted); 409 team_stopped, not_current_run, uploads_full or files_unavailable (the lead's workspace can't be written now), a file's naming it; 413 upload_too_large naming the file; 422 unknown_reference (report_seq). A file's refusal has details: {path}. The Idempotency-Key is required; a retry answers as the first did. A runtime token only.
Sign-in: The run token of a task's sandbox (the runtime only).
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
Idempotency-Key | header | yes | string | The calling tool call's key. |
X-TQA-Run-ID | header | yes | string | The calling run. |
Request body
application/json: object
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Successful operation | object |
| 400 | Invalid request or unsupported protocol | Error |
| 401 | Authentication required | Error |
| 403 | Origin, ownership or role denied | Error |
| 404 | A named file not in that report, or no longer stored | Error |
| 409 | Team stopped, uploads full or the workspace unavailable | Error |
| 413 | Request body or file size limit exceeded | Error |
| 422 | Unknown reference or idempotency key reused | Error |
| 429 | Rate or capacity limit reached | Error |
| 503 | Database unavailable or gateway restarting | Error |
| 504 | I/O deadline exceeded | Error |
The sandbox's screen bridge (WebSocket)
GET /runtime/screen
Dialled by the runtime of a desktop session with its runtime token (ADR-0039 section 5), held as a long poll: upgraded for the oldest viewer asking for a bridge, now or within 30 s, else 204 at 30 s and the runtime dials again. One bridge per viewer, at most four: while four are up the dial is refused 409, and the runtime waits for one of its bridges to close. The bridge carries RFB bytes between that viewer and the sandbox's VNC server on loopback.
Sign-in: The run token of a task's sandbox (the runtime only).
Responses
| Status | Meaning | Body |
|---|---|---|
| 101 | Paired with a viewer: the WebSocket bridge | |
| 204 | No viewer asked within 30 s: dial again | |
| 401 | No valid runtime token | Error |
| 403 | The conversation's environment has no desktop | Error |
| 409 | screen_bridges: four bridges are up | Error |
| 503 | Database unavailable or gateway restarting | Error |