rl client from Client setup.
Before you begin
- 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. Two calls list what is in use, so you can build filters without knowing the values in advance. Then filter listSessions with them.
- Console
- TypeScript
- 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.
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.- When
truncatedistrue, there are more matches than returned. Narrowq; there is no page token.
listSessions, each metadata=key:value must match, and each metadata_key must be present. Subagent sessions inherit their root’s match, so add root_only=true to get one row per run. 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. To have the agent read them now instead of at the end of the turn, interrupt the session.
- Console
- TypeScript
- 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.
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
- TypeScript
- cURL
Open the session and click the Compute tab.
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). A bucket with complete: false is still filling and changes on the next read. Keep polling while live is true. 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, what it cost, and how it was graded. It reads the whole tree. It is read-only: it has no sandbox and no credentials, and nothing it does changes the session.- Console
- TypeScript
- cURL
- Open the session and click Ask in the header.
- Type a question in Ask about this session…, or pick a suggested one.
Read the analyst’s answers from its session’s events or event stream, using the returned
session_id. Ask follow-ups with sendSessionEvents on that id. 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. 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.
- Console
- TypeScript
- 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. 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. See Teams.
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. See Multi-agent sessions for how trees form.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. It accepts hydrate, image_urls, and payloads, like List events. Any session id in the tree works.
- Console
- TypeScript
- cURL
Open the session and click the Threads tab. The tab appears when the session has more than one thread.
- The tree’s
eventsis only the first page. Whennext_event_idis set, continue withlistSessionEventsandafter_event_idset to it. 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
roleisprimary(the root),subagent, orgrader. Threadstatusisrunning,idle, orterminated. getSessionThreadreturns404for a thread outside the tree.
Attach and detach files
listSessionResources lists the files attached to a session, each with its mount_path in the sandbox once it’s in place. addSessionResources attaches more while the session runs, getSessionResource reads one attachment, and deleteSessionResource detaches one. 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.
- Console
- TypeScript
- cURL
Open the session and choose the Files tab in the side panel. Click Attach files to add files, or detach one from its row.
What can go wrong
Every error uses the same body:
code, message, and details with field, requestId, and retryable. See Errors.
Limits
- Metadata keys: up to 200 per response. Metadata values: up to 200 per response.
- Resource samples: up to 720 buckets per page.
- 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.