curl https://api.playgent.com/v1/traces/trace_ghi789 \
-H "Authorization: Bearer your-api-key"
{
"trace_id": "trace_ghi789",
"agent_id": "agent_abc123",
"run_id": "run_def456",
"status": "completed",
"duration_ms": 4560,
"total_cost_usd": 0.0234,
"spans": [
{
"span_id": "span_jkl012",
"name": "agent_execution",
"kind": "agent",
"duration_ms": 4560,
"children": [
{
"span_id": "span_mno345",
"name": "gpt-4-turbo call",
"kind": "llm",
"model": "gpt-4-turbo",
"tokens": { "input": 234, "output": 156 },
"cost_usd": 0.0089,
"duration_ms": 1234
},
{
"span_id": "span_pqr678",
"name": "search_knowledge_base",
"kind": "tool",
"duration_ms": 456,
"children": [
{
"span_id": "span_stu901",
"name": "embedding generation",
"kind": "llm",
"model": "text-embedding-3-small",
"duration_ms": 89
}
]
}
]
}
]
}
Tracing
Get Trace
Get full trace with all spans as a tree structure
GET
/
v1
/
traces
/
{trace_id}
curl https://api.playgent.com/v1/traces/trace_ghi789 \
-H "Authorization: Bearer your-api-key"
{
"trace_id": "trace_ghi789",
"agent_id": "agent_abc123",
"run_id": "run_def456",
"status": "completed",
"duration_ms": 4560,
"total_cost_usd": 0.0234,
"spans": [
{
"span_id": "span_jkl012",
"name": "agent_execution",
"kind": "agent",
"duration_ms": 4560,
"children": [
{
"span_id": "span_mno345",
"name": "gpt-4-turbo call",
"kind": "llm",
"model": "gpt-4-turbo",
"tokens": { "input": 234, "output": 156 },
"cost_usd": 0.0089,
"duration_ms": 1234
},
{
"span_id": "span_pqr678",
"name": "search_knowledge_base",
"kind": "tool",
"duration_ms": 456,
"children": [
{
"span_id": "span_stu901",
"name": "embedding generation",
"kind": "llm",
"model": "text-embedding-3-small",
"duration_ms": 89
}
]
}
]
}
]
}
Retrieve the complete trace with all spans organized in a hierarchical tree structure.
string
required
Trace identifier
string
required
Trace identifier
string
required
Associated agent ID
string
Linked test run ID (if any)
string
required
Trace status:
running, completed, errorinteger
required
Total trace duration in milliseconds
number
required
Total cost across all spans
array
required
curl https://api.playgent.com/v1/traces/trace_ghi789 \
-H "Authorization: Bearer your-api-key"
{
"trace_id": "trace_ghi789",
"agent_id": "agent_abc123",
"run_id": "run_def456",
"status": "completed",
"duration_ms": 4560,
"total_cost_usd": 0.0234,
"spans": [
{
"span_id": "span_jkl012",
"name": "agent_execution",
"kind": "agent",
"duration_ms": 4560,
"children": [
{
"span_id": "span_mno345",
"name": "gpt-4-turbo call",
"kind": "llm",
"model": "gpt-4-turbo",
"tokens": { "input": 234, "output": 156 },
"cost_usd": 0.0089,
"duration_ms": 1234
},
{
"span_id": "span_pqr678",
"name": "search_knowledge_base",
"kind": "tool",
"duration_ms": 456,
"children": [
{
"span_id": "span_stu901",
"name": "embedding generation",
"kind": "llm",
"model": "text-embedding-3-small",
"duration_ms": 89
}
]
}
]
}
]
}
⌘I

