Traces

Where a call's time and cost actually went.

A trace is every step behind one piece of work (the model calls, the tool calls, the retries) with its timings, tokens and cost. Each names the call, agent, campaign or eval run it belongs to, so it joins to the rest of this API rather than sitting in its own world.

Which vendor and which model served each step are not reported. Those change (that is the point of running several) and a dashboard grouped by a model name would break the day one moved. What is reported is the work: how long it took, what it consumed, and whether it failed. A model call's span is named for the operation (chat, stt), and an upstream error whose text names a vendor is reported as a neutral message.

Span payloads (prompts, model output, tool arguments) are not served here. They are the most sensitive thing we hold, since a prompt carries whatever the call was about, and they stay behind the signed-in surface where the reader is identifiable.

List traces#

Traces in the organization, newest first. A default time window applies when none is given. An unbounded scan of everything ever produced is not a query to run by accident.

GET/api/v1/traces

Query parameters

fromstring
ISO date lower bound.
tostring
ISO date upper bound.
callIdstring
Traces for one call.
campaignIdstring
Traces for one campaign.
agentIdstring
Traces for one agent.
evalRunIdstring
Traces for one eval run.
sourcestring
The kind of work: voice, analysis, data_collection, objective, campaign_analysis, call_center_analysis, help_desk, eval, report, agent_compose or other. Comma-separate for several. Any other value is refused.
statusstring
ok or error.
hasErrorstring
`1` for failures only.
minDurationMsnumber
Slow work only.
qstring
Free text over the trace name.
sortstring
startedAt, durationMs, costUsd, totalTokens or errorCount. Prefix with - for descending.
Default-startedAt
pagenumber
Page number.
Default1
pageSizenumber
Up to 200.
Default50

Responses

A page of traces.

curl -X GET "https://voice.evryhealth.com/api/v1/traces" \
-H "Authorization: Bearer YOUR_API_KEY"
Response200
{
"data": {
"traces": [
{
"id": "7a40…",
"name": "call.analysis",
"source": "analysis",
"status": "ok",
"durationMs": 4182,
"links": {
"callId": "5f1c…",
"campaignId": "a1…",
"agentId": "44b1…",
"callCenterId": null,
"evalRunId": null
},
"counts": {
"spans": 14,
"llmCalls": 9,
"toolCalls": 2,
"errors": 0
},
"usage": {
"inputTokens": 18422,
"outputTokens": 2201,
"totalTokens": 20623,
"costUsd": 0.0412
},
"tags": []
}
],
"total": 318
},
"meta": {
"requestId": "req_…",
"pagination": {
"nextCursor": "2",
"limit": 50
}
}
}

Get a trace#

One trace and every span under it, in order: the waterfall for one piece of work.

GET/api/v1/traces/{traceId}

Path parameters

traceIdstringrequired
Trace id.

Responses

The trace and its spans.

curl -X GET "https://voice.evryhealth.com/api/v1/traces/{traceId}" \
-H "Authorization: Bearer YOUR_API_KEY"
Response200
{
"data": {
"trace": {
"id": "7a40…",
"name": "call.analysis",
"status": "ok",
"durationMs": 4182
},
"spans": [
{
"id": "b112…",
"parentSpanId": null,
"depth": 0,
"kind": "llm",
"name": "sentiment",
"status": "ok",
"durationMs": 812,
"timeToFirstTokenMs": 240,
"toolName": null,
"usage": {
"inputTokens": 2201,
"outputTokens": 180,
"totalTokens": 2381,
"costUsd": 0.0041
}
}
]
},
"meta": {
"requestId": "req_…"
}
}