How it works
There are two ways to monitor agent performance through the Agent Platform:- Agent Platform SDK (Real-time monitoring): Subscribe to live updates as your agent runs. With our SDK, you can track event changes as they happen, status updates, and more. You do not need a trajectory ID — the SDK handles this internally.
- Agent Platform API (Post-run and real-time analysis): Use the trajectory endpoints to view your agent’s performance after it finishes running. You can retrieve a complete log of events, including thoughts, actions, answers, and screenshots associated with a specific trajectory ID. Use the
GET /api/v1/trajectories/{id}/changesendpoint to retrieve new events.
View an event via SDK
The Agent Platform allows you to listen to events, check for status updates, and more. The following snippets show you how to monitor events using our Agent Platform SDK:Step 1: Start the task
Userun() (or runStepByStep()) to run your task. For example:
Step 2: Listen to events
Execute one of the following commands to view and/or monitor agent performance through events:Step 2a: Monitor real-time updates (Optional)
Step 2b: Track status changes (Optional)
Step 2c: Handle errors (Optional)
Note: You do not get a trajectory ID from the SDK task. The SDK internally manages trajectories and provides these event methods for monitoring.
View an event via API
A trajectory is the recorded sequence of actions taken by the agent during a task, including detailed event data. You can monitor and analyze an agent’s activity by retrieving a trajectory through the Agent Platform’s APIs. Each trajectory contains a list of time-stamped events that describe every action the agent performed during a task.Step 1: Identify the trajectory ID
When creating a trajectory via the API (not the SDK), the API response will include atrajectory_id. This is the ID you can use to fetch event data.
Step 2: Retrieve the trajectory
Use the trajectory ID to make an API request and fetch the full execution data for the task:Step 3: View the events
Theevents array in the trajectory API response contains the full event log for the task — showing what the agent thought, did, and ultimately answered.
Event properties
The following table defines key event properties.| Property | Type | Description |
|---|---|---|
type | string | High-level event category, e.g., "ChatMessageEvent", "AgentStartedEvent". |
timestamp | string (ISO 8601) | When the event occurred (UTC). |
data | object | Event-specific details, e.g., message content, screenshot URL, action info. |
data.type | string | More specific sub-type of the event, e.g., "answer", "thought", "screenshot", "action", "highlevel", "thinker", "navigator", "web_action", "notes". |
data.content | string | Actual message, screenshot URL, user action description, etc. |
data.sender_id | string | Who produced the message ("agent", "user", etc.). |
data.extra_content | object | Optional additional structured data. |
Event types
The following table defines key event types. The list of available event types may expand over time.| Property | Type | Description |
|---|---|---|
ChatMessageEvent | string | Triggered when a message is sent or received in a conversation. Contains data.type, data.content, data.sender_id, and data.extra_content. |
AgentStartedEvent | string | Indicates an agent has begun execution. data may contain additional info. |
AgentCompletionEvent | string | Signals that an agent has finished its task or produced a final response. Includes data.reason ("completed", "timed_out", "error", or string). |
WebActionEvent | string | Describes web actions with pre- and post-action screenshots. Contains a nested data.action object with action_type (e.g., "goto", "click", "write", "press", "scroll", "select", "hover", "wait"), and optional tab, url, element, text, key, direction, or value. |
.png)
