agent
The hub's cloud agent. A session works toward a goal with the hub's own tools and a sandboxed shell. It acts as a short-lived key scoped below its creator's. Spends past a pre-approved budget wait for a person. Everything it does is recorded as an append-only event stream.
GET / v1/ agent/ sessions
List agent sessions
Sessions visible to the caller (owner, creator, or a member of the owning org), newest first. No session is public.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
status | query | AgentSessionStatus | |
limit | query | integer | Page size. |
cursor | query | string | Opaque cursor from the previous page's |
Responses
| Status | Description | Body |
|---|---|---|
200 | Page of sessions. | AgentSessionPage |
401 | Missing or invalid credentials. | Problem |
422 | Request failed validation. | Problem |
POST / v1/ agent/ sessions
Start an agent session (the hub's cloud agent works toward a goal)
{goal, robot?, campaign?, budget_usd, cap_usd?, scopes?, owner?} → a session whose first turn is queued at once. The agent loop runs on the hub (one arq job per turn, state in Postgres). A frontier model sits behind the coach's model interface, extended with tool use. It calls the hub's MCP tools in-process, as the session's own short-lived key. Where the deployment configures one, it also calls a Modal sandbox shell whose network reaches only the hub.
Keys. The hub mints a key for every turn, bound to the session (api_keys.agent_session_id). The key expires on its own, and is revoked when the turn yields or the session ends. Its scope is the one the session was granted: scopes, which is never above the creator's own. No agent key can call a session-scoped operation or approve its own spend (resolveAgentApproval is 403 to every agent key). No agent key can create another session or approve a device handoff either.
Money. Two numbers.
budget_usd is the spend a person pre-approves for the tools that cost money. Those are submit_training on a priced executor, a Modal rollout_in_sim, serve_model on Modal, plan_task and the coach's two paid tools. Inside the budget, the tool runs and says so. Above it, the session pauses with an approval_requested event (waiting_on_you) until a person answers.
cap_usd (default $10) caps the session's own model + sandbox spend. The model is billed at its vendor's list price, plus 5% on a hub that takes payments. Each call reserves count_tokens + max_tokens first, and settles on the reported usage, cache fields included. The next call is refused at the cap. The sandbox is billed at Modal's sandbox rate × 1.1, only while active. Every call and every sandbox interval is one ledger_entries row.
The model is billed to the Anthropic key of the session owner's workspace (listModelKeys). A workspace with no key answers 402 with type: model_key_required, unless the hub serves it with its own key.
Until a payment system exists, every account (an org shares one) gets a $5 monthly allowance for what the hub pays. That is the sandbox, and model calls on the hub's own key. There is nothing beyond it: 402 when it is spent. Only claude-sonnet-5 is offered.
An account may run up to AGENT_MAX_LIVE_SESSIONS (3) working sessions at once. A working session is running, waiting on an event or waiting on you. A sleeping session does not count. A fourth is 409 naming the three.
Plan first. Nothing billable runs before a person approves a plan. On a task that needs compute, the agent's first move is a plan (listAgentPlans). Until one is approved, every training run, round, rollout, render, endpoint and orchestration plan the agent asks for is refused. Its tools refuse them, and the hub's own routes refuse them for its key. Model turns may run, and a session that only answers a question needs no plan. A person who starts the session with plan_first: false lets the hub approve a plan for them. The hub does so when the plan is free or fits what is left of the free allowance. A plan that costs more still waits for them.
Context. context[] names the hub objects a session starts with ("Ask the agent about this model"). Each one is checked as the caller. Missing, private and the wrong kind are one 422 at context[i]. Each object is stored on the session. The model gets them on its first turn as a compact summary built from the hub's own reads. That summary is a notice event (code: context), which the page shows too.
Spends model dollars: key:train.
Request body
| Field | Type | Description |
|---|---|---|
goal | string | What the agent should achieve, in plain words. |
robot | string | null |
|
campaign | string | null | A campaign the session works inside, by id or slug. It must be an The campaign's budget does not pay for spends outside this campaign (a round of another campaign, a standalone run, a coach call). So the workspace's rules judge them. |
budget_usd | number | null | A total a person pre-approves for the session's spending tools, on top of the per-run limit. The spending tools cover GPU training on a priced executor, a Modal rollout, a Modal endpoint, a plan and a coach call. A call is auto-approved only while every approved call's cap, this one's included, fits in the total. Null: no session total, so the per-run limit alone decides. 0: every spending call asks. The total does not cover the model or sandbox spend. Those fall under |
auto_approve_per_run_usd | number | null | This session's per-call auto-approve limit. It may only LOWER the workspace's limit ( |
cap_usd | number | null | Cap on the session's own model + sandbox spend ( |
model | string | null | The model the loop runs on ( |
scopes | array of ApiKeyScope | null | Scopes the session's keys carry. The session acts with the highest one named. That scope may not exceed what the creating credential was granted ( |
owner | string | null | Who the session is billed to: the creator (null) or an org handle the creator is a member of. The allowance and the working-session cap are per owner. |
sandbox | boolean | Offer the agent a sandbox shell (when the deployment configures one). |
context | array of AgentContextRef | Hub objects the session starts with. Each is checked as the caller. An object that is missing, private or the wrong kind gets
|
plan_first | boolean | True: the agent shows its plan and waits for a person to approve it before anything runs. False: the hub approves the plan for the person when the plan is free. It does the same when the plan fits what is left of the free monthly allowance. A plan that costs more still waits for a person. Only a signed-in person may turn it off ( |
compute | AgentCompute | null | Where the person wants the work to run. The agent is told, and a plan whose runs go elsewhere is rejected before a person sees it. Null: the agent chooses. |
kind | AgentSessionKind |
|
Responses
| Status | Description | Body |
|---|---|---|
201 | Session created; its first turn is queued. | AgentSession |
401 | Missing or invalid credentials. | Problem |
402 | The account's monthly allowance is used up. Or the workspace needs an Anthropic key ( | Problem |
403 | Authenticated but not allowed (visibility, membership or scope). | Problem |
409 | State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...). | Problem |
422 | Request failed validation. | Problem |
503 | A service this endpoint needs is not configured in this deployment. The API boots with zero secrets. An endpoint that needs one says so instead of returning a stack trace. | Problem |
GET / v1/ agent/ sessions/ {session_id}
Get an agent session (status, spend, what it waits on, pending approvals)
Everything a page needs beside the event stream:
- status and why;
- the three spend lines (model at the vendor's price, sandbox × 1.1, GPU committed from the budget);
- the allowance;
- what the agent waits on;
- the pending approvals;
- the sandbox's state;
last_event_id, wherestreamAgentEventsresumes.
A session you may not see is 404.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
session_id | path | Id | Agent session id ( |
Responses
| Status | Description | Body |
|---|---|---|
200 | The session. | AgentSession |
401 | Missing or invalid credentials. | Problem |
404 | Resource not found (or hidden from the caller). | Problem |
POST / v1/ agent/ sessions/ {session_id}/ messages
Send the agent a message (a user turn)
Appends a user message and queues a turn. A message wakes any session that is not canceled or failed:
- A
sleepingone. - A
waiting_on_youone. A reply in words is how a person changes a proposed plan. The agent answers with a new version. - A
waiting_on_eventone, whose wait it interrupts. - A
doneone, which it reopens.
On a running one, the message is handed to the model at its next step. 409 only on a canceled or failed session. A message never counts against the working-session cap. It spends model dollars, so it needs key:train. An agent's own key is 403. A workspace that has no Anthropic key the hub may use answers 402, and no turn is queued.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
session_id | path | Id | Agent session id ( |
Request body
| Field | Type | Description |
|---|---|---|
text | string |
Responses
| Status | Description | Body |
|---|---|---|
202 | Message recorded; a turn is queued. | AgentSession |
401 | Missing or invalid credentials. | Problem |
402 | This workspace has no key the hub may use for the model's vendor, or a limit is reached: its own key's monthly cap, or the workspace's limit. | Problem |
403 | Authenticated but not allowed (visibility, membership or scope). | Problem |
404 | Resource not found (or hidden from the caller). | Problem |
409 | State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...). | Problem |
422 | Request failed validation. | Problem |
GET / v1/ agent/ sessions/ {session_id}/ events
Stream a session's events (SSE, resumable)
Server-Sent Events from the session's append-only event table, in the order they were written. Every frame carries id: <event id> (a ULID), event: <kind> and data: <AgentEvent JSON>. A reconnecting EventSource sends Last-Event-ID, and the stream resumes strictly after it. The after query parameter does the same. With follow=true the stream stays open until the session ends. While nothing happens, it sends : keepalive comments. event: end always closes it, with the session's status. Same shape as streamRunLogs. The kinds are message, tool_use, tool_result, terminal, approval_requested, approval_resolved, status, usage, sandbox, notice, error, plan, decision and round. Each kind and its data are as AgentEvent defines them. Replaying the stream plus getAgentSession (and the digest, objects and decisions) is everything the agent page needs.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
session_id | path | Id | Agent session id ( |
follow | query | boolean | Keep the stream open until the session ends. |
after | query | Id | Resume strictly after this event id (the |
Last-Event-ID | header | Id | The id of the last event the client saw (sent by |
Responses
POST / v1/ agent/ sessions/ {session_id}/ approvals/ {approval_id}
Approve or deny a spend the agent asked for
Answers a spend decision (approval_requested). A spend the rules do not allow becomes one:
- any compute call outside the approved plan, whatever it costs;
- a coach call over the per-run limit or the budget.
The wait is non-blocking: the agent keeps working while it waits. On approve, its next turn runs the held call exactly as it was asked for before anything else. The held call is no longer a dry run. On deny, the agent is told the call did not run and why. raise_budget_to approves this call and grants the session a standing allowance for the rest of its life. Later compute calls whose caps fit in what is left of it run without asking (the rule reads session_grant). The session's budget is raised to cover the allowance.
A call outside the approved plan is decided only by a signed-in person's session. Such a call asks a person, and a key is not a person. So every API key is 403, the owner's train key included. The owner's train key may still decide a coach call over the per-run limit or the budget. Every agent session key is 403 for everything, including this session's own. An agent never approves its own spend. 409 once the approval is decided or expired (expires_at, the session's window). 409 also when the session is canceled / failed.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
session_id | path | Id | Agent session id ( |
approval_id | path | Id | Agent spend approval id ( |
Request body
| Field | Type | Description |
|---|---|---|
decision | string | |
note | string | null | Shown to the agent with the decision. |
raise_budget_to | number | null |
|
Responses
| Status | Description | Body |
|---|---|---|
200 | The decided approval. | AgentApproval |
401 | Missing or invalid credentials. | Problem |
403 | Authenticated but not allowed (visibility, membership or scope). | Problem |
404 | Resource not found (or hidden from the caller). | Problem |
409 | State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...). | Problem |
422 | Request failed validation. | Problem |
POST / v1/ agent/ sessions/ {session_id}/ cancel
Cancel an agent session
Ends the session now (canceled). Pending approvals are withdrawn and the session's keys are revoked. The sandbox is terminated and its last interval is billed. A model call already in flight finishes and is billed (the ledger records it). Nothing the model asked for after that call runs. Runs, rollouts or plans the agent started are not touched. Cancel them on their own pages. 409 when the session already ended.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
session_id | path | Id | Agent session id ( |
Responses
| Status | Description | Body |
|---|---|---|
200 | The canceled session. | AgentSession |
401 | Missing or invalid credentials. | Problem |
403 | Authenticated but not allowed (visibility, membership or scope). | Problem |
404 | Resource not found (or hidden from the caller). | Problem |
409 | State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...). | Problem |
POST / v1/ agent/ sessions/ {session_id}/ end
End an agent session (done; a reply reopens it)
The person ends the session: status done, stop_code: ended. Unlike cancelAgentSession, this is not final. Its sandbox snapshot is kept and a message reopens it (postAgentMessage wakes a done session). Pending decisions are withdrawn: a spend or a plan nobody answered does not survive the end. The session's keys are revoked. Runs, rollouts or rounds it started are not touched. 409 on a canceled or failed session, or one that is already done. An agent's own key is 403.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
session_id | path | Id | Agent session id ( |
Responses
| Status | Description | Body |
|---|---|---|
200 | The ended session. | AgentSession |
401 | Missing or invalid credentials. | Problem |
403 | Authenticated but not allowed (visibility, membership or scope). | Problem |
404 | Resource not found (or hidden from the caller). | Problem |
409 | State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...). | Problem |
GET / v1/ agent/ sessions/ {session_id}/ plans
The plans the agent proposed in this session, newest version first
Every version of the session's plan. The agent proposes a plan before anything that costs compute. Nothing billable happens before a person approves a plan. A person approves the latest version (approveAgentPlan, session-only), or replies in words. After a reply, the agent proposes the next version, and the version it replaces reads edited. Only the latest version can be approved.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
session_id | path | Id | Agent session id ( |
Responses
| Status | Description | Body |
|---|---|---|
200 | The plans. | AgentPlanPage |
401 | Missing or invalid credentials. | Problem |
404 | Resource not found (or hidden from the caller). | Problem |
GET / v1/ agent/ sessions/ {session_id}/ plans/ {plan_id}
One version of the session's plan
The plan as the agent page draws it. It holds:
- its rounds;
- contingent rounds and their condition;
- "then" and "not doing";
- the total cap.
Each round is what will become a campaign round's locked spec. It holds one change and its keys, and gates with the prediction written beside each. The hypothesis is shown beside the gates and is never counted. A round also holds the gate while training, the stop rules, the estimate and the cap. Estimates are the hub's own (estimateRun's function). Nothing in a plan is spent until a person approves it.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
session_id | path | Id | Agent session id ( |
plan_id | path | Id | Agent plan id ( |
Responses
POST / v1/ agent/ sessions/ {session_id}/ plans/ {plan_id}/ approve
Approve the agent's plan (a signed-in person only)
Session-only, like a device approval: no API key of any scope approves a plan. So no agent can approve its own. The plan is the contract: approving it pre-approves each round's cap. A round can start now when it has no contingent_on and no parent_from. In a session with a campaign, this request creates and locks every such round through createRound's own path. The three rules and the campaign's budget are checked. A refusal (422 with the rule reasons, 409 on the budget) records nothing and leaves the plan proposed. In a session without a campaign, each such round's run is created through createRun's path. The later rounds start when the agent asks for them by key (start_planned_round), exactly as approved. Anything the agent then wants that the plan does not name asks a person again, whatever it costs. 409 when the plan is not the latest version or is not proposed. 409 also when the session is canceled or failed.
Beyond the free allowance. When the plan can cost more than the owner's free monthly allowance covers (allowance.needs_confirmation), the person must confirm it with confirm_beyond_allowance: true. Without it the answer is 409 with the amount, and nothing is created.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
session_id | path | Id | Agent session id ( |
plan_id | path | Id | Agent plan id ( |
Request body
| Field | Type | Description |
|---|---|---|
note | string | null | Shown to the agent with the approval. |
confirm_beyond_allowance | boolean | The person confirms the plan may cost more than the free allowance covers ( |
Responses
| Status | Description | Body |
|---|---|---|
200 | The approved plan, with the rounds it created. | AgentPlan |
401 | Missing or invalid credentials. | Problem |
403 | Authenticated but not allowed (visibility, membership or scope). | Problem |
404 | Resource not found (or hidden from the caller). | Problem |
409 | State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...). | Problem |
422 | Request failed validation. | Problem |
GET / v1/ agent/ sessions/ {session_id}/ decisions
The session's decisions: plan, spend, shortlist, handoff
The typed decision cards, all in one shape:
- a plan, answered by
approveAgentPlanor a reply in words; - a spend outside the approved plan, answered by
resolveAgentApproval(withexpires_atandraise_budget_to); - a shortlist of checkpoints for the real robot, answered by
decideRound {action: shortlist}. The 20-seed scan runs first, then one consent request per checkpoint; - a handoff: a device consent request. It only links to the consent page and is never approved here.
answer_via names the operation that answers each. Newest first. status filters the list.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
session_id | path | Id | Agent session id ( |
status | query | AgentDecisionStatus |
Responses
| Status | Description | Body |
|---|---|---|
200 | The decisions. | AgentDecisionPage |
401 | Missing or invalid credentials. | Problem |
404 | Resource not found (or hidden from the caller). | Problem |
422 | Request failed validation. | Problem |
GET / v1/ agent/ sessions/ {session_id}/ digest
"Since you left": what happened in the session since the viewer last looked
The hub generates it from the session's events and the objects they link. No AI model writes it. It costs nothing, reads the same every time, and cannot state a fact the rows do not hold. The agent's own words appear only as quotes (a round card's "Next", a spend's proposal). The lines come in this order, each with the ids to open:
- runs that finished or failed;
- the gates their checkpoints got;
- the round's verdict by its locked gates;
- the tripwire;
- videos rendered or rendering;
- handoffs;
- what needs you.
since defaults to the viewer's last_seen_at (else the session's start). Unless mark=false, reading it moves the viewer's last_seen_at to now. An agent's own key never marks.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
session_id | path | Id | Agent session id ( |
since | query | string (date-time) | Lines about what happened after this instant (default the viewer's |
mark | query | boolean | Move the viewer's |
Responses
| Status | Description | Body |
|---|---|---|
200 | The digest. | AgentDigest |
401 | Missing or invalid credentials. | Problem |
404 | Resource not found (or hidden from the caller). | Problem |
422 | Request failed validation. | Problem |
GET / v1/ agent/ sessions/ {session_id}/ objects
The session's objects grouped by state: Needs you, Running, Ready for review, Done
The overview column of the session page. It lists every object the session touched, derived from its events' links and its plan. Each object gets one line of facts, and the lines are grouped. Needs you: pending decisions, and the spends an older session still holds the old way. Those are pending AgentApprovals with no decision card (kind: approval), so a page never has to patch them in. A render's line says how long is left, from the hub's measured render time (AgentRenderRef.expected_s). Running: queued or running runs, renders and the shortlist's scans. Ready for review: checkpoints that PASS the round's locked gates (a shortlist's candidates once one is proposed). Done: finished runs and renders, and plan rounds that were not needed. The groups always come back in that order, empty ones included.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
session_id | path | Id | Agent session id ( |
Responses
| Status | Description | Body |
|---|---|---|
200 | The objects. | AgentObjects |
401 | Missing or invalid credentials. | Problem |
404 | Resource not found (or hidden from the caller). | Problem |
GET / v1/ tasks
List the agent's tasks, sessions and robot plans in one list
Everything the hub's agent works on for the caller, newest first. These are its sessions, which train and test policies, and its plans on a connected robot. No task is public.
Each task has a stage. The hub derives it on every read from what exists: the task's plan, its runs, its sim tests and its deploy requests. Nothing about a stage is stored. The stages run planning, awaiting_approval, training, testing_in_sim, ready_for_review, deploy_pending_approval, then deployed, failed or stopped. A plan on a connected robot has no training stages.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
limit | query | integer | Page size. |
cursor | query | string | Opaque cursor from the previous page's |
Responses
GET / v1/ tasks/ {task_id}
Get one task with its stages, evidence and deploy requests
One task. It shows the task's stage and why, the stages it has reached and when, and the runs it started. It also shows its sim tests with their verdicts, its deploy requests and what it has cost so far. A task you may not see is 404.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
task_id | path | Id | A task's id, the id of its agent session ( |
Responses
POST / v1/ tasks/ {task_id}/ stop
Stop a task and the work it started
The task page's Stop. For a session the agent stops (endAgentSession): a message reopens it. Each of its training runs still queued is canceled, and each one running stops early and keeps its checkpoints (stopRun). For a plan on a connected robot the plan is canceled (cancelPlan). A deployment already approved keeps running: stop it from the robot's approval page. Stopping a task that has already stopped changes nothing and answers the task.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
task_id | path | Id | A task's id, the id of its agent session ( |
Responses
Schemas (41)
The schemas these operations reach before any other tag’s do. A type that links elsewhere is rendered on that tag’s page.
AgentSessionStatus
running: a turn is queued or in progress.waiting_on_you: a decision waits for a person. It may be a plan, a spend or a shortlist (waiting_on.decision_ids), or an older session's held spend (pending_approvals). An event may still wake the agent meanwhile.waiting_on_event: nothing waits for a person. The agent yielded until a run, rollout, gate, approval request, plan or endpoint moves (waiting_on).sleeping: nothing is pending and the agent waits for a message. Its sandbox is snapshotted and stopped, so nothing bills. No idle timeout ends it any more.idle: the old name for the same wait. It is no longer written. Read it assleeping.done: the person ended it (endAgentSession) or the agent declared the task complete. A message reopens it.failed: a hard stop, withstop_code. The cause may be the session cap, the monthly allowance or the call cap. It may also be a refused or failing model, or the creating credential revoked.canceled:cancelAgentSession.
Only failed and canceled are final.
AgentSessionPage
| Field | Type | Description |
|---|---|---|
items | array of AgentSession | |
next_cursor | string | null |
AgentSessionCreate
| Field | Type | Description |
|---|---|---|
goal | string | What the agent should achieve, in plain words. |
robot | string | null |
|
campaign | string | null | A campaign the session works inside, by id or slug. It must be an The campaign's budget does not pay for spends outside this campaign (a round of another campaign, a standalone run, a coach call). So the workspace's rules judge them. |
budget_usd | number | null | A total a person pre-approves for the session's spending tools, on top of the per-run limit. The spending tools cover GPU training on a priced executor, a Modal rollout, a Modal endpoint, a plan and a coach call. A call is auto-approved only while every approved call's cap, this one's included, fits in the total. Null: no session total, so the per-run limit alone decides. 0: every spending call asks. The total does not cover the model or sandbox spend. Those fall under |
auto_approve_per_run_usd | number | null | This session's per-call auto-approve limit. It may only LOWER the workspace's limit ( |
cap_usd | number | null | Cap on the session's own model + sandbox spend ( |
model | string | null | The model the loop runs on ( |
scopes | array of ApiKeyScope | null | Scopes the session's keys carry. The session acts with the highest one named. That scope may not exceed what the creating credential was granted ( |
owner | string | null | Who the session is billed to: the creator (null) or an org handle the creator is a member of. The allowance and the working-session cap are per owner. |
sandbox | boolean | Offer the agent a sandbox shell (when the deployment configures one). |
context | array of AgentContextRef | Hub objects the session starts with. Each is checked as the caller. An object that is missing, private or the wrong kind gets
|
plan_first | boolean | True: the agent shows its plan and waits for a person to approve it before anything runs. False: the hub approves the plan for the person when the plan is free. It does the same when the plan fits what is left of the free monthly allowance. A plan that costs more still waits for a person. Only a signed-in person may turn it off ( |
compute | AgentCompute | null | Where the person wants the work to run. The agent is told, and a plan whose runs go elsewhere is rejected before a person sees it. Null: the agent chooses. |
kind | AgentSessionKind |
|
AgentSession
One cloud-agent session. The conversation itself is the event stream (streamAgentEvents); this is the state around it.
| Field | Type | Description |
|---|---|---|
id | Id | |
status | AgentSessionStatus | |
status_reason | string | null | |
stop_code | string | null | Why a |
title | string | null | The session's title, set by the agent from the goal (e.g. "Omni walk · R4 lateral feed-forward"); null until it sets one. |
summary | string | null | The status line the agent writes whenever it acts (the home page's second line). It says what the agent last did and what waits. The agent sets it with its |
summary_at | string (date-time) | null (date-time) | |
slept_at | string (date-time) | null (date-time) | When the session last went to sleep; null while it is awake. |
last_seen_at | string (date-time) | null (date-time) | When the caller last read the session's digest (per viewer); the digest's default |
plan | AgentPlanRef | null | The session's latest plan version (approved or not). |
approved_plan_id | string | null | The plan version in force; null until a person approves one. |
pending_decisions | integer | Decisions waiting for a person (plan, spend, shortlist). |
goal | string | |
robot | string | null | |
campaign | string | null | |
context | array of AgentContextRef | The hub objects the session was started with ( |
plan_first | boolean | Whether a person approves every plan ( |
compute | AgentCompute | null | Where the person asked the work to run ( |
kind | AgentSessionKind | |
owner | RepoOwner | |
created_by | UserPublic | null | |
model | string | |
backend | string |
|
billing | string | Who paid for the session's latest model call. |
scopes | array of ApiKeyScope | What the session's keys are granted (the highest one is used). |
budget_usd | number | null | The session's pre-approved total for spending tools. Null: the per-run limit alone. |
auto_approve_per_run_usd | number | The per-call auto-approve limit in force (the workspace's, or lower for this session). |
cap_usd | number | |
spend | AgentSpend | |
allowance | AgentAllowance | |
calls | integer | |
max_calls | integer | |
user_turns | integer | |
waiting_on | AgentWait | null | |
pending_approvals | array of AgentApproval | |
sandbox | AgentSandbox | |
last_event_id | string | null | Where |
created_at | string (date-time) | |
updated_at | string (date-time) | |
finished_at | string (date-time) | null (date-time) | |
expires_at | string (date-time) | The end of the session's current window ( |
AgentMessageCreate
| Field | Type | Description |
|---|---|---|
text | string |
AgentApprovalDecision
| Field | Type | Description |
|---|---|---|
decision | string | |
note | string | null | Shown to the agent with the decision. |
raise_budget_to | number | null |
|
AgentPlanPage
| Field | Type | Description |
|---|---|---|
items | array of AgentPlan |
AgentPlan
The agent's plan for the session. It covers what the agent will train and how each round is judged. It also covers what the plan may cost and what the agent will not do. Nothing billable runs in a session before a person approves a plan. After that, the plan is the contract. Anything outside it asks a person.
| Field | Type | Description |
|---|---|---|
id | Id | |
session_id | Id | |
version | integer | 1 for the first proposal; each edit is the next version. |
status | AgentPlanStatus | |
title | string | null | The plan card's title, e.g. "R4, and R4b if needed". |
summary | string | The agent's own paragraph about the plan, quoted as written. |
campaign | AgentCampaignRef | null | The session's campaign, whose rounds the plan's rounds become; null without one. |
new_campaign | AgentPlanNewCampaign | null | A campaign the hub creates when a person approves the plan. Only a training task without a campaign proposes one. Its rounds then become that campaign's rounds. |
robot | string | null | |
rounds | array of AgentPlanRound | |
after | array of string | "Then": what follows a PASS. Examples: the 20-seed band scan, a shortlist of up to 2, the robot handoff by consent. |
not_doing | array of string | |
stop_rules | array of string | The session-level stop rules in words (its budget, its model cap), hub-generated. |
cap_usd | number | The most the plan can spend on compute: every round's cap, contingent rounds included. |
est_usd | number | null | The expected compute cost of the rounds that start at approval, where the planner models them. |
budget_usd | number | null | The session's |
model_estimate_usd | number | null | A rough figure for the agent's own model turns across the plan, from the free allowance. It uses a flat per-checkpoint wake cost. |
model_estimate_basis | string | null | |
proposed_at | string (date-time) | |
approved_at | string (date-time) | null (date-time) | |
approved_by | UserPublic | null | |
approval_note | string | null | |
superseded_by | string | null | The plan version that replaced this one ( |
decision_id | string | null | The |
allowance | AgentPlanAllowance | null | What the plan can cost against the owner's free monthly allowance. |
AgentPlanApprove
| Field | Type | Description |
|---|---|---|
note | string | null | Shown to the agent with the approval. |
confirm_beyond_allowance | boolean | The person confirms the plan may cost more than the free allowance covers ( |
AgentDecisionPage
| Field | Type | Description |
|---|---|---|
items | array of AgentDecision |
AgentDigest
| Field | Type | Description |
|---|---|---|
session_id | Id | |
since | string (date-time) | |
until | string (date-time) | |
marked | boolean | Whether this read moved the viewer's |
lines | array of AgentDigestLine |
AgentObjects
| Field | Type | Description |
|---|---|---|
session_id | Id | |
generated_at | string (date-time) | |
total | integer | |
groups | array of AgentObjectGroupItems | Always the four groups, in the order Needs you, Running, Ready for review, Done. |
TaskPage
| Field | Type | Description |
|---|---|---|
items | array of Task | |
next_cursor | string | null |
Task
One thing the hub's agent works on: an agent session or a plan on a connected robot. Its stage is derived on every read.
| Field | Type | Description |
|---|---|---|
id | Id | |
kind | TaskKind | |
title | string | The agent's title for the task, else the start of its goal. |
goal | string | What the person asked for, as written. |
stage | TaskStage | |
stage_reason | string | One sentence saying why the task is at this stage. |
waiting_on_you | boolean | True while one of the task's decisions waits for a person. A decision is a plan, a spend, a shortlist or a deploy request. |
stages | array of TaskStageReached | The stages the task has reached so far, in order, each with when it first did. |
status | string | The session's or the plan's own status ( |
robot | string | null |
|
device | TaskDevice | null | The connected robot a plan works on. |
owner | RepoOwner | |
backend | string | null |
|
cost_usd | number | What the task has cost so far. It counts the agent's AI model calls and sandbox, plus its training runs on Lucen cloud. A running run counts its cost so far. A plan on a robot counts its AI model calls. |
runs | array of TaskRun | |
evidence | array of TaskEvidence | The task's sim tests, newest first, at most 12. |
deploy_requests | array of TaskDeployRequest | The task's requests to run a policy on a robot, newest first. |
created_at | string (date-time) | |
updated_at | string (date-time) | |
finished_at | string (date-time) | null (date-time) |
AgentContextRef
A hub object a session starts with. The Train page passes the chosen context this way: the robot as robot, the method as method, a dataset as dataset and a base policy as model.
| Field | Type | Description |
|---|---|---|
type | string | |
ref | string |
|
AgentCompute
own_machine: a runner on the person's own computer, free. cloud_cpu: Lucen cloud CPU, which the free monthly allowance covers. cloud_gpu: Lucen cloud GPU, which no allowance covers.
AgentSessionKind
general: a session that answers or acts on the goal as asked. train_task: a session whose goal is a policy to train.
AgentSpend
The session's three lines, in USD. model_usd is the vendor's list price, plus 5% on a hub that takes payments. sandbox_usd is Modal's sandbox rate × 1.1 for the intervals the sandbox was active. Both are sums of the session's ledger rows. gpu_budget_used_usd is what tools committed inside budget_usd (estimates: the most they can cost). gpu_approved_usd is what a person approved above it. The GPU itself is billed on its run or endpoint.
| Field | Type | Description |
|---|---|---|
model_usd | number | |
sandbox_usd | number | |
total_usd | number |
|
reserved_usd | number | A model call's reservation while it is in flight; 0 between calls. |
gpu_budget_used_usd | number | |
gpu_approved_usd | number | |
calls | integer | Model calls made, each one a ledger row. |
ledger_rows | integer | |
gpu_usd | number | The header's third line: GPU dollars of the runs this session started. For a finished run it is the run's |
gpu_runs | array of AgentGpuRun | |
sandbox_state | AgentSandboxState |
AgentWait
What the session is blocked on.
| Field | Type | Description |
|---|---|---|
kind | string |
|
decision_ids | array of Id | The pending decisions ( |
event | string | null | With |
ref | string | null | The resource id waited on. |
every | integer | null | With |
next_at | integer | null | With |
until | string | null | What wakes the agent:
|
approval_ids | array of Id | |
since | string (date-time) | |
timeout_at | string (date-time) | null (date-time) | |
message | string | null |
AgentSandbox
| Field | Type | Description |
|---|---|---|
state | AgentSandboxState | |
sandbox_id | string | null | Modal's id for the current container. |
started_at | string (date-time) | null (date-time) | When the current active interval began. |
active_seconds | number | Seconds billed so far over every interval. |
cost_usd | number | |
expires_at | string (date-time) | null (date-time) | The sandbox's 24 h hard cap, from its first start. |
egress | array of string | The only hosts the sandbox's network may reach: the hub's. |
AgentCampaignRef
| Field | Type | Description |
|---|---|---|
id | Id | |
slug | string | |
name | string | |
robot | string | null |
|
AgentPlanNewCampaign
The campaign a training task's plan asks for. It is created under the session's owner, on the session's robot, when a person approves.
| Field | Type | Description |
|---|---|---|
name | string | |
task | CampaignTask | |
budget_usd | number | The campaign's budget. It is at least the plan's cap, and at least one dollar. |
AgentPlanRound
One round of a plan. It holds what createRound will lock: a name, the checkpoint the round resumes from, the spec and the recipe. It also holds what the hub derived from them. The spec holds:
- ONE change and its keys
- the hypothesis, shown beside the gates and never counted
- the gates, each with the prediction written beside it
- not-doing
- tripwires
- the iteration cap
In a session without a campaign the same shape describes a run. The recipe is what createRun receives. The spec is the record of the gates and predictions. No verdict is computed without a campaign.
| Field | Type | Description |
|---|---|---|
key | string | The round's short label inside the plan, e.g. |
name | string | The round's name, e.g. "lateral feed-forward". |
contingent_on | string | null | A contingent round's condition in words, e.g. "only if R4's vy±0.10 is still over the band at the scan". It never starts at approval. The agent starts it by key when it judges the condition met. The agent's reading is quoted on the round ( |
parent | CheckpointRef | null | The checkpoint it resumes from; null trains from scratch (or from the campaign's root). |
parent_from | string | null | Instead of |
spec | RoundSpec | |
recipe | Recipe | |
scan | RoundScanRequest | null | |
card | ExperimentCardCreate | null | The experiment card the round is created with, as |
start | string |
|
gate | CheckpointGateSpec | null | The gate while training, as it will run. It is the recipe's gate, else the campaign task's default (the poster |
estimate | RunEstimate | null |
|
est_usd | number | null | What the round is expected to cost, where the hardware planner can model the template. It is |
est_hours | number | null | The planner's expected wall-clock hours ( |
cap_usd | number | The most the round can cost: |
parent_name | string | null | What to call the parent checkpoint's run (its |
variables | RoundVariables | null | The one-variable arithmetic, planned when the plan was proposed: the recipe against the parent's resolved config. Null for a round whose parent is not known yet. A plan whose round breaks a rule is rejected before a person sees it. |
warnings | array of string | What the rules noticed and would not refuse. Examples: a stand round with no push gate, a key that cannot be compared. |
stop_rules | array of string | The round's stop rules in words, from its tripwires and its cap (hub-generated). |
status | AgentPlanRoundStatus | |
round_n | integer | null | The campaign round it became, once created. |
round_id | string | null | |
run_id | string | null | Its training run, once created. |
started_at | string (date-time) | null (date-time) | |
note | string | null | The agent's reading of a contingent condition (quoted), a skip's reason (quoted), or why the hub refused it. |
AgentPlanAllowance
The plan's compute against the owner's free monthly allowance. Lucen cloud CPU work draws on the allowance. Lucen cloud GPU work has no allowance. Work on the owner's own machine is free.
| Field | Type | Description |
|---|---|---|
free_usd | number | What is left this month of the free allowance for Lucen cloud CPU work. |
covered_usd | number | The part of the plan's |
beyond_usd | number | The rest of |
gpu_hours | number | The most Lucen cloud GPU hours the plan can use, the sum of its GPU rounds' time limits. |
needs_confirmation | boolean | True while the plan is proposed and |
sentence | string | One sentence for the approval card. |
AgentDigestLine
| Field | Type | Description |
|---|---|---|
kind | AgentDigestLineKind | |
state | AgentItemState | |
text | string | One sentence, hub-generated; the agent's words appear only inside quotes. |
short | string | null | The same line for a phone, at most 90 characters. It keeps the same facts and drops the identifiers, the quotes and the subordinate clauses. See "The digest's short form" in the API guide. For example, "R4 finished 11:06 — 1,600 it in 29 min, $1.60." The hub generates it, like |
at | string (date-time) | null (date-time) | |
links | AgentLinks | null |
AgentObjectGroupItems
| Field | Type | Description |
|---|---|---|
group | AgentObjectGroup | |
items | array of AgentObject |
TaskKind
session: the agent trains and tests policies (an agent session). robot_plan: the agent works on one of your connected robots (a plan). A person approves each time a policy runs on it.
TaskStage
Where a task is, derived on read. planning: the agent is working out what to do. awaiting_approval: a plan or a spend waits for a person. training: a training run is queued or running. testing_in_sim: a sim test is queued or running. ready_for_review: results are in for a person to read. Examples are passing checkpoints, a shortlist to pick, or the agent's answer. deploy_pending_approval: a request to run a policy on a robot waits for a person. deployed: a person approved it, and the robot runs it or ran it. failed: the task stopped on an error. stopped: a person stopped it.
TaskStageReached
A stage the task has reached, and when it first did.
| Field | Type | Description |
|---|---|---|
stage | TaskStage | |
at | string (date-time) |
TaskDevice
| Field | Type | Description |
|---|---|---|
id | string | null | |
name | string |
TaskRun
A training run the task started.
TaskEvidence
One sim test the task produced, newest first.
| Field | Type | Description |
|---|---|---|
rollout_id | Id | |
run_id | string | null | The training run whose policy it tests, when there is one. |
model | string |
|
checkpoint_step | integer | null | The checkpoint tested; null for the policy itself. |
purpose | string |
|
status | JobStatus | |
gates_passed | integer | null | |
gates_total | integer | null | |
verdict | string | null |
|
has_video | boolean | True when the sim test recorded video. |
created_at | string (date-time) | |
finished_at | string (date-time) | null (date-time) |
TaskDeployRequest
A request the task made to run a policy on a robot, and what came of it.
| Field | Type | Description |
|---|---|---|
request_id | Id | |
status | string |
|
device_id | string | null | |
device_name | string | |
model | string |
|
approval_id | string | null | |
approval_status | string | null | Once approved: |
created_at | string (date-time) | |
started_at | string (date-time) | null (date-time) |
AgentGpuRun
AgentSandboxState
none: never started.running: a Modal Sandbox is up and billed.snapshotted: idle. Its filesystem is snapshotted and the container stopped. It is not billed, and the next shell call restores it.terminated: ended with the session.unavailable: the deployment configures no sandbox (AGENT_SANDBOX_APP), so the agent has no shell.
AgentPlanRoundStatus
planned: not started. It starts at approval, or later by key when it is contingent or resumes from another plan round.created: its round (with a campaign) or run (without) exists:round_n,run_id.refused: the hub refused to create it.notecarries why. The plan's approval failed with it.not_needed: a contingent round the agent skipped, with its reason quoted innote.
AgentDigestLineKind
AgentItemState
How a digest line or an object row reads. Each state has a word, a shape and a colour: needs_you (◆), running (■), done (●), failed (✕), skipped (○).
AgentObjectGroup
AgentObject
| Field | Type | Description |
|---|---|---|
kind | AgentObjectKind | |
id | string | The object's id (a checkpoint's is |
group | AgentObjectGroup | |
name | string | E.g. "R4 c4r4_side_ff", "step_1600", "Render video". |
line | string | One line of facts, e.g. "9 / 13 · vx+0.30 93 % · video ready". |
state | AgentItemState | |
word | string | null | The state as a word for the row ( |
since | string (date-time) | null (date-time) | |
links | AgentLinks | null |
AgentObjectKind
What a row is. approval: a spend an older session held the old way (an AgentApproval with no decision card). It is listed under Needs you while it is pending. Its id is the approval's, and it is answered through resolveAgentApproval.