curl https://api.playgent.com/v1/agents/agent_abc123/stats \
-H "Authorization: Bearer your-api-key"
{
"agent_id": "agent_abc123",
"total_runs": 156,
"total_turns": 423,
"pass_rate": 0.847,
"avg_latency_ms": 2340,
"avg_token_usage": {
"input": 450,
"output": 320
},
"scorer_breakdown": {
"relevance": { "avg": 0.89, "min": 0.45, "max": 1.0 },
"faithfulness": { "avg": 0.92, "min": 0.71, "max": 1.0 }
},
"trend_7d": {
"pass_rate_delta": 0.05,
"latency_delta_ms": -120
},
"top_failure_reasons": [
{ "reason": "Hallucination detected", "count": 12 },
{ "reason": "Off-topic response", "count": 8 }
]
}
Agents
Get Agent Stats
Get comprehensive performance statistics for an agent
GET
/
v1
/
agents
/
{agent_id}
/
stats
curl https://api.playgent.com/v1/agents/agent_abc123/stats \
-H "Authorization: Bearer your-api-key"
{
"agent_id": "agent_abc123",
"total_runs": 156,
"total_turns": 423,
"pass_rate": 0.847,
"avg_latency_ms": 2340,
"avg_token_usage": {
"input": 450,
"output": 320
},
"scorer_breakdown": {
"relevance": { "avg": 0.89, "min": 0.45, "max": 1.0 },
"faithfulness": { "avg": 0.92, "min": 0.71, "max": 1.0 }
},
"trend_7d": {
"pass_rate_delta": 0.05,
"latency_delta_ms": -120
},
"top_failure_reasons": [
{ "reason": "Hallucination detected", "count": 12 },
{ "reason": "Off-topic response", "count": 8 }
]
}
Retrieve detailed performance metrics, pass rates, and failure analysis for an agent.
string
required
Unique identifier for the agent
string
required
Agent identifier
integer
required
Total number of test runs
integer
required
Total number of turns across all runs
number
required
Overall pass rate (0-1)
integer
required
Average response latency in milliseconds
object
required
object
required
object
required
array
required
Most common failure reasons
curl https://api.playgent.com/v1/agents/agent_abc123/stats \
-H "Authorization: Bearer your-api-key"
{
"agent_id": "agent_abc123",
"total_runs": 156,
"total_turns": 423,
"pass_rate": 0.847,
"avg_latency_ms": 2340,
"avg_token_usage": {
"input": 450,
"output": 320
},
"scorer_breakdown": {
"relevance": { "avg": 0.89, "min": 0.45, "max": 1.0 },
"faithfulness": { "avg": 0.92, "min": 0.71, "max": 1.0 }
},
"trend_7d": {
"pass_rate_delta": 0.05,
"latency_delta_ms": -120
},
"top_failure_reasons": [
{ "reason": "Hallucination detected", "count": 12 },
{ "reason": "Off-topic response", "count": 8 }
]
}

