Metrics
Get Agentos Metrics
Metrics storage and access
Use a registered metrics-capable database. Specify db_id when multiple database IDs are available; selecting table requires db_id. Configured authorization uses metrics:read for reads and metrics:write for refresh.
The effective user_id is fixed for scoped callers: JWT user isolation is opt-in, while non-admin service-account PAT callers self-scope. An unscoped caller can select a user. Current RemoteDb GET/refresh forwarding does not pass an explicit user filter; do not assume a local admin filter is forwarded to another AgentOS. Downstream credential-based scoping is separate.
The response is {metrics, updated_at}. Metrics aggregate persisted sessions and runs in the selected database; this endpoint does not analyze arbitrary external activity logs. Reading metrics does not guarantee that a recent run has already been aggregated.
/metricsRetrieve AgentOS metrics and analytics data for a specified date range. If no date range is specified, returns all available metrics.
Authorization
HTTPBearer In: header
Query Parameters
Starting date for metrics range (YYYY-MM-DD format)
Ending date for metrics range (YYYY-MM-DD format)
Return only this user's metrics. Ignored for non-admin callers
Database ID to query metrics from
The database table to use
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl --request GET 'https://example.com/metrics'{ "metrics": [ { "id": "2025-07-31_daily", "agent_runs_count": 5, "agent_sessions_count": 5, "team_runs_count": 0, "team_sessions_count": 0, "workflow_runs_count": 0, "workflow_sessions_count": 0, "users_count": 1, "token_metrics": { "input_tokens": 448, "output_tokens": 148, "total_tokens": 596, "audio_tokens": 0, "input_audio_tokens": 0, "output_audio_tokens": 0, "cached_tokens": 0, "cache_write_tokens": 0, "reasoning_tokens": 0 }, "model_metrics": [ { "model_id": "gpt-4o", "model_provider": "OpenAI", "count": 5 } ], "date": "2025-07-31T00:00:00Z", "created_at": "2025-07-31T12:38:52Z", "updated_at": "2025-07-31T12:49:01Z" } ]}{ "detail": "string", "error_id": "string", "error_type": "string"}{ "detail": "string", "error_id": "string", "error_type": "string"}{ "detail": "string", "error_id": "string", "error_type": "string"}{ "detail": "string"}{ "detail": "string", "error_id": "string", "error_type": "string"}