Logs
Browse individual chat sessions, inspect every thread, and debug errors from the Logs view.
Overview
The Logs page in the dashboard shows every chat session for the selected agent. Each session contains one or more threads, and you can drill down into any thread to see the full message history, token usage, cost, and duration.
Active streams are highlighted with a real-time indicator, and the view auto-refreshes while threads are streaming.
Session Table
The main view lists all chat sessions for the selected agent.
| Column | Description |
|---|---|
| Created | When the chat session started |
| Status | Active (green) or Error (red) badge based on thread outcomes |
| Sandbox ID | Sandbox identifier - click to copy |
| Threads | Number of threads in the session |
Filtering & Search
The toolbar above the table provides three ways to narrow your view.
Status Filter
Filter by All, Active, or Error to quickly find conversations that need attention.
Date Range
Presets: Last hour, Last 24 hours, Last 7 days, Last 30 days. Or pick a custom date range with the calendar.
Search
Search by Sandbox ID to find a specific conversation. The search is debounced for performance.
Chat Details
Click any row to open a detail sidebar showing the full chat breakdown.
| Field | Description |
|---|---|
| Sandbox ID | Full sandbox ID (copyable) |
| Agent | Name of the agent that handled the session |
| Created | Session start timestamp |
| Total tokens | Sum of input + output tokens across all threads |
| Total cost | Aggregate USD cost for the session |
| Total duration | Combined execution time for all threads |
Below the summary is a thread table listing every thread with its status, token count, cost, and duration. Click a thread to drill down.
Thread View
The thread detail view shows per-thread metrics and the full conversation replay.
Input tokens
Tokens sent to the model
Output tokens
Tokens generated by the model
Cost
USD cost for this turn
Duration
Execution time in milliseconds
If a thread failed, an error message is displayed in a highlighted block. Below the metrics, you can replay the full conversation including rendered tool calls.
Traces
Every thread records a full execution trace — a tree of spans that shows exactly what the agent did, step by step. Open any thread and switch to the Trace or Timeline tab in the bottom panel.
Trace view
A hierarchical tree of spans. Click any span to see its input, output, duration, token usage, and error details. Spans are color-coded by kind.
Timeline view
A Gantt-chart-style view showing how spans overlap in time. Useful for spotting slow tool calls, parallel execution, and overall latency breakdown.
Copy as JSON
Both the trace and the chat view have a Copy as JSON button. This exports the full thread data — messages, spans, errors, token counts — as a single JSON object you can paste into a bug report or feed back to an AI assistant to debug faster.
| Copy target | Includes |
|---|---|
| Chat JSON | Thread ID, status, duration, cost, token counts, error, and the full message array with roles and parts |
| Trace JSON | Thread ID and the complete span tree — each span with its ID, parent, name, kind, status, duration, error, input, output, and attributes |
| Single span | One span's full JSON — useful when you need to share a specific tool call or error with your team |
Tip: paste the JSON into Claude or another AI assistant along with your agent code to quickly identify and fix errors.
Live Monitoring
When any thread is actively streaming, the toolbar shows a pulsing blue Live indicator. The selected sandbox auto-refreshes every 2 seconds while streams are active.
| Status | Indicator | Description |
|---|---|---|
Streaming | Blue pulse | Thread is actively generating a response |
Completed | Green dot | Thread finished successfully |
Error | Red dot | Thread failed with an error |
Cancelled | Gray dot | Thread was stopped by the user |
CLI
You can also browse logs directly from the terminal with @21st-sdk/cli logs.
# List recent chats
npx @21st-sdk/cli logs my-agent
# Inspect a specific chat
npx @21st-sdk/cli logs my-agent <chat-id>
# Inspect a specific thread inside a chat
npx @21st-sdk/cli logs my-agent <chat-id> <thread-id>
# Machine-readable output
npx @21st-sdk/cli logs my-agent --jsonThe command supports the same filters available in the dashboard.
| Flag | Description |
|---|---|
--status active|error | Filter by chat status |
--search TEXT | Search by chat ID or sandbox ID |
--since ISO | Show chats after this timestamp |
--until ISO | Show chats before this timestamp |
--limit N | Page size (1–100) |
--json | Output as JSON for scripting |
See the CLI reference for the full list of commands.