Overview
Break an agent run down into cost and latency per step, model and tool from token counts and the prices you supply. Takes the steps of one agent run (model, input, cached and output tokens, latency, tool) and the price list in USD per million tokens supplied by the caller (no stale built-in prices) and returns cost per step, totals, cost and time share per model and tool, the five most expensive and slowest steps, and steps whose model has no price.
Protocol
x402 (POST)
Price
$0.0020
Payment Asset
USD Coin
Payment Network
eip155:8453
Category
uncategorized
Provider
denk
Indexed
2026-11-24 12:33:13
Health
Status
unknown
Latency (p50)
—
Uptime (30d)
—
Reliability Score
—
Last Checked
Never
Last Healthy
Never
Consecutive Failures
0
Input Schema
{
"body": {
"prices": {
"model-a": {
"cached_input": 0.3,
"input": 3,
"output": 15
}
},
"steps": [
{
"input_tokens": 12000,
"latency_ms": 2100,
"model": "model-a",
"name": "plan",
"output_tokens": 800
},
{
"cached_input_tokens": 10000,
"extra_cost_usd": 0.003,
"input_tokens": 30000,
"latency_ms": 4300,
"model": "model-a",
"name": "search",
"output_tokens": 500,
"tool": "web_search"
}
]
},
"bodyType": "json",
"method": "POST",
"type": "http"
}
Output Schema
{
"example": {
"result": {
"by_model": [
{
"cost_usd": 0.1215,
"key": "model-a",
"latency_ms": 6400,
"steps": 2
}
],
"by_tool": [
{
"cost_usd": 0.0735,
"key": "web_search",
"latency_ms": 4300,
"steps": 1
},
{
"cost_usd": 0.048,
"key": "(none)",
"latency_ms": 2100,
"steps": 1
}
],
"models_without_price": [],
"most_expensive": [
1,
0
],
"slowest": [
1,
0
],
"steps": [
{
"cost_usd": 0.048,
"index": 0,
"latency_ms": 2100,
"model": "model-a",
"name": "plan",
"tool": null
},
{
"cost_usd": 0.0735,
"index": 1,
"latency_ms": 4300,
"model": "model-a",
"name": "search",
"tool": "web_search"
}
],
"total_cost_usd": 0.1215,
"total_latency_ms": 6400
},
"service": "trace-cost-breakdown",
"status": "success"
},
"type": "json"
}