The organization user role can use every read on this page. Opening or questioning the session analyst needs the organization developer or admin role, because it starts a session. The billing role cannot see sessions. See Organizations and roles. For API calls, create a key under API keys; see API keys.
Find sessions by metadata
Metadata is the set of key/value pairs you attach when you start a session, such ascustomer_id or run. List the keys and values in use, so you can build filters without knowing the values in advance. Then filter listSessions with them.
- Console
- cURL
- In the sidebar, click Sessions.
- Click the Metadata filter and choose a key from the suggestions.
- Type a value, or press Enter to match any value for that key. To combine filters, pick another key in the same field, which then reads Add another.
truncated is true, there are more matches than returned. Narrow q; there is no page token. Subagent sessions inherit their root’s match, so add root_only=true to get one row per run.
Metadata keys, values, and filters
Metadata keys, values, and filters
listSessionMetadataKeysreturns{ keys, truncated }: every key in use in your organization, sorted, up to 200.listSessionMetadataValuesreturns{ values, truncated }for onekey.qis a case-sensitive prefix of up to 512 characters.limitdefaults to 50 and can be at most 200. An unknown key returns an empty list, not an error.- In
listSessions, eachmetadata=key:valuemust match, and eachmetadata_keymust be present. See List sessions for the other filters.
See queued messages
A message sent while the agent is mid-turn is queued until the turn ends.listSessionPendingInputs shows those accepted messages that are not in the transcript yet, in the order they were accepted. Nothing needs answering: these are messages you or a teammate already sent.
- Console
- cURL
Open the session. Queued messages appear under the last event, marked Queued. Click Interrupt to read now to have the agent read them immediately.
kind is message or interrupt. When the agent reads a queued message, it moves into the transcript with its input_id as the event_id, so you can match the two. To have the agent read them now instead of at the end of the turn, interrupt the session.
Check compute usage
listSessionResourceSamples returns CPU, memory, disk, and GPU usage of the sandboxes in a session tree, in one-minute buckets. Use it to right-size an environment or to see why a run was slow. Any session id in the tree works.
- Console
- cURL
Open the session and click the Compute tab.
live is true. A bucket with complete: false is still filling and changes on the next read.
Parameters and metrics
Parameters and metrics
Buckets and sandboxes
Buckets and sandboxes
Buckets are ordered by sandbox, then time. Each names its
sandbox_id; sandboxes lists every sandbox the tree has had, oldest first, with attached_at, detached_at, and detach_reason (released, closed, replaced, or lost). An empty sandboxes list means the tree never had a sandbox or sampling is off.Ask the session analyst
The session analyst is an assistant that answers questions about a session tree: what the agents were asked to do, what they did, which tools failed, how they coordinated, and what it cost. It reads the whole tree. It is read-only: it has no sandbox and no credentials, and nothing it does changes the session.- Console
- cURL
- Open the session and click Ask in the header.
- Type a question in Ask about this session…, or pick a suggested one.
session_id. Ask follow-ups with sendSessionEvents on that id.
What each analyst request does
What each analyst request does
Each person has one analyst conversation per tree, and any session id in the tree opens the same one. Analyst sessions are left out of
listSessions unless you filter with kind=session_analyst.The analyst runs on a fixed model, and its model usage is recorded for your organization like any other session’s. Each question adds usage, so reuse a conversation rather than resetting it for every question. See Usage and cost.
Read the team board
When a session works as a team, agents coordinate through a shared board of tasks and posts.getSessionBoard returns its current state: tasks, posts, members, and as_of.
- Console
- cURL
Open the session and click the Work tab.
board_update events can be missed by a reader following events by cursor, so read the board when you need the current picture. See Teams.
Board tasks and team modes
Board tasks and team modes
Each task has a
seq shown as T1, T2, and so on, a kind (task, explore, or review), a status (open, claimed, blocked, done, or dropped), and an owner_session_id once claimed.A session started with team mode off has no board and returns 404. Under auto or on, a board with nothing posted yet comes back empty.Read the session tree and threads
A session that delegates work becomes a tree: the root session and the subagent sessions it starts. Each agent’s work runs in a thread.getSessionTree returns the whole tree in one call: root_session_id, every session in sessions, every thread in threads, and the first page of the combined timeline in events. Any session id in the tree works. See Multi-agent sessions for how trees form.
- Console
- cURL
Open the session and click the Threads tab. The tab appears when the session has more than one thread.
events is only the first page. When next_event_id is set, continue with listSessionEvents and after_event_id set to it.
Tree and thread details
Tree and thread details
getSessionTreeacceptshydrate,image_urls, andpayloads, like List events.listSessionThreadsreturns every thread, sorted bythread_path, including one for each session in the tree. A subagent’sthread_idis its session id.thread_pathis the chain of session ids below the root, such as/<child>/<grandchild>; the root’s is/.- Thread
roleisprimaryfor the root andsubagentfor a delegated session. Threadstatusisrunning,idle, orterminated. getSessionThreadreturns404for a thread outside the tree.
Attach and detach files
Open the session and choose the Files tab in the side panel. Under Inputs, click Attach files… to add files, or click the × on a row to detach it. Attach to the root session of a multi-agent tree; everyone in the tree shares its sandbox. See Attach and detach files while a session runs.What can go wrong
The most common problems:- A metadata filter returns subagent sessions. Subagents match their root’s metadata. Add
root_only=true. 403 forbiddenopening the analyst. Your role can read but not start sessions. Use an account or key with the developer or admin role. See Organizations and roles.404 not_foundreading the board. The session runs with team modeoff. Use the tree and events instead.
Every session operations error
Every session operations error
Every error is a flat object with required
code and message fields and optional details, which can include field, requestId, and retryable. See Errors.Limits
- Metadata keys: up to 200 per response. Metadata values: up to 200 per response.
- Session analyst: one conversation per person per session tree.
Next steps
Sessions
Start sessions, check success, and stop them.
Events
Read and stream the transcript.
Teams
Let copies of an agent share work through the board.
Usage and cost
See what each session cost.