Traces and model prices
If your product runs AI agents, Traces shows every run: what it did step by step, whether it finished, how long it took, what it cost, and what the person did around it.
Updated
What a trace is
A run is one job your agent did, end to end, such as “summarize this ticket”. It is made of steps: each model call and each tool call. ClickClacks stores token counts, not prompts. An output preview is optional, and you decide per step whether to send one.
Send your runs
Runs arrive as two special events, sent from your server with the server API and a server source’s key:
- one
$agent_stepfor each completed step - one
$agent_runat the end, summing up the run
Use the real user ID (and session ID, if you have it) so each run joins the person’s other activity.
{
"items": [
{
"event": "$agent_run",
"distinct_id": "user_8412",
"properties": {
"trace_id": "trc_7f3a91c2d4",
"run_name": "Summarize ticket",
"agent_name": "support-bot",
"source": "helpdesk",
"outcome": "succeeded",
"failure_reason": null,
"started_at": "2026-09-25T14:03:11.402Z",
"duration_ms": 8120,
"step_count": 3,
"tokens_in": 5210,
"tokens_out": 830
}
}
]
}$agent_run properties
| Property | Rule |
|---|---|
trace_id | trc_ followed by 8–60 letters, numbers, _ or -. The same on the run and its steps. |
run_name, agent_name, source | Text, up to 128 characters. Source is your own label, such as “support-bot”. |
outcome | succeeded, failed or cancelled. failure_reason is text or null. |
started_at | ISO 8601 with an offset. |
duration_ms, step_count, tokens_in, tokens_out | Whole numbers. Up to 200 steps. |
$agent_step properties
| Property | Rule |
|---|---|
trace_id, step_id, step_index, parent_step_id | step_id is stp_ followed by 1–60 characters. parent_step_id is null at the top level. |
type, name | model or tool, plus a name. |
started_offset_ms, duration_ms | When the step started, relative to the run, and how long it took. |
is_error, is_timeout, preview_enabled | True or false. preview is optional text, kept only when preview_enabled is true. |
model, tokens_in, tokens_out, finish_reason | Model steps only. The model name is what Model prices match. |
Only the properties listed here are accepted on these two events. Until a run arrives, the Traces page shows No agent runs yet with a sample request and a Check for runs button.
Reading Traces
Open Traces under Data. Pick a date range. The page then shows:
- Runs, Finished cleanly, Typical run duration (with the 95th percentile, in wall-clock time) and Cost.
- Runs by outcome over time.
- A table of runs with their steps, duration and cost.
Narrow the table by searching run or agent names, by trace source, by person, or by outcome (Succeeded, Failed, Cancelled). These narrow the table only: the date range drives the cards and chart too. Export downloads the filtered runs as a CSV, with tokens.
One run
Click a run to see its Steps as a timeline, the output preview if you sent one, what the person did around the run, and who they are.
Model prices
ClickClacks doesn’t guess what a model costs. Runs without a price show a dash, and the page links to Set model prices.
- Open Settings › Model prices. Any member can edit it.
- Enter the Model name exactly as your steps send it, such as
openai/gpt-5-mini. - Enter Input $ per 1M and Output $ per 1M tokens, as your provider lists them.
- Click Save model price.
Run costs use these prices from then on.
Tips and gotchas
- Model names must match exactly.
gpt-5-miniandopenai/gpt-5-miniare different models to the price list. - Send the run event last. It carries the outcome and totals.
- Previews are capped at 400 characters, and a run’s page shows the first 180.
Recipes
Which agent fails most, and why?
- Set the dates to Last 7 days and the outcome filter to Failed.
- Search by agent name, and open a few runs to read the failing step.
What do our agents cost per week?
- Add a price for every model you use in Settings › Model prices.
- Set the dates to Last 30 days and read the Cost card.
- Click Export for per-run costs to break down in a spreadsheet.