Get Agent Metrics
const url = 'https://api.ultimateteam.ai/api/v1/accountability/metrics/example?period_days=30';const options = {method: 'GET', headers: {'X-API-Key': '<X-API-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.ultimateteam.ai/api/v1/accountability/metrics/example?period_days=30' \ --header 'X-API-Key: <X-API-Key>'Get performance metrics for a single agent.
Validates the agent role against the canonical C-suite list and returns computed metrics for the given period. Best-effort syncs results to Firestore for real-time dashboard display.
Args: agent_role: The agent role to query (e.g. ‘ceo’). period_days: Number of days to look back. user: The authenticated user context. svc: The agent metrics service (injected).
Returns: Performance metrics for the specified agent.
Raises: HTTPException: 404 if agent_role is not a valid C-suite role.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”Number of days to look back
Number of days to look back
Responses
Section titled “ Responses ”Successful Response
Performance metrics for a single agent over a time period.
Attributes: agent_role: The agent role these metrics describe. total_tasks: Total tasks assigned in the period. completed_tasks: Tasks completed successfully. failed_tasks: Tasks that failed. success_rate: Ratio of completed to total (0.0-1.0). avg_completion_time_ms: Average task completion time in ms. escalation_count: Number of escalations (input-required). quality_gate_pass_rate: Ratio of quality gate passes (0.0-1.0). period_start: Start of the measurement period. period_end: End of the measurement period.
object
Examplegenerated
{ "agent_role": "example", "avg_completion_time_ms": 1, "completed_tasks": 1, "escalation_count": 1, "failed_tasks": 1, "period_end": "2026-04-15T12:00:00Z", "period_start": "2026-04-15T12:00:00Z", "quality_gate_pass_rate": 1, "success_rate": 1, "total_tasks": 1}Validation Error
object
object
object
Examplegenerated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}