Observe agents, traffic and cost
Everything the gateway and your other sources record is readable through the Portal API. These calls need the view_security permission (observability) or view_cost (cost figures).
Agent observability
| Call | Returns |
|---|---|
GET /api/observability/agents | Agents to select from |
GET /api/observability/agents/summary | Executions, success rate, latency, tokens, policy decisions and coverage for a window |
GET /api/observability/agents/executions | One row per execution, paged |
GET /api/observability/traces | A trace list, filterable by status (ok, error, blocked, gated, unknown) |
GET /api/observability/traces/{trace_id} | The ordered spans of one trace |
GET /api/observability/models | Usage by model |
Windows are half-open [since, until), at most 90 days. Defaults to the last 24 hours.
An execution is one gateway request. executions = succeeded + failed + blocked + gated. Blocked and gated calls are not counted as failures, and success_rate is succeeded / (succeeded + failed).
Unknown is not zero
Where something was not recorded, you get null and an explicit marker, never a zero:
- Token totals are summed only over completed calls that reported usage; the summary says how many (
recordedofof). Streamed responses report none. - Latency covers calls with a measured latency. A latency of
0means not measured. cost_usdisnullwithcost_recorded: falsewhere no price data exists.
Trace attributes are an allow-list of masked scalars. Prompts, responses, tool arguments and reasoning are never returned.
Traffic and cost
| Call | Returns |
|---|---|
GET /api/traffic/summary | Totals for a window |
GET /api/traffic/requests, /requests/{id} | Governed requests |
GET /api/traffic/spikes | Unusual volume |
GET /api/traffic/export.csv | CSV export |
GET /api/gateway/requests, /metrics | The gateway request log and KPIs |
Realtime
The console receives hints over a WebSocket and refetches. The socket is for the console; integrate with the REST calls above.