Request logs API
GET /api/v1/admin/logs
Section titled “GET /api/v1/admin/logs”GET /api/v1/admin/logs · operation listRequestLogs
Requires request_logs and usage_analytics flags. Paginated inference request metadata. Scoped roles are restricted to one active membership per query. No prompts, response bodies or authorization headers are stored. Time range is at most 90 days; pagination is capped at offset 10000. Exact status_code filtering requires request_log_status_code.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
sort |
query | string, one of "at", "duration_ms", "status", default "at" |
Requires request_log_columns when explicitly present; unknown, duplicate or empty values return 400. Applied before LIMIT with ID tie-breaker in the same direction. |
order |
query | string, one of "asc", "desc", default "desc" |
Requires request_log_columns when explicitly present; omitted uses descending order. JSON and CSV use the same ordering. |
tags |
query | string, max length 2048 | Exact JSON object of at most four ASCII slug string pairs combined with AND before authorized aggregation/pagination. Historical values need not exist in current taxonomy. Single query value, at most 2 KiB, duplicate decoded keys rejected. Requires usage_tags; disabled returns 404 and projections omit stored tags. |
end_user |
query | string, min length 1, max length 128 | Exact client-declared end user. Requires end_user_tracking; with the flag off the parameter is rejected. Applied in the shared usage predicate, so reports, comparisons, CSV, valuation and receipts agree. |
session_id |
query | string, min length 1, max length 128 | Exact client-declared session. Requires session_tracking; with the flag off the parameter is rejected. |
client_ip |
query | string, max length 64 | client_source_metadata (T033.003). One IP address or CIDR (at least /8 for IPv4, /32 for IPv6) matched against unexpired stored client addresses, inside the query before pagination. Global console roles always; team roles only with client_source_metadata.read team. 404 feature_disabled when the flag is off or the role may not read addresses. With the filter readable, the CSV export adds a client_ip column. |
origin |
query | string, one of "app", "evaluation", "experiment", "playground", "helper", "shadow", "replay" |
T186.004: only the requests of one origin (how the request entered the gateway). Requires evaluation_tracing; with the flag off, or with another value, the parameter is rejected with 400 invalid_origin. A request log row with no origin (written before the flag, or with it off) is app. Applied in the shared usage predicate, so reports, valuation and the request log agree; day rollups are not used while it is set. |
helper_kind |
query | string, one of "guardrail", "classifier", "summary", "ask_ai", "cache_embedding", "tool_search", "vector_store", "model_test" |
T186.004 S3b: only the helper calls of one sub-kind (ask_ai is m7 ai). Requires origin=helper; anything else is rejected with 400 invalid_helper_kind. A fixed value, applied in the same shared usage predicate as origin. |
from |
query | string (date-time) | |
to |
query | string (date-time) | |
request_id |
query | string, max length 128 | Only the log entry of this request ID. |
trace_id |
query | string, pattern ^[0-9a-f]{32}$ |
Only the requests of this W3C trace ID (32 lower-case hex characters). |
principal |
query | string, max length 128 | |
team |
query | string, max length 128 | |
organization |
query | string, pattern ^[a-z][a-z0-9_-]{1,63}$ |
Requires organizations. The requests recorded in one organization: each request counts for the organization it ran in, also after its team moved to another. A global role cannot combine it with team; an organization administrator may name only its own organization (403 otherwise), alone or with team; refused for team roles |
key_id |
query | string, max length 128 | |
model |
query | string, max length 128 | |
provider |
query | string, max length 128 | |
operation |
query | string, max length 128 | |
status |
query | string, one of "all", "success", "error", default "all" |
error is every row with an HTTP status of 400 or more, plus the rows whose answer was cut after it started (error_code stream_interrupted, stream_aborted or client_closed_stream; status as the client received it, usually 200); success is the rest. Analytics, rollups and the session summary count errors the same way. |
status_code |
query | integer, min 100, max 599 | Only requests answered with this HTTP status. |
owner |
query | string, pattern ^(user:usr_[a-f0-9]{32}|workload:[a-z][a-z0-9_-]{1,63})$ |
Exact owner captured when the request was accepted (user:<id> or workload:<id>). Requires identity_ownership; rebinding never reattributes history. |
q |
query | string, max length 4096 | T186.007, requires trace_query: a query of the logs scope in the gateway’s query language (GET /query/fields?scope=logs), joined by AND to the filters above, which stay accepted and select the same rows as their terms (model=a is q=model:a, status=error is q=status:error, status_code=502 is q=http_status:502, key_id is key, session_id is session). A span field (canary.side, cache.kind, customer.org, guardrail.<id>.outcome, fell_back) keeps the requests that have such a span (needs span_store; at most 2000 requests per term, X-Query-Span-Truncated otherwise); an evaluation or feedback term keeps the requests whose trace has such a result (X-Query-Evaluation-Truncated); a word or quoted phrase searches captured content for readers with content_sent:read (X-Query-Text-Truncated when older records were not read). 400 invalid_query names the problem. |
limit |
query | integer, default 50, min 1, max 100 |
|
offset |
query | integer, default 0, min 0, max 10000 |
Rows to skip before this page, for pagination (0-10000). |
Responses
| Status | Description | Body |
|---|---|---|
200 |
Stable newest-first page of matching request metadata | application/json: RequestLogPage |
400 |
Invalid input | application/json: Error |
401 |
Missing or invalid bearer key | application/json: Error |
404 |
Feature disabled | application/json: Error |
503 |
Analytics storage unavailable | — |
GET /api/v1/admin/logs/export
Section titled “GET /api/v1/admin/logs/export”GET /api/v1/admin/logs/export · operation exportRequestLogMetadata
Download at most 10000 filtered inference metadata rows as CSV. Uses the same exact filters and 90-day time boundary as GET /api/v1/admin/logs, with team membership enforced in SQL. Requires request_log_export, request_logs and usage_analytics; exact status_code requires request_log_status_code. Fields that could be interpreted as spreadsheet formulas are prefixed safely. X-Export-Truncated indicates more matches; no prompts, responses or credentials are exported. With identity_ownership, owner_kind and owner_id columns are appended and the owner filter applies.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
sort |
query | string, one of "at", "duration_ms", "status", default "at" |
Requires request_log_columns when explicitly present; unknown, duplicate or empty values return 400. Applied before LIMIT with ID tie-breaker in the same direction. |
order |
query | string, one of "asc", "desc", default "desc" |
Requires request_log_columns when explicitly present; omitted uses descending order. JSON and CSV use the same ordering. |
tags |
query | string, max length 2048 | Exact JSON object of at most four ASCII slug string pairs combined with AND before authorized aggregation/pagination. Historical values need not exist in current taxonomy. Single query value, at most 2 KiB, duplicate decoded keys rejected. Requires usage_tags; disabled returns 404 and projections omit stored tags. |
end_user |
query | string, min length 1, max length 128 | Exact client-declared end user. Requires end_user_tracking; with the flag off the parameter is rejected. Applied in the shared usage predicate, so reports, comparisons, CSV, valuation and receipts agree. |
session_id |
query | string, min length 1, max length 128 | Exact client-declared session. Requires session_tracking; with the flag off the parameter is rejected. |
client_ip |
query | string, max length 64 | client_source_metadata (T033.003). One IP address or CIDR (at least /8 for IPv4, /32 for IPv6) matched against unexpired stored client addresses, inside the query before pagination. Global console roles always; team roles only with client_source_metadata.read team. 404 feature_disabled when the flag is off or the role may not read addresses. With the filter readable, the CSV export adds a client_ip column. |
from |
query | string (date-time) | Start of the time window, an RFC 3339 timestamp. |
to |
query | string (date-time) | End of the time window, an RFC 3339 timestamp. |
request_id |
query | string | Only the rows of this request ID. |
trace_id |
query | string | Only the rows of this W3C trace ID. |
principal |
query | string | Only requests of this key principal. |
team |
query | string | Only this team’s rows; it narrows what the session may read and never grants access. |
organization |
query | string, pattern ^[a-z][a-z0-9_-]{1,63}$ |
Requires organizations. The requests recorded in one organization: each request counts for the organization it ran in, also after its team moved to another. A global role cannot combine it with team; an organization administrator may name only its own organization (403 otherwise), alone or with team; refused for team roles |
key_id |
query | string | Only requests made with this key. |
model |
query | string | |
provider |
query | string | Only requests served by this provider connection. |
operation |
query | string | Only requests of this operation (chat, embeddings, images…). |
status |
query | string, one of "all", "success", "error" |
all (default), success or error. error includes the rows whose answer was cut after it started (error_code stream_interrupted, stream_aborted or client_closed_stream), whatever their status. |
status_code |
query | integer, min 100, max 599 | Only requests answered with this HTTP status. |
q |
query | string, max length 4096 | T186.007, requires trace_query: the same query as GET /api/v1/admin/logs, of the logs scope in the gateway’s query language (GET /query/fields?scope=logs), joined by AND to the filters above, which stay accepted and select the same rows as their terms (model=a is q=model:a, status=error is q=status:error, status_code=502 is q=http_status:502, key_id is key, session_id is session). A span field (canary.side, cache.kind, customer.org, guardrail.<id>.outcome, fell_back) keeps the requests that have such a span (needs span_store; at most 2000 requests per term, X-Query-Span-Truncated otherwise); an evaluation or feedback term keeps the requests whose trace has such a result (X-Query-Evaluation-Truncated); a word or quoted phrase searches captured content for readers with content_sent:read (X-Query-Text-Truncated when older records were not read). 400 invalid_query names the problem. |
owner |
query | string, pattern ^(user:usr_[a-f0-9]{32}|workload:[a-z][a-z0-9_-]{1,63})$ |
Exact owner captured when the request was accepted (user:<id> or workload:<id>). Requires identity_ownership; rebinding never reattributes history. |
Responses
| Status | Description | Body |
|---|---|---|
200 |
Filtered CSV metadata with optional X-Export-Truncated header | — |
400 |
Invalid input | application/json: Error |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
Feature disabled | application/json: Error |
503 |
Log storage unavailable | — |
GET /api/v1/admin/requests/{id}/journey
Section titled “GET /api/v1/admin/requests/{id}/journey”GET /api/v1/admin/requests/{id}/journey · operation requestJourney
Request journey (T033.001). Requires request_journey, request_logs, usage_analytics and logs:read. Returns up to 20 persisted records of the exact X-Request-Id (the newest kept, answered oldest first), the stages those records prove for the latest, up to 20 other requests of the same trace (the earliest kept, identifiers and outcome only) and an explicit list of what was never recorded. Scoped roles read only records of their live memberships, applied in SQL before both bounds; a missing and an out-of-scope ID answer the same 404. Fields follow the CSV export’s flags: tags (usage_tags), session (session_tracking), end user (end_user_tracking), owner (identity_ownership), requested model (model_aliases), avoided/cached tokens and auto-route baseline (cost_optimization), valuation (usage_valuation plus analytics:read). Bodies are never returned. The permalink is a console path holding only the request ID. With evaluation_results and evals:read, evaluations lists the request’s evaluation results (T186.003).
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id |
path | string, required, pattern ^[A-Za-z0-9._:-]{1,128}$ |
Responses
| Status | Description | Body |
|---|---|---|
200 |
Request journey | application/json: RequestJourney |
400 |
Invalid input | application/json: Error |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
Request not visible to this session, or request_journey/request_logs disabled (feature_disabled) | — |
503 |
Log storage unavailable | — |
GET /api/v1/admin/requests/{id}/trace
Section titled “GET /api/v1/admin/requests/{id}/trace”GET /api/v1/admin/requests/{id}/trace · operation requestTrace
Span store (T186.002). Requires span_store, usage_analytics and logs:read. The stored trace of one request ID: its trace id and the span id of its request span (the latest one of a reused request ID), and where the spans are read from: the database, or (T186.018) the analytics store copy when the database’s retention already dropped them and analytics_store_spans is on. Without spans the 404 says why, from the request log row (the durable anchor): spans_expired (older than the span store’s retention), spans_sampled_out (dropped by spans.sample_rate, judged with the sample rate in force), or trace_not_found (served before the span store, its spans dropped, or not visible to the session’s teams; a missing and an out-of-scope ID answer the same 404). Answered with Cache-Control: private, no-store.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id |
path | string, required, pattern ^[A-Za-z0-9._:-]{1,128}$ |
Responses
| Status | Description | Body |
|---|---|---|
200 |
The request’s stored trace | application/json: object |
400 |
Invalid input | application/json: Error |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
No spans for this request in the session’s teams: error.code spans_expired, spans_sampled_out or trace_not_found; or span_store disabled (feature_disabled) | — |
503 |
Span storage unavailable (storage_unavailable), or the analytics store copy could not be read (analytics_store_unavailable) | — |
Response 200 fields:
application/json: objectrequest_id(string, required)trace_id(string, required, pattern^[0-9a-f]{32}$)span_id(string, required, pattern^[0-9a-f]{16}$)source(string, required, one of"database","analytics_store")
POST /api/v1/admin/requests/{id}/replay
Section titled “POST /api/v1/admin/requests/{id}/replay”POST /api/v1/admin/requests/{id}/replay · operation replayRequest
Request replay (T186.006, flag request_replay, off by default; requires content_capture, span_store and evaluation_tracing). Sends the captured sent view of a stored request (the request after the input guardrails, as the capture policy kept it) again as a new request: a new request ID and trace, origin replay, parent_request_id the request it replays, and a link both ways (replays on GET /traces/{trace_id}; replay_of on the replay’s request span). The new request runs under the operator’s own identity in the request’s team (key ID replay:<team>:<user>, the console user as principal and key owner), so rate limits, quotas, budgets, guardrails, capture, the ledger and cost are the operator’s and the team’s, never the original caller’s key; it is answered in one piece (stream is cleared) and it spends. Requires a console session with CSRF (never the shared API token or a scoped credential), requests:replay (administrator, organization admin, team administrator; a custom role ceiling can withhold it), content_sent:read of the request’s team, and that the session may run calls as that team. The read of the captured content is audited (content_capture.read, view:replay) before anything is decrypted, and the replay itself as request.replay in the identity audit. Covers Chat Completions, Messages and Responses requests. A JSON body is optional: team_id names the team when two teams the session reads have a request with this ID (counted in the query, however many records each has), and capture_id the record when one team used the ID more than once.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id |
path | string, required, pattern ^[A-Za-z0-9._:-]{1,128}$ |
Request body
application/json: objectteam_id(string, max length 128)capture_id(string, max length 128) — The captured record to replay when the team used this request ID more than once (the capture_id of the trace’s request span); the newest record otherwise
Responses
| Status | Description | Body |
|---|---|---|
200 |
The replay was sent; status is the HTTP status the new request was answered with (a refusal by a guardrail, a limit or the provider is a sent replay with its own status) | application/json: object |
400 |
invalid_request_id or invalid_request | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
role_forbidden (no requests:replay, the shared token, a scoped credential), content_read_forbidden (no content_sent:read of the team), team_forbidden or a missing CSRF token | — |
404 |
request_replay, content_capture or evaluation_tracing disabled, or not in the team’s plan (feature_disabled) | — |
409 |
content_not_captured (no captured record of this request among the teams the session reads: nothing is invented), content_not_replayable (the record keeps no sent view, was cut at max_bytes, holds images or audio kept apart from the body, or is not a Chat Completions, Messages or Responses request; the message says which) or replay_team_required | — |
503 |
storage_unavailable, encryption_unavailable or replay_unavailable | — |
Response 200 fields:
application/json: objectreplay_of(object, required)request_id(string, required)trace_id(string)team_id(string, required)
request_id(string, required) — The new requesttrace_id(string, required)status(integer, required)origin(string, required, one of"replay")output(string, max length 16384) — The answer’s text, when the replay was answerederror(object)code(string)message(string)
GET /api/v1/admin/traces
Section titled “GET /api/v1/admin/traces”GET /api/v1/admin/traces · operation listTraces
Trace explorer (T186.006). Requires trace_explorer, span_store, usage_analytics and logs:read. The traces (scope traces: one row per team’s summary of a trace) or the spans (scope spans) of a time range that match q, newest first, from the engine spans.engine selects. Team-scoped roles read only their live memberships’ rows, filtered in the query before any bound, count or page; a trace that crosses teams is one row per team. q joins terms by AND: field:value, field:prefix*, field:* (present), -field:value, and >, >=, <, <= on numbers, durations (250ms, 2s, 1m) and cost; fields are an allowlist (GET /traces/fields) and every value is a bound parameter. With trace_query (T186.007) q is the whole query language: terms side by side or with AND, OR, NOT or a leading -, parentheses (at most 8 levels), field:(a OR b) (at most 32 values), field:[low TO high] with * for an open side, child.field in the traces scope (some span of the trace; child. terms of one AND name one span) and child.field or parent.field in the spans scope (a direct child, the parent), a span field without a prefix in the traces scope (a trace with such a span), and a word or a quoted phrase, which searches the captured sent view and answer of the newest trace_query.text_search_max_records records of the range for readers with content_sent:read of the team (one audit row content_capture.search per search; refused for anyone else). Without trace_query, OR, NOT, parentheses, lists, ranges, child., parent. and text are refused with a message that names the feature. A field the reader may not see on a row (session, end user, cost, tags, evaluation results) is refused as a filter. evaluation.<name>.assessment, evaluation.<name>.value, evaluation.<name>:, feedback.<name>.value, feedback.<name>: and trace.failed_evaluations are resolved from the evaluation results first (at most 2000 traces per term; evaluation_filter_truncated says more matched). Each row carries the counts and the first 24 results of its trace or span, never reasoning. lens evaluations or feedback adds cards: per evaluator or label, the results written in the range. content=true (at most 50 rows) adds the first input and the answer of each row’s request for readers with content_sent:read of its team, through the content ladder; each preview is an audited read, and media and reasoning are never part of it.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
scope |
query | string, one of "traces", "spans", default "traces" |
|
q |
query | string, max length 4096 | At most 64 terms |
internal |
query | boolean, default true |
false leaves the gateway’s own calls out (origin evaluation and helper: judges, topic and comparison summaries, prompt suggestions) as a separate filter ANDed with q, which is parsed and bounded as written (traces and spans scopes; the console sends false by default) |
from |
query | string (date-time) | Default: 24 hours before to |
to |
query | string (date-time) | Default: now; at most 92 days after from |
lens |
query | string, one of "overview", "evaluations", "feedback", default "overview" |
|
limit |
query | integer, default 50, min 1, max 200 |
|
cursor |
query | string | next_cursor of the page before |
content |
query | string, one of "true" |
|
fields |
query | string | T186.007: a comma-separated list of what each row carries beside its core: core, cost, evaluations, content (as content=true). Omitted, a row has cost and evaluations. A lighter page skips the read it leaves out (fields=core reads no evaluation results). Another name answers 400 with the list. |
Responses
| Status | Description | Body |
|---|---|---|
200 |
One page | application/json: TraceExplorerPage |
400 |
invalid_query (the message names the problem and the fields the reader may use), invalid_range or invalid_request | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
trace_explorer or span_store disabled (feature_disabled) | — |
503 |
query_timeout (the read took more than 10 seconds: shorten the range or add a filter), analytics_store_unavailable or storage_unavailable | — |
GET /api/v1/admin/traces/facets
Section titled “GET /api/v1/admin/traces/facets”GET /api/v1/admin/traces/facets · operation getTraceFacets
Trace explorer (T186.006). The exact total and the facet counts of a query (same scope, q, from and to as the list, same authorization), each facet’s 50 most frequent values: status, origin, model, team, fell_back, cache, guardrail.flagged and, for spans, span.kind and provider. max holds the largest trace.errors and trace.spans (traces scope). With evaluation_results and evals:read, evaluators lists one figure per evaluator and feedback label: the valid, finished results attached to a trace and written in the range (and the day after it) in the reader’s teams; the query does not narrow them. field limits the answer to one facet, or to evaluation. With trace_query (T186.007) field may be any text, enum, boolean or keyed field of the scope the reader may filter on (valuation, canary.side, key, tag.<name>, guardrail.<id>.outcome, …), or tag alone in the spans scope for the tag names in use: the answer holds the total and that field’s 50 most frequent values, rows without a value not counted. text_search says what a text term read (scanned, limit, truncated, matched). histogram=true adds the count over time in at most 60 buckets.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
scope |
query | string, one of "traces", "spans", default "traces" |
|
q |
query | string, max length 4096 | |
internal |
query | boolean, default true |
false leaves the gateway’s own calls out (origin evaluation and helper: judges, topic and comparison summaries, prompt suggestions) as a separate filter ANDed with q, which is parsed and bounded as written (traces and spans scopes; the console sends false by default) |
from |
query | string (date-time) | |
to |
query | string (date-time) | |
field |
query | string | One facet field of the scope, or evaluation |
histogram |
query | string, one of "true" |
|
stats |
query | string, one of "true" |
Adds stats: the figures of the query’s rows (count, duration p50, p95 and mean, tokens, errors and, for a reader who sees cost, the cost) |
Responses
| Status | Description | Body |
|---|---|---|
200 |
The facets | application/json: TraceFacets |
400 |
invalid_query, invalid_range or invalid_request | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
trace_explorer or span_store disabled (feature_disabled) | — |
503 |
query_timeout, analytics_store_unavailable or storage_unavailable | — |
GET /api/v1/admin/sessions
Section titled “GET /api/v1/admin/sessions”GET /api/v1/admin/sessions · operation listSessions
Sessions (T186.011, session_explorer, a tenant read). The sessions active in the range (a session whose last trace ends at or after from and whose first starts before to: the traces that carried the same X-Gateway-Session-Id in one team, summed as the span writer stores them), the most recently active first, that match q in the query language’s sessions scope (session, end_user, team, agent, parent_session, duration, cost, valuation, tokens.total, session.traces, session.requests; evaluation terms and session.failed_evaluations select the sessions with such a result, on the session or on its traces). A row carries evaluations (the badge of every result of the session and its traces) and scores (its own session-scope results by evaluator: count, failed, mean), and session_evaluators names those evaluators for the page’s columns. content=true adds each session’s first input and answer (its first trace’s root request) for a reader of the sent view of its team, each an audited read, and caps the page at 50; totals=true adds the count of every matching session with their traces, cost and tokens. Reads the reader’s teams, of each what it recorded in its current organization, on the span engine the trace explorer reads. Requires session_explorer, session_tracking, trace_explorer, span_store, usage_analytics and logs:read.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
q |
query | string, max length 4096 | |
from |
query | string (date-time) | Default: 24 hours before to |
to |
query | string (date-time) | Default: now; at most 92 days after from |
cursor |
query | string, max length 1024 | |
limit |
query | integer, default 50, min 1, max 200 |
|
content |
query | boolean, default false |
|
totals |
query | boolean, default false |
Responses
| Status | Description | Body |
|---|---|---|
200 |
A page of sessions | application/json: object |
400 |
invalid_query, invalid_range or invalid_request | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
session_explorer, session_tracking, trace_explorer or span_store disabled, or not in the team’s plan (feature_disabled) | — |
503 |
query_timeout, analytics_store_unavailable or storage_unavailable | — |
Response 200 fields:
application/json: objectscope("sessions", required)from(string (date-time), required)to(string (date-time), required)query(string, required)engine(string, required, one of"database","analytics_store")data(array of SessionListItem, required, max items 200)has_more(boolean, required)next_cursor(string)valuation_shown(boolean, required)evaluations_shown(boolean, required)evaluations_truncated(boolean) — The page’s sessions hold more than 1,000 results; the newest are countedevaluations_unavailable(boolean)evaluation_filter_truncated(boolean)content_shown(boolean, required)session_evaluators(array of string, required)totals(ListTotals)
GET /api/v1/admin/sessions/{id}/overview
Section titled “GET /api/v1/admin/sessions/{id}/overview”GET /api/v1/admin/sessions/{id}/overview · operation getSessionOverview
Session page (T186.011, session_explorer). The session in each of the reader’s teams that holds the ID (one row per team and organization, T186.011b; team and organization narrow it), the sessions started from it (child sessions, by X-Gateway-Parent-Session-Id, at most 200), its own results (scope session, with the judge’s reasoning for a reader of the sent view) and the results of its traces counted (trace_evaluations). Same authorization as the list.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id |
path | string, required, min length 1, max length 128 | |
team |
query | string, max length 256 | |
organization |
query | string, max length 256 | T186.011b: one organization’s part of the session (an empty value selects the part that recorded none) |
Responses
| Status | Description | Body |
|---|---|---|
200 |
The session | application/json: object |
400 |
invalid_session_id or invalid_request | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
not_found (no such session in the reader’s teams) or feature_disabled | — |
503 |
analytics_store_unavailable or storage_unavailable | — |
Response 200 fields:
application/json: objectsession_id(string, required)sessions(array of SessionListItem, required, min items 1)children(array of SessionListItem, required, max items 200)valuation_shown(boolean, required)evaluations_shown(boolean, required)evaluations_unavailable(boolean)evaluations(array of EvaluationResult, required)trace_evaluations(RowEvaluations, required)
GET /api/v1/admin/sessions/{id}/transcript
Section titled “GET /api/v1/admin/sessions/{id}/transcript”GET /api/v1/admin/sessions/{id}/transcript · operation getSessionTranscript
Session transcript (T186.011, session_explorer). The session’s traces in one team as turns: a page of the most recent ones (limit, default 20, at most 50) in the order they happened, cursor for the earlier ones; each turn has the trace’s figures and the badge of its results. For a reader of the records of the team each turn has content: state shown with the last user message of the request as sent and the answer (each at most 4,000 characters, text only, one audited read per turn), withheld for a reader of the records’ existence only, not_captured when the request was not captured; content=false skips the reads. 409 team_required when several of the reader’s teams hold the ID, organization_required when the team recorded it under several organizations (T186.011b: name one with organization; each part holds only its own turns).
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id |
path | string, required, min length 1, max length 128 | |
team |
query | string, max length 256 | |
organization |
query | string, max length 256 | |
cursor |
query | string, max length 1024 | |
limit |
query | integer, default 20, min 1, max 50 |
|
content |
query | boolean, default true |
Responses
| Status | Description | Body |
|---|---|---|
200 |
A page of turns | application/json: object |
400 |
invalid_session_id or invalid_request | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
not_found or feature_disabled | — |
409 |
team_required or organization_required | — |
503 |
query_timeout, analytics_store_unavailable or storage_unavailable | — |
Response 200 fields:
application/json: objectsession_id(string, required)team_id(string, required)traces(integer, required) — Traces in the whole sessionturns(array of object, required, max items 50)trace_id(string, required)team_id(string, required)root_request_id(string)first_at(string (date-time), required)last_at(string (date-time), required)duration_us(integer, required)evaluations(RowEvaluations)can_annotate(boolean) — This session may record a result on the turn’s team (its thumbs): the checks of POST /api/v1/admin/evaluations (permission, writable team, plan, active team); absent when notcontent(object)state(string, required, one of"shown","withheld","not_captured")input(string)output(string)
has_more(boolean, required)next_cursor(string)valuation_shown(boolean, required)content_shown(boolean, required)evaluations_unavailable(boolean)
GET /api/v1/admin/end-users
Section titled “GET /api/v1/admin/end-users”GET /api/v1/admin/end-users · operation listEndUsers
End users (T186.011, end_user_pages, a tenant read). The end users a client declared (X-Gateway-End-User, never authenticated: declared is always true) on the traces of the range, one row per team, the most recently seen first, summed on read from the trace summaries (an erased end user is in no summary and so in no row): first and last seen, traces, sessions, requests, traces in error, cost and tokens, and the badge of their results; q in the query language’s users scope (end_user, team, cost, valuation, tokens.total, user.traces, user.sessions, user.requests, user.errors; evaluation terms and user.failed_evaluations). totals=true adds the count of every matching end user with their traces, cost and tokens. Requires end_user_pages, end_user_tracking, trace_explorer, span_store, usage_analytics and logs:read.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
q |
query | string, max length 4096 | |
from |
query | string (date-time) | |
to |
query | string (date-time) | |
cursor |
query | string, max length 1024 | |
limit |
query | integer, default 50, min 1, max 200 |
|
totals |
query | boolean, default false |
Responses
| Status | Description | Body |
|---|---|---|
200 |
A page of end users | application/json: EndUserPage |
400 |
invalid_query, invalid_range or invalid_request | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
end_user_pages, end_user_tracking, trace_explorer or span_store disabled, or not in the team’s plan (feature_disabled) | — |
503 |
query_timeout, analytics_store_unavailable or storage_unavailable | — |
GET /api/v1/admin/end-users/{end_user}
Section titled “GET /api/v1/admin/end-users/{end_user}”GET /api/v1/admin/end-users/{end_user} · operation getEndUser
End user page (T186.011, end_user_pages). The end user in each of the reader’s teams over the range (team narrows to one) and the totals, as the list counts them; its traces, sessions and evaluations are the trace list with q end_user:<id>, the sessions list with the same term and /evaluations?end_user=<id>.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
end_user |
path | string, required, min length 1, max length 128 | |
team |
query | string, max length 256 | |
from |
query | string (date-time) | |
to |
query | string (date-time) |
Responses
| Status | Description | Body |
|---|---|---|
200 |
The end user | application/json: EndUserPage |
400 |
invalid_end_user, invalid_range or invalid_request | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
feature_disabled | — |
503 |
query_timeout, analytics_store_unavailable or storage_unavailable | — |
GET /api/v1/admin/agent-usage
Section titled “GET /api/v1/admin/agent-usage”GET /api/v1/admin/agent-usage · operation getAgentUsage
Agents page (T186.011b, agent_insights, a tenant read). The agents of the range from the request spans that name one (X-Gateway-Agent-Id, or the agent a recognized run named), one row per team and agent, most recently seen first (at most 500): requests, errors, spans of their traces, versions, p95 duration, tokens, cost (cost only for a reader who sees cost; partial and unknown named, never zero), first and last seen; series holds the requests and errors per step_seconds of the eight most used agents and (other agents) (folded); highest_latency and, for a reader who sees cost, most_expensive rank the ten first. Same gate and team filter as the trace explorer, on the span engine it reads.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
from |
query | string (date-time) | Default: 24 hours before to |
to |
query | string (date-time) | Default: now; at most 92 days after from |
team |
query | string, max length 256 |
Responses
| Status | Description | Body |
|---|---|---|
200 |
The agents of the range | application/json: object |
400 |
invalid_range or invalid_request | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
agent_insights, trace_explorer or span_store disabled, or not in the team’s plan (feature_disabled) | — |
503 |
query_timeout, analytics_store_unavailable or storage_unavailable | — |
Response 200 fields:
application/json: objectfrom(string (date-time), required)to(string (date-time), required)step_seconds(integer, required)agents(array of AgentFigure, required, max items 500)series(array of object, required, max items 9)team_id(string)agent(string, required)folded(boolean)points(array of object, required)at(string (date-time), required)requests(integer, required)errors(integer, required)
highest_latency(array of AgentFigure, required, max items 10)most_expensive(array of AgentFigure, max items 10)valuation_shown(boolean, required)
GET /api/v1/admin/agent-usage/{agent}
Section titled “GET /api/v1/admin/agent-usage/{agent}”GET /api/v1/admin/agent-usage/{agent} · operation getAgentVersions
Agents page (T186.011b). One agent’s versions over the range (team narrows to one team’s agent): each version’s figures and what the version catalogue knows: declared (X-Gateway-Agent-Version) or a fingerprint (v- and eight hex digits over the instructions, tools and model), models, instruction and tool hashes, and the tool names for a reader of the records’ structure (tools_shown).
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
agent |
path | string, required, min length 1, max length 128 | |
team |
query | string, max length 256 | |
from |
query | string (date-time) | |
to |
query | string (date-time) |
Responses
| Status | Description | Body |
|---|---|---|
200 |
The versions | application/json: object |
400 |
invalid_range or invalid_request | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
feature_disabled | — |
503 |
storage_unavailable, analytics_store_unavailable | — |
Response 200 fields:
application/json: objectagent(string, required)from(string (date-time), required)to(string (date-time), required)versions(array of AgentVersion, required)
GET /api/v1/admin/agent-usage/{agent}/compare
Section titled “GET /api/v1/admin/agent-usage/{agent}/compare”GET /api/v1/admin/agent-usage/{agent}/compare · operation compareAgentVersions
Agents page (T186.011b). Two versions of one team’s agent: models_changed, tools_changed and instructions_changed (from the hashes, for every reader); tools_added and tools_removed for a reader of the records’ structure; the instructions of each version (the system text of a recent captured request of it, cut at 8,000 characters, one audited read per version) for a reader of the sent view.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
agent |
path | string, required, min length 1, max length 128 | |
team |
query | string, required, max length 256 | |
a |
query | string, required, max length 64 | |
b |
query | string, required, max length 64 | |
from |
query | string (date-time) | |
to |
query | string (date-time) |
Responses
| Status | Description | Body |
|---|---|---|
200 |
The comparison | application/json: object |
400 |
invalid_request (team, a and b are required) | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
not_found (no such version in the range) or feature_disabled | — |
503 |
storage_unavailable, analytics_store_unavailable | — |
Response 200 fields:
application/json: objectagent(string, required)team_id(string, required)a(AgentVersion, required)b(AgentVersion, required)models_changed(boolean, required)instructions_changed(boolean, required)tools_changed(boolean, required)tools_shown(boolean, required)tools_added(array of string)tools_removed(array of string)instructions_shown(boolean, required)instructions_a(string)instructions_b(string)
GET /api/v1/admin/traces/tools
Section titled “GET /api/v1/admin/traces/tools”GET /api/v1/admin/traces/tools · operation getTraceTools
Tool calls view (T186.021, tool_call_analytics, a tenant read). The tool spans of the range (gateway-run MCP tools, named execute_tool <tool> with their server; tools a client reported, one row named client tool), optionally narrowed by q in the spans scope, by tool: calls, errors, success and error rate (fractions to four decimals) and the mean latency of the calls with a duration (milliseconds to one decimal; a client-reported tool has none, so null), most called first; series holds the eight most called tools and (other tools) (folded), each with calls and errors per step_seconds. An MCP listing (MCP operation) is not a tool call and is left out. Reads the reader’s teams, of each what it recorded in its current organization, on the span engine the trace explorer reads. Requires tool_call_analytics, trace_explorer, span_store, usage_analytics and logs:read (404 feature_disabled without the flag).
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
q |
query | string, max length 4096 | |
from |
query | string (date-time) | Default: 24 hours before to |
to |
query | string (date-time) | Default: now; at most 92 days after from |
scope |
query | string, one of "spans" |
The view reads spans; any other scope is 400. |
Responses
| Status | Description | Body |
|---|---|---|
200 |
The tools of the range | application/json: object |
400 |
invalid_query, invalid_range or invalid_request (a scope other than spans) | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
tool_call_analytics, trace_explorer or span_store disabled (feature_disabled) | — |
503 |
query_timeout, analytics_store_unavailable or storage_unavailable | — |
Response 200 fields:
application/json: objectfrom(string (date-time), required)to(string (date-time), required)query(string, required)step_seconds(integer, required)totals(object, required)calls(integer, required)errors(integer, required)success_rate(number or null, required)error_rate(number or null, required)avg_latency_ms(number or null, required)tools(integer, required)
tools(array of object, required)tool(string, required) — The tool’s name (the span name without execute_tool)name(string, required) — The tool span’s nameserver(string) — The MCP server that ran itcalls(integer, required)errors(integer, required)success_rate(number, required)error_rate(number, required)avg_latency_ms(number or null, required)timed_calls(integer, required) — Calls with a measured duration
series(array of object, required, max items 9)key(string, required) — server · tool, or (other tools)folded(boolean)points(array of object, required)at(string (date-time), required)calls(integer, required)errors(integer, required)
truncated(boolean, required) — The range held more than 5,000 tool and step cells, or a term of q named more traces than one query holds: narrow itread_store(string, required, one of"database","analytics_store")
GET /api/v1/admin/traces/chart
Section titled “GET /api/v1/admin/traces/chart”GET /api/v1/admin/traces/chart · operation getTraceChart
Trace explorer (T186.006). One metric of a query’s rows (same scope, q, from, to and authorization as the list) over time and in all, by one breakdown: metric count, errors, duration (the mean, in microseconds), tokens (input plus output) or cost (USD; refused with 400 for a reader who does not see cost), by none, status, origin, team or model. series holds at most the eight largest groups and other; each has its total and one point per interval of step_seconds (at most 60 intervals). metrics and groups list what this reader may ask. Requires trace_explorer, span_store, usage_analytics and logs:read; the team filter runs before the aggregation.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
scope |
query | string, one of "traces", "spans", default "traces" |
|
q |
query | string, max length 4096 | |
internal |
query | boolean, default true |
false leaves the gateway’s own calls out (origin evaluation and helper: judges, topic and comparison summaries, prompt suggestions) as a separate filter ANDed with q, which is parsed and bounded as written (traces and spans scopes; the console sends false by default) |
from |
query | string (date-time) | |
to |
query | string (date-time) | |
metric |
query | string, one of "count", "errors", "duration", "tokens", "cost", default "count" |
|
by |
query | string, one of "none", "status", "origin", "team", "model", default "none" |
Responses
| Status | Description | Body |
|---|---|---|
200 |
The series | application/json: object |
400 |
invalid_query, invalid_range or invalid_request (an unknown metric or breakdown, or cost for a reader who does not see it) | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
trace_explorer or span_store disabled (feature_disabled) | — |
503 |
query_timeout, analytics_store_unavailable or storage_unavailable | — |
Response 200 fields:
application/json: objectscope(string, required, one of"traces","spans")from(string (date-time), required)to(string (date-time), required)query(string, required)metric(string, required, one of"count","errors","duration","tokens","cost")by(string, required, one of"none","status","origin","team","model")unit(string, required, one of"rows","microseconds","tokens","usd")step_seconds(integer, required)series(array of TraceChartSeries, required, max items 9)metrics(array of string, required)groups(array of string, required)
GET /api/v1/admin/traces/fields
Section titled “GET /api/v1/admin/traces/fields”GET /api/v1/admin/traces/fields · operation getTraceFields
Trace explorer (T186.006). The fields of the explorer’s query that this reader may use, with their type, values, scopes and a line of help; the evaluation and feedback terms when the reader sees evaluation results; the syntax, examples and limits. The query bar’s help and completion read it.
Authentication: adminSession
Responses
| Status | Description | Body |
|---|---|---|
200 |
The field catalogue | application/json: object |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
trace_explorer or span_store disabled (feature_disabled) | — |
Response 200 fields:
application/json: objectfields(array of object, required)name(string, required)type(string, required, one of"text","enum","bool","number","duration","money","tag")values(array of string)scopes(array of string, required)facet(boolean)needs(string, one of"tags","session","end_user","cost")pattern(string)help(string, required)
evaluation_fields(array of object, required)name(string, required)help(string, required)
syntax(array of string, required)examples(array of string, required)limits(object, required)- any other key: integer
language(string, one of"full","basic") — T186.007: full with trace_query, basic (terms joined by AND) withouttext_search(object) — T186.007: as in GET /query/fields
GET /api/v1/admin/query/fields
Section titled “GET /api/v1/admin/query/fields”GET /api/v1/admin/query/fields · operation getQueryFields
The query language (T186.007, flag trace_query, off by default; requires request_logs). The field catalogue of one scope for this reader: traces and spans (the trace explorer), logs (the request log) and rules (an evaluator rule’s filter, matched in memory when a request is captured). fields are the fields the scope filters directly; span_fields are span fields a trace or a request is matched through (traces scope; logs scope with span_store); evaluation_fields are the evaluation and feedback terms, for readers of evaluation results. A field the reader’s rows do not show (session, end user, tags, cost, a column behind a feature that is off) is neither listed nor accepted. text_search says whether a word or phrase may be written and the bounds from the trace_query block of the configuration file (read at startup). Requires logs:read.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
scope |
query | string, one of "traces", "spans", "logs", "rules", default "traces" |
What the query selects: traces or spans (the trace explorer), logs (the request log) or rules (an evaluator rule’s filter) |
Responses
| Status | Description | Body |
|---|---|---|
200 |
The catalogue of the scope | application/json: QueryCatalogue |
400 |
invalid_request: an unknown scope | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
trace_query disabled (feature_disabled) | — |
GET /api/v1/admin/query/settings
Section titled “GET /api/v1/admin/query/settings”GET /api/v1/admin/query/settings · operation getQuerySettings
The query language (T186.007, trace_query). The effective trace_query block of the configuration file, with the source of each value (configuration or default): the bounds of text search and of saved views. The block is read when the gateway starts; this endpoint and the console show it and do not change it (applies: restart). Requires logs:read.
Authentication: adminSession
Responses
| Status | Description | Body |
|---|---|---|
200 |
The effective settings | application/json: object |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
trace_query disabled (feature_disabled) | — |
Response 200 fields:
application/json: objecttrace_query(TraceQueryConfig, required)sources(object, required)- any other key: string
applies(string, required, one of"restart")
POST /api/v1/admin/query/validate
Section titled “POST /api/v1/admin/query/validate”POST /api/v1/admin/query/validate · operation validateQuery
The query language (T186.007, trace_query). Says whether a query is one this reader may run in a scope, without reading any data: valid with the canonical form of the query, the fields it uses and whether it holds evaluation, text or span terms; or valid false with the refusal, which names the field, the value or the bound (4096 bytes, 64 terms, 8 levels, 32 values in a list, 256 bytes in a value) and the fields the reader may use. Editors call it before a query is run or saved. Requires logs:read.
Authentication: adminSession
Request body (required)
application/json: objectscope(string, one of"traces","spans","logs","rules", default"traces")q(string, required, max length 4096)
Responses
| Status | Description | Body |
|---|---|---|
200 |
The verdict | application/json: object |
400 |
invalid_request: the body is not {scope, q} | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
trace_query disabled (feature_disabled) | — |
413 |
request_too_large | — |
Response 200 fields:
application/json: objectvalid(boolean, required)scope(string, required, one of"traces","spans","logs","rules")query(string) — The canonical form (valid queries)fields(array of string) — The fields the query readsuses(object) — Whether the query holds evaluation, text or span (child., parent., through a span) termsevaluation(boolean)text(boolean)spans(boolean)
error(string) — The refusal (invalid queries)
GET /api/v1/admin/logs/facets
Section titled “GET /api/v1/admin/logs/facets”GET /api/v1/admin/logs/facets · operation getRequestLogFacets
The query language (T186.007, trace_query). Counts the request log rows of a filter by the values of one field: the 50 most frequent, rows without a value not counted. It takes the filters, the time range and q of GET /api/v1/admin/logs with the same authorization (a team role reads one team), and answers from the store the log page would read. field is a text, enum, boolean or tag field of the logs scope the reader may filter on. Requires request_logs, usage_analytics and logs:read.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
field |
query | string, required | For example model, provider, status, key, error_code, tag.env; tag alone counts the tag names in use |
q |
query | string, max length 4096 | |
from |
query | string (date-time) | |
to |
query | string (date-time) | |
team |
query | string, max length 128 | |
status |
query | string, one of "all", "success", "error", default "all" |
Responses
| Status | Description | Body |
|---|---|---|
200 |
The values of the field | application/json: object |
400 |
invalid_query, invalid_range or invalid_request (the message lists the fields a facet can count) | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
trace_query, request_logs or usage_analytics disabled (feature_disabled) | — |
503 |
query_timeout or storage_unavailable | — |
Response 200 fields:
application/json: objectfield(string, required)from(string (date-time))to(string (date-time))query(string)values(array of object, required, max items 50)value(string, required)count(integer, required)
limit(integer, required)read_store(object, nullable) — The store that answered, when the analytics store may answer the request log
GET /api/v1/admin/views
Section titled “GET /api/v1/admin/views”GET /api/v1/admin/views · operation listSavedViews
Saved views (T186.007, flag trace_query). A view is a named query of the trace explorer or the request log with its time range, columns, sort and lens. It stores no telemetry: opening a view runs its query with the reader’s own live authorization, so a shared view never shows more than the screen would. A view is private, a team’s or an organization’s. The list holds the caller’s own views, the views of its teams (every team for a gateway-wide role) and the views of the organizations of its teams; a team’s view records the organization the team was in when the view was shared, and a team that moved to another organization no longer reads it. Requires saved_views:read. access says what this session may do: save (saved_views:save in a named session; a shared token names nobody), and the teams and organization it may share with (saved_views:share: the teams it administers, its organization for an organization admin, any for the administrator).
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
surface |
query | string, one of "traces", "logs" |
Only the views of one screen |
Responses
| Status | Description | Body |
|---|---|---|
200 |
The views this session sees | application/json: object |
400 |
invalid_request: an unknown surface | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
trace_query disabled (feature_disabled) | — |
Response 200 fields:
application/json: objectitems(array of SavedView, required, max items 500)truncated(boolean, required)own_count(integer, required)own_limit(integer, required) — trace_query.saved_views_per_ownertotal_limit(integer, required) — trace_query.saved_views_totalaccess(object, required)save(boolean, required)share_all(boolean, required)share_teams(array of string, required)share_organization(string, required)organizations(boolean, required) — The organizations feature is on: a view may belong to an organization
POST /api/v1/admin/views
Section titled “POST /api/v1/admin/views”POST /api/v1/admin/views · operation createSavedView
Saved views (T186.007, trace_query). Stores a view owned by the session identity. visibility private (the default) takes saved_views:save; team with team, or organization with organization, also takes saved_views:share for that team or organization (403 otherwise). The definition is validated: its query must be one the language reads in its scope (422 invalid_view_definition with the parser’s message); whether a reader may use each of its fields is decided when the reader runs it. At most trace_query.saved_views_per_owner views per owner (default 50) and trace_query.saved_views_total in all (default 10000): 409 view_capacity. Audited as saved_view.create.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
Request body (required)
application/json: SavedViewInput
Responses
| Status | Description | Body |
|---|---|---|
201 |
The stored view | application/json: SavedView |
400 |
invalid_request | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
role_forbidden: no saved_views:save, a shared token, or no saved_views:share for the team or organization; or a missing CSRF token | — |
404 |
trace_query disabled (feature_disabled) | — |
409 |
view_capacity | — |
422 |
invalid_view or invalid_view_definition | — |
PUT /api/v1/admin/views/default
Section titled “PUT /api/v1/admin/views/default”PUT /api/v1/admin/views/default · operation setDefaultSavedView
Saved views (T186.007, trace_query). Sets or clears the caller’s default view of a screen: the view the screen opens with when it is opened with no question of its own. A default is the caller’s own choice among the views it sees; it changes nothing for anyone else. Requires saved_views:save in a named session.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
Request body (required)
application/json: objectsurface(string, required, one of"traces","logs")id(string, required, pattern^sv_[a-f0-9]{24}$, nullable) — null clears the default
Responses
| Status | Description | Body |
|---|---|---|
200 |
The default as stored | — |
400 |
invalid_request | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
role_forbidden: no saved_views:save in a named session, or a view of another screen | — |
404 |
view_not_found (a view the caller does not see), or trace_query disabled | — |
GET /api/v1/admin/views/{id}
Section titled “GET /api/v1/admin/views/{id}”GET /api/v1/admin/views/{id} · operation getSavedView
Saved views (T186.007, trace_query). One view the caller sees; a view outside its own, its teams’ and its organizations’ answers 404. ETag is the version. Requires saved_views:read.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id |
path | string, required, pattern ^sv_[a-f0-9]{24}$ |
Responses
| Status | Description | Body |
|---|---|---|
200 |
The view | application/json: SavedView |
400 |
invalid_id | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
view_not_found, or trace_query disabled | — |
PUT /api/v1/admin/views/{id}
Section titled “PUT /api/v1/admin/views/{id}”PUT /api/v1/admin/views/{id} · operation updateSavedView
Saved views (T186.007, trace_query). Replaces a view at version (compare-and-set, 409 version_conflict). A private view is edited by its owner; a team’s or an organization’s view is the team’s or the organization’s, edited by whoever holds saved_views:share for it (its author keeps no right over it but to remove it). Moving a view to another team or organization takes saved_views:share for the target; a view never changes screen. Audited as saved_view.update.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id |
path | string, required, pattern ^sv_[a-f0-9]{24}$ |
|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
Request body (required)
application/json: SavedViewInput and object- All of (1): SavedViewInput
- All of (2): object
version(integer, required, min 1)
Responses
| Status | Description | Body |
|---|---|---|
200 |
The stored view | application/json: SavedView |
400 |
invalid_request or invalid_id | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
role_forbidden | — |
404 |
view_not_found, or trace_query disabled | — |
409 |
version_conflict | — |
422 |
invalid_view or invalid_view_definition | — |
DELETE /api/v1/admin/views/{id}
Section titled “DELETE /api/v1/admin/views/{id}”DELETE /api/v1/admin/views/{id} · operation deleteSavedView
Saved views (T186.007, trace_query). Removes a view at version: its owner, or whoever holds saved_views:share for the team or organization it belongs to. Audited as saved_view.delete.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id |
path | string, required, pattern ^sv_[a-f0-9]{24}$ |
|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
version |
query | integer, required, min 1 |
Responses
| Status | Description | Body |
|---|---|---|
204 |
Removed | — |
400 |
invalid_request or invalid_id | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
role_forbidden | — |
404 |
view_not_found, or trace_query disabled | — |
409 |
version_conflict | — |
GET /api/v1/admin/traces/{trace_id}/records
Section titled “GET /api/v1/admin/traces/{trace_id}/records”GET /api/v1/admin/traces/{trace_id}/records · operation getTraceRecords
Trace explorer (T186.006), the Logs tab. The gateway’s own records of a trace (scope trace) or of one span (scope span with span_id), oldest first, each with its time, kind, title, detail and the console screen that holds it: request_log, charge_line (attempt_charge_lines, readers who see cost), delivery_receipt (durable_usage, analytics:read), quota_reservation (quotas:read), guardrail, span_event, content_capture (the record’s metadata, for readers with content_structure:read of the team), evaluation (evals:read), alert (alert_rules, alert_rules:read) and audit (audit:read, gateway-wide roles). Every record is bounded by the teams of the spans the reader sees. A span’s records are those naming the span, plus its request’s for a request span and its request’s charge lines for a provider attempt. counts answers both scopes. At most 200 records of each kind (truncated). A trace or span the reader cannot see answers 404, as a missing one.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
trace_id |
path | string, required, pattern ^[0-9a-f]{32}$ |
|
span_id |
query | string, pattern ^[0-9a-f]{16}$ |
|
scope |
query | string, one of "span", "trace" |
Default: span when span_id is given, else trace |
Responses
| Status | Description | Body |
|---|---|---|
200 |
The records | application/json: object |
400 |
invalid_span_id or invalid_request | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
trace_not_found or span_not_found (also for another team’s), or the explorer disabled (feature_disabled) | — |
503 |
analytics_store_unavailable or storage_unavailable | — |
Response 200 fields:
application/json: objecttrace_id(string, required)scope(string, required, one of"span","trace")span_id(string)truncated(boolean, required)log_link(string (uri)) — spans.log_link_template filled with the trace’s idskinds(array of string, required)counts(object, required)trace(integer, required)span(integer)
records(array of object, required)time(string (date-time), required)kind(string, required, one of"request_log","charge_line","delivery_receipt","quota_reservation","guardrail","span_event","content_capture","evaluation","alert","audit")title(string, required)detail(string)request_id(string)span_id(string)status(string, one of"ok","error")link(string, one of"request","receipts","audit","content","evaluations","alerts")link_id(string)amount_usd(string) — A charge line’s amount, with usage_valuation and analytics:read
GET /api/v1/admin/traces/{trace_id}/configuration
Section titled “GET /api/v1/admin/traces/{trace_id}/configuration”GET /api/v1/admin/traces/{trace_id}/configuration · operation getTraceConfiguration
Trace explorer (T186.006), Configuration at the time. With trace_explorer on, each stored request span carries config_fingerprint (16 hex characters over the hash of every section of the configuration it was served with, computed once per configuration load), config_version (the control version), policy_revisions (the revisions of the policies it read: its team’s policy, its model and its provider; with team_policy_enforcement the team’s is the revision of the policy in force, a stored override included) and translation_lossy (what a translation between APIs approximated or left out). This read compares them with the configuration in force now: same, the current fingerprint and version, and policies, each section the request read as unchanged, changed, added or removed. A gateway-wide reader of the configuration (config:read) also gets changed, added and removed: the names of every section that differs (models[chat-default], team_policies[team], features.usage_valuation), never a value. known false says the gateway kept no section list for the span’s fingerprint. Requires trace_explorer, span_store, usage_analytics and logs:read of the span’s team.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
trace_id |
path | string, required, pattern ^[0-9a-f]{32}$ |
|
span_id |
query | string, required, pattern ^[0-9a-f]{16}$ |
Responses
| Status | Description | Body |
|---|---|---|
200 |
The comparison | application/json: object |
400 |
invalid_span_id | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
span_not_found (also for another team’s), or the explorer disabled (feature_disabled) | — |
503 |
analytics_store_unavailable or storage_unavailable | — |
Response 200 fields:
application/json: objecttrace_id(string, required)span_id(string, required)recorded(boolean, required) — false for a span stored before the explorer was onfingerprint(string, required)version(integer or null)current(object, required)fingerprint(string, required)version(integer, required)
same(boolean, required)policies(array of object, required, max items 3)section(string, required)state(string, required, one of"unchanged","changed","added","removed")
translation_lossy(array of string)changes_shown(boolean, required)known(boolean)changed(array of string)added(array of string)removed(array of string)first_seen(string (date-time)) — When the gateway first ran with the span’s configuration
GET /api/v1/admin/traces/{trace_id}
Section titled “GET /api/v1/admin/traces/{trace_id}”GET /api/v1/admin/traces/{trace_id} · operation getTrace
Span store (T186.002). Requires span_store, usage_analytics and logs:read. The stored spans of one W3C trace id in the session’s teams, oldest first (at most 2000; truncated says more exist), from the live table and the retained copy of annotated traces. Team-scoped roles read only their live memberships’ spans, filtered in SQL before the bound: a trace that crosses teams shows each reader only their own spans and never counts the others. The summary is returned only when every returned span belongs to one team. Tags, session and end user follow usage_tags, session_tracking and end_user_tracking; cost_state and cost_usd appear only with usage_valuation plus analytics:read (valuation_shown). links holds the operator’s spans.log_link_template and spans.apm_link_template filled with the trace’s ids. source is database, or analytics_store (T186.018) when the database’s retention already dropped the trace and the analytics store copy (analytics_store_spans) still holds it, filtered by team in its query; such a trace has no summary. With evaluation_results (T186.003) and evals:read, evaluations lists the trace’s results in the reader’s teams (at most 500) and each appears as a gen_ai.evaluation.result event on the span it judged, which gains gateway.evaluation.count and gateway.evaluation.fail_count. With spans.engine analytics_store (T186.017) every trace is read from the analytics store (source analytics_store, with its summary folded from the summary rows, and retained annotated traces), and a trace written before the switch from the database. Without spans the 404 says why from the request log rows of the trace: spans_expired, spans_sampled_out or trace_not_found. Spans never carry content.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
trace_id |
path | string, required, pattern ^[0-9a-f]{32}$ |
Responses
| Status | Description | Body |
|---|---|---|
200 |
The trace | application/json: Trace |
400 |
Invalid input | application/json: Error |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
No span of this trace in the session’s teams: error.code spans_expired, spans_sampled_out or trace_not_found; or span_store disabled (feature_disabled) | — |
503 |
Span storage unavailable (storage_unavailable), or the analytics store copy could not be read (analytics_store_unavailable) | — |
GET /api/v1/admin/traces/{trace_id}/spans/{span_id}
Section titled “GET /api/v1/admin/traces/{trace_id}/spans/{span_id}”GET /api/v1/admin/traces/{trace_id}/spans/{span_id} · operation getTraceSpan
Span store (T186.002). One span of a trace, from the engine spans.engine selects (T186.017), with the same authorization and field rules as the trace read, and its capture state (captured when content capture stored the request’s bodies; the span itself never holds content). With evaluation_results and evals:read, evaluations lists the results that judged this span.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
trace_id |
path | string, required, pattern ^[0-9a-f]{32}$ |
|
span_id |
path | string, required, pattern ^[0-9a-f]{16}$ |
Responses
| Status | Description | Body |
|---|---|---|
200 |
The span | application/json: object |
400 |
Invalid input | application/json: Error |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
Span not visible to this session, or span_store disabled (feature_disabled) | — |
503 |
Span storage unavailable (storage_unavailable), or the analytics store could not be read with engine analytics_store (analytics_store_unavailable) | — |
Response 200 fields:
application/json: objectspan(Span, required)capture_state(string, required, one of"not_captured","audit_only","evaluation") — T186.005 (content_capture_evaluation): whether the request’s content was kept by content capture and for what. audit_only: only people with a content:read grant may read it; evaluation: judges and reviewers may read its sent view and answer. The span carries the record ID as capture_id, never content. not_captured also covers a request captured with the flag off.valuation_shown(boolean, required)
POST /api/v1/admin/traces/summaries/rebuild
Section titled “POST /api/v1/admin/traces/summaries/rebuild”POST /api/v1/admin/traces/summaries/rebuild · operation rebuildTraceSummaries
Span store (T186.002). Requires span_store and analytics:rebuild (global administrators). Recomputes the trace summaries of every trace with a span started in the UTC days from..to (at most 31 days apart, default the last 7), and the session summaries of the sessions those traces touch, from the stored spans, in one transaction. Summaries are derived data; this is their definition. With spans.engine analytics_store (T186.017) the summary rows of those traces are replaced by one folded row per team and trace, recomputed from the analytics store’s spans, in chunks of 1000 traces; sessions counts the distinct sessions of the rebuilt rows.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
from |
query | string (date) | |
to |
query | string (date) |
Responses
| Status | Description | Body |
|---|---|---|
200 |
What was rebuilt | application/json: object |
400 |
Invalid input | application/json: Error |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
Feature disabled | application/json: Error |
503 |
Span storage unavailable | — |
Response 200 fields:
application/json: objecttraces(integer, required, min 0)sessions(integer, required, min 0)
GET /api/v1/admin/span-store
Section titled “GET /api/v1/admin/span-store”GET /api/v1/admin/span-store · operation spanStoreStatus
Span store (T186.002). Requires span_store and config:read. The writer of this replica (queue depth and size, requests queued, spans by kind and result: written, sampled_out, dropped_queue_full, dropped_write_failed, dropped_trace_limit; ledger_reads, requests whose costs were read back from the ledger because the request did not carry them; batches; last error class; last write), the storage (daily partitions with planner row estimates, oldest and newest day, estimated spans, traces and sessions, retained annotated traces, and write_lag_seconds: this replica’s latest written batch, from the end of its oldest request to the commit, also in writer.write_lag_seconds), the retention applied (spans.retention_days, never longer than an active metadata retention), the policy in force, the writer’s startup settings and, with analytics_store_spans and engine database, the span copy state. engine (T186.017) is spans.engine; with analytics_store the storage block describes the analytics store’s span table (active parts per day as partitions, their row counts, approximate distinct traces and sessions, retained traces); while the analytics store cannot be read the answer is still 200, with the writer’s counters and storage.unavailable analytics_store_unavailable.
Authentication: adminSession
Responses
| Status | Description | Body |
|---|---|---|
200 |
Span store status | application/json: object |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
Feature disabled | application/json: Error |
503 |
Span storage unavailable (storage_unavailable) | — |
Response 200 fields:
application/json: objectengine(string, required, one of"database","analytics_store")writer(object, required)storage(object, required)retention_days(integer, required, min 1)policy(SpanStorePolicy, required)writer_settings(SpanStoreWriter, required)analytics_copy(object)
GET /api/v1/admin/span-store/settings
Section titled “GET /api/v1/admin/span-store/settings”GET /api/v1/admin/span-store/settings · operation spanStoreSettings
Span store settings (T186.002). Requires span_store and config:read. The runtime policy in force (spans), the stored override or null, the YAML base with defaults (yaml), the source of each setting (default, yaml or console), the writer’s startup settings with their sources (restart to change), the retention applied and the current control version for an update.
Authentication: adminSession
Responses
| Status | Description | Body |
|---|---|---|
200 |
Effective settings and their sources; no-store. | application/json: object |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
Feature disabled | application/json: Error |
503 |
Configuration storage unavailable. | — |
Response 200 fields:
application/json: objectversion(integer, required, min 0)spans(SpanStorePolicy, required)override(SpanStorePolicy or null, required)- Any of (1): SpanStorePolicy
- Any of (2): null
yaml(SpanStorePolicy, required)sources(object, required)- any other key: string
writer(SpanStoreWriter, required)writer_sources(object, required)- any other key: string
retention_days_applied(integer, required, min 1)restart_required(false, required)writer_restart_required(true, required)applies_to("next_request", required)
PUT /api/v1/admin/span-store/settings
Section titled “PUT /api/v1/admin/span-store/settings”PUT /api/v1/admin/span-store/settings · operation setSpanStoreSettings
Save the whole runtime policy as an override (span_store, global features:manage, CSRF, the current version, atomic audit span_store.set). Every member is required; extra, null or out-of-bound members are refused with the setting named. Applies from the next request on every replica after its configuration refresh; the writer’s startup settings are not part of it.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
Request body (required)
application/json: objectversion(integer, required, min 0)spans(SpanStorePolicy, required)
Responses
| Status | Description | Body |
|---|---|---|
204 |
Policy committed with version and audit. | — |
400 |
Invalid input | application/json: Error |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
Feature disabled | application/json: Error |
409 |
Current control version does not match; no mutation committed. | — |
503 |
Configuration storage unavailable. | — |
DELETE /api/v1/admin/span-store/settings
Section titled “DELETE /api/v1/admin/span-store/settings”DELETE /api/v1/admin/span-store/settings · operation revertSpanStoreSettings
Remove the override and return to the YAML (span_store, global features:manage, CSRF, the current version, audit span_store.revert). 404 when no override is stored.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
Request body (required)
application/json: objectversion(integer, required, min 0)
Responses
| Status | Description | Body |
|---|---|---|
204 |
Override removed with version and audit. | — |
400 |
Invalid input | application/json: Error |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
No override stored, or span_store disabled (feature_disabled) | — |
409 |
Current control version does not match; no mutation committed. | — |
503 |
Configuration storage unavailable. | — |
POST /api/v1/admin/client-sources/erase
Section titled “POST /api/v1/admin/client-sources/erase”POST /api/v1/admin/client-sources/erase · operation eraseClientSources
T033.003. Global administrators with retention:manage delete stored client addresses of one request ID, or every address inside one IP address or CIDR (at least /8 for IPv4, /32 for IPv6). Works with client_source_metadata off, so collected addresses can always be erased. Usage events, durable receipts and the ledger are untouched. The erasure is audited as client_source.erase with the count; the audit target names the request ID but never repeats an erased address.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
Request body (required)
application/json: object — Exactly one of request_id or client_iprequest_id(string, pattern^[A-Za-z0-9._:-]{1,128}$)client_ip(string, max length 64)
Responses
| Status | Description | Body |
|---|---|---|
200 |
Addresses erased | application/json: object |
400 |
Invalid input | application/json: Error |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
503 |
Storage unavailable | — |
Response 200 fields:
application/json: objectdeleted(integer, required, min 0)
GET /api/v1/admin/insights/failures
Section titled “GET /api/v1/admin/insights/failures”GET /api/v1/admin/insights/failures · operation getFailureInsights
Failure insights (T186.015, failure_insights, a tenant read): the failures of the range (and of q, the spans scope of the query language) grouped by team and kind: provider_send (a failed provider send, by provider, alias, provider model, outcome and HTTP status), tool_call (a failed tool call, by server and tool) and gateway_error (a request that failed with no failed send under it, by problem code and status), most frequent first, with count, distinct traces, first and last seen, up to five evidence traces, a fingerprint and the triage status the team gave it (open when none; a resolved group seen again after it was resolved reads open). gateway_version is the answering gateway’s build. Reads the reader’s teams on the span engine the trace explorer reads. Requires failure_insights, usage_valuation, span_store, usage_analytics and logs:read.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
q |
query | string, max length 4096 | |
from |
query | string (date-time) | |
to |
query | string (date-time) | |
status |
query | string, one of "open", "acknowledged", "resolved", "ignored" |
|
scope |
query | string, one of "spans" |
Responses
| Status | Description | Body |
|---|---|---|
200 |
The failure groups | application/json: object |
400 |
invalid_request or invalid_query | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
feature_disabled | — |
503 |
storage_unavailable, analytics_store_unavailable or query_timeout | — |
Response 200 fields:
application/json: objectfrom(string (date-time), required)to(string (date-time), required)query(string, required)gateway_version(string, required)status_counts(object, required)- any other key: integer
truncated(boolean, required)read_store(string, required, one of"database","analytics_store")groups(array of object, required, max items 500)kind(string, required, one of"provider_send","tool_call","gateway_error")team_id(string, required)provider(string)model(string)provider_model(string)outcome(string)status(string, required, one of"open","acknowledged","resolved","ignored")error_code(string)server(string)tool(string)count(integer, required)traces(integer, required)first_seen(string (date-time), required)last_seen(string (date-time), required)evidence_traces(array of string, required, max items 5)fingerprint(string, required, pattern^[a-f0-9]{32}$)note(string)status_version(integer, required)status_updated_by(string)status_updated_at(string (date-time))
PUT /api/v1/admin/insights/failures/{fingerprint}
Section titled “PUT /api/v1/admin/insights/failures/{fingerprint}”PUT /api/v1/admin/insights/failures/{fingerprint} · operation setFailureInsightStatus
Triage one team’s failure group (insights:manage, a team the session administers): status open, acknowledged, resolved or ignored and an optional note (500 characters), at expected_version (0 when none was recorded). Audited (insight.status.<status>), logged insight_status_changed.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
fingerprint |
path | string, required, pattern ^[a-f0-9]{32}$ |
Request body (required)
application/json: objectteam_id(string, required)status(string, required, one of"open","acknowledged","resolved","ignored")note(string, max length 500)expected_version(integer, min 0)
Responses
| Status | Description | Body |
|---|---|---|
200 |
Saved | — |
400 |
invalid_request | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Forbidden, or entitlement_forbidden | — |
404 |
not_found (a team the session does not administer) or feature_disabled | — |
409 |
version_conflict | — |
503 |
storage_unavailable | — |
GET /api/v1/admin/sessions/{id}
Section titled “GET /api/v1/admin/sessions/{id}”GET /api/v1/admin/sessions/{id} · operation sessionSummary
Aggregate of one client-declared session (requests, errors, first/last time, duration, tokens, models, distinct keys and up to 20 end users) within the session’s team scope and range (default last 24 hours, at most 90 days). Requires session_tracking, request_logs and logs:read. With evaluation_results and evals:read, evaluations lists the results on the session and on its requests (T186.003).
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id |
path | string, required, min length 1, max length 128 | |
team |
query | string | |
from |
query | string (date-time) | Start of the time window, an RFC 3339 timestamp. |
to |
query | string (date-time) | End of the time window, an RFC 3339 timestamp. |
Responses
| Status | Description | Body |
|---|---|---|
200 |
Session summary (zero requests when nothing matches) | application/json: object |
400 |
Invalid input | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
Feature disabled | application/json: Error |
Response 200 fields:
application/json: objectevaluations(array of EvaluationResult)session_id(string, required)requests(integer, required)errors(integer, required)first_at(string (date-time))last_at(string (date-time))duration_ms(integer, required)input_tokens(integer, required)output_tokens(integer, required)models(array of string, required)providers(array of string)keys(integer, required)end_users(array of string, required)
GET /api/v1/admin/sessions/{id}/graph
Section titled “GET /api/v1/admin/sessions/{id}/graph”GET /api/v1/admin/sessions/{id}/graph · operation agentSessionGraph
Agent session graph (T033.002). Requires agent_sessions, session_tracking, request_logs, usage_analytics and logs:read. Returns the first 200 steps of one client-declared session in the range (default last 24 hours, at most 90 days): model calls (usage events) and MCP tool executions, each with observed facts (request, trace and span IDs, the client’s W3C parent span, status, duration, tokens, finish reasons, tool grant) and asserted labels (agent, turn), plus agent/turn/trace groups, edges (caused_by_span observed; same_turn_next asserted), asserted parent sessions, up to 50 child sessions with their own step counts, totals over the listed steps that never include child sessions (token sums null when unreported), and explicit gaps. Scoped roles read only their live memberships, applied in SQL before every bound; a missing and an out-of-scope session answer the same 404. Bodies, tool arguments and results are never returned. Answered with Cache-Control: private, no-store.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id |
path | string, required, min length 1, max length 128 | |
from |
query | string (date-time) | Start of the time window, an RFC 3339 timestamp. |
to |
query | string (date-time) | End of the time window, an RFC 3339 timestamp. |
Responses
| Status | Description | Body |
|---|---|---|
200 |
Session graph | application/json: object |
400 |
Invalid input | application/json: Error |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
Session not visible to this session’s teams in the range, or agent_sessions/session_tracking/request_logs/usage_analytics disabled (feature_disabled) | — |
Response 200 fields:
application/json: objectsession_id(string, required)observed_at(string (date-time), required) — Database time of the read; later or late-written steps appear on the next read.from(string (date-time), required)to(string (date-time), required)parent_sessions(array of object, required, max items 5)session_id(string, required)basis(string, required, one of"asserted")visible(boolean, required) — Whether this session may read a step of that parent in the range.
parent_sessions_truncated(boolean)child_sessions(array of object, required, max items 50)session_id(string, required)basis(string, required, one of"asserted")steps(integer, required)first_at(string (date-time), required)last_at(string (date-time), required)
child_sessions_truncated(boolean)agents(array of AgentGraphGroup, required)turns(array of AgentGraphGroup, required)traces(array of AgentGraphGroup, required)steps(array of object, required, max items 200)index(integer, required)kind(string, required, one of"model_call","tool_call")at(string (date-time), required)offset_ms(integer, required) — Milliseconds after the first step.request_id(string, required)trace_id(string, required)span_id(string or null) — The gateway’s server span (observed).parent_span_id(string or null) — Parent span from the client’s traceparent (observed as sent).key_id(string, required)principal(string, required)operation(string, required)model(string, required)provider(string or null)status(integer, required)outcome(string, required, one of"success","client_error","rate_limited","blocked","timeout","client_closed","server_error")duration_ms(integer, required)input_tokens(integer or null)output_tokens(integer or null)finish_reasons(array of string, required, max items 16)tool_requested(boolean, required) — A finish reason asked for a tool (tool_calls, tool_use, function_call).tool_name(string or null) — Configured MCP tool grant of a tool_call step.tool_server(string or null)agent_id(string or null) — Asserted by X-Gateway-Agent-Id.turn_id(string or null) — Asserted by X-Gateway-Turn-Id.agent_context_recorded(boolean, required)
steps_truncated(boolean, required)edges(array of object, required)from(integer, required)to(integer, required)relation(string, required, one of"caused_by_span","same_turn_next")basis(string, required, one of"observed","asserted")
totals(object, required) — Over the listed steps only (truncated says when later steps exist).steps(integer, required)model_calls(integer, required)tool_calls(integer, required)errors(integer, required)duration_ms(integer, required)input_tokens(integer or null, required) — Null when no model call reported input tokens; unknown is not zero.output_tokens(integer or null, required)input_reported_steps(integer, required)output_reported_steps(integer, required)child_sessions(integer, required)truncated(boolean, required)includes_child_sessions(boolean, required, one offalse)
gaps(array of object, required)code(string, required)stage(string, required)message(string, required)
basis(object, required)- any other key: string
GET /api/v1/admin/agent-runs
Section titled “GET /api/v1/admin/agent-runs”GET /api/v1/admin/agent-runs · operation listAgentRuns
Agent runs (T186.019). Requires agent_recognition, agent_sessions, session_tracking, request_logs, usage_analytics and logs:read; under plan entitlements the team plan must include agent_sessions and agent_recognition. The coding-agent runs the gateway recognized from traffic (or a transcript upload named) that were active in the range, most recent first, with the distinct agent names seen in it. A run is active in the range when its last request is at or after from and its first before to. Team-scoped roles read only the runs of their live memberships, and every reader only the rows recorded under the team’s current organization; both filters run in SQL before the page bound. Each run carries its task as a state: the text itself only when agent_recognition.task_capture kept it, it has not expired or been erased, content_capture is on and the reader holds content_sent:read of the run’s team, and each such read is audited as agent_run_task.read before the text is decrypted. Prompts, answers, tool arguments and tool results are never part of a run.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
from |
query | string (date-time) | Default: 24 hours before to |
to |
query | string (date-time) | Default: one minute from now; at most 92 days after from |
team |
query | string, max length 256 | Only this team; a team outside the session membership answers 403 team_forbidden. An organization administrator may name a team that left its organization and reads the runs it recorded there. |
agent |
query | string, max length 256 | Exact agent name, one of agents |
key |
query | string, max length 256 | Exact key ID |
principal |
query | string, max length 256 | Exact principal (user or service account) of the key |
run |
query | string, max length 256 | Run ID prefix |
scope |
query | string, one of "roots", "all", default "roots" |
roots leaves out the runs another run spawned (subagents); all lists every run |
limit |
query | integer, default 50, min 1, max 200 |
Runs per page |
cursor |
query | string | next_cursor of the page before |
Responses
| Status | Description | Body |
|---|---|---|
200 |
One page of runs | application/json: AgentRunPage |
400 |
invalid_range (from must be before to, both RFC 3339, at most 92 days apart) or invalid_request (a filter longer than 256 printable characters, scope, limit or cursor) | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
team_forbidden (the team filter is outside the session membership), a role without logs:read, or entitlement_forbidden | — |
404 |
agent_recognition, agent_sessions, session_tracking, request_logs or usage_analytics disabled (feature_disabled) | — |
503 |
storage_unavailable | — |
GET /api/v1/admin/agent-runs/settings
Section titled “GET /api/v1/admin/agent-runs/settings”GET /api/v1/admin/agent-runs/settings · operation agentRecognitionSettings
Agent recognition as the gateway applies it (T186.019). Requires config:read. The effective agent_recognition block with defaults filled in, each field’s source (yaml or default), the client rules in the order they are tried (the operator’s first, then the shipped ones unless builtin_clients is false) each with the source of its facts, whether recognition and transcript ingest are on with their dependencies, whether task capture can keep text, and which secret keys the derived run IDs and task hashes. Answered whatever the flags say, so the panel can show what turning them on would apply. The block is read on every request: a configuration change applies to the next request, with no restart.
Authentication: adminSession
Responses
| Status | Description | Body |
|---|---|---|
200 |
Effective settings | application/json: AgentRecognitionSettings |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
A role without config:read | — |
GET /api/v1/admin/agent-runs/{id}
Section titled “GET /api/v1/admin/agent-runs/{id}”GET /api/v1/admin/agent-runs/{id} · operation readAgentRun
One agent run as a thread (T186.019). Requires agent_recognition, agent_sessions, session_tracking, request_logs, usage_analytics, span_store and logs:read; under plan entitlements the team plan must include agent_sessions and agent_recognition. Returns the run, the run that spawned it when the reader’s scope holds it, the runs it spawned directly or through its subagents (at most 100, four levels), the runs that continue it or that it continues after a compaction (at most 20), and the steps of the run and of its first 19 branches in time order, read from the engine spans.engine selects (the latest 1,000 spans of each run). A step is a model call the gateway served (observed), a tool step the client’s next request reported (reported: name and call ID only, no duration), a step a transcript upload named (uploaded), or a compaction divider. A compacted context window is identified by the summary it began with, so one compaction gives one divider. Tool names are returned only to readers with content_structure:read of the run’s team, costs only to readers who see valuation. A run is never returned as its own branch. gaps says what a run never shows and what this read left out. A missing run, a run of another team or organization and a team outside the membership answer the same 404.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id |
path | string, required, min length 1, max length 128 | Run ID as listAgentRuns returns it |
team |
query | string, max length 256 | The run’s team, when several teams of the reader use the same run ID; without it the most recent row is read |
Responses
| Status | Description | Body |
|---|---|---|
200 |
The run’s thread | application/json: AgentRunThread |
400 |
invalid_run_id (1-128 printable characters) | — |
401 |
Missing or invalid bearer key | application/json: Error |
403 |
A role without logs:read, or entitlement_forbidden | — |
404 |
run_not_found, or agent_recognition, agent_sessions, session_tracking, request_logs, usage_analytics or span_store disabled (feature_disabled) | — |
503 |
query_timeout, analytics_store_unavailable or storage_unavailable | — |