multi-router.aidocs

API Reference

Traffic

Reading request records, metrics, charts, captured payloads and CSV exports.

The traffic endpoints read the organization's request records, the same data the Traffic page shows. They need the traffic:read scope and have no writes. See Traffic and Request Detail.

Endpoints

MethodPathDescriptionScope
GET/v1/traffic/requestsList requests, newest first, with filters. Paginated, up to 200 per page.traffic:read
GET/v1/traffic/requests/{request_id}Get one request record.traffic:read
GET/v1/traffic/requests/{request_id}/payloadGet a request's captured request and response bodies and headers. With reveal=true, also the originals of redacted values.traffic:read; reveal also traffic:reveal
GET/v1/traffic/metricsList the metrics, stats and dimensions that stats and series accept.traffic:read
GET/v1/traffic/statsAggregate values for the metrics named, as comma-separated metric.stat ids.traffic:read
GET/v1/traffic/seriesChart series for the metrics named, as metric.stat or metric.stat@dimension ids, in buckets of bucket seconds, from 1 to 86400.traffic:read
GET/v1/traffic/exportDownload the matching requests as CSV, newest first, up to 100,000 rows.traffic:read

The requests, stats, series and export endpoints take the same filters: start and end as RFC 3339 or epoch milliseconds, q, router_id, router_kind (static, fallback, weighted, claude_proxy, codex_proxy, gemini_proxy or adaptive_router), rule_id, feature_id, feature_prefix, model, provider, status (2xx, 4xx or 5xx), error_kind, streaming, session_id, correlation_id, comparison_id, role (primary or shadow), customer_user, and the machine identity issuer, subject and binding. An unknown parameter returns 400 unknown_parameter.

Two filters find what a detect_only or logs_only integration would have blocked. would_block=true matches requests where any integration recorded a would_block decision. would_block_by names an integration id, and repeats once per id; it matches requests where one of those integrations recorded would_block. Up to 32 ids of up to 128 characters each are accepted; more ids, or a longer or empty id, return 400 invalid_field. See Integrations.

What one integration would have blockedbash
curl "https://api.multi-router.ai/v1/traffic/requests?would_block_by=int_V3k9Qm2RtL&limit=20" \
  -H "Authorization: Bearer $MR_API_KEY"
Failed requests on one routerbash
curl "https://api.multi-router.ai/v1/traffic/requests?router_id=rt_9Hk3Ws7PzQ&status=5xx&limit=20" \
  -H "Authorization: Bearer $MR_API_KEY"

Each record has the request's router, model, status, tokens, cost_micros, tool_calls, latency_ms, bytes, caller and prompt, and whether a payload is available. The single-request response holds the record in traffic_request. Payloads can contain prompts, headers and credentials sent with the request.

Total cost

cost.total is the summed cost of the matching requests, in micro-dollars (millionths of a US dollar), the same unit as each record's cost_micros. Divide by 1,000,000 for dollars. total in the response is the number of matching requests. Without start, the window is the 24 hours before end, which defaults to now. A window longer than 30 days, the retention period, returns 400 invalid_field for start.

Total cost of one router for a weekbash
curl "https://api.multi-router.ai/v1/traffic/stats?metrics=cost.total,cost.per_req&router_id=rt_9Hk3Ws7PzQ&start=2026-10-01T00:00:00Z&end=2026-10-08T00:00:00Z" \
  -H "Authorization: Bearer $MR_API_KEY"
Response 200json
{
  "organization_id": "org_7Tq2Wd9KxP",
  "values": { "cost.total": 18432750, "cost.per_req": 1843.275 },
  "total": 10000
}

Here the week cost $18.43 (18,432,750 micro-dollars) across 10,000 requests.

Revealing redacted values

A PII redaction integration with log_redaction reversible stores the payload with placeholders, and keeps the originals encrypted. GET .../payload?reveal=true returns the payload with redaction_map, a list of placeholder and original pairs. Ordinary payload reads never include it. Reveal needs traffic:read and traffic:reveal, which only an organization admin can grant and which traffic:read does not include; full control keys hold it. reveal accepts only true, with no other parameter. Every reveal attempt, including refused ones, is recorded in an audit log, and reveal responses carry Cache-Control: no-store.

Revealbash
curl "https://api.multi-router.ai/v1/traffic/requests/req_5Tg8Kd2WmQ/payload?reveal=true" \
  -H "Authorization: Bearer $MR_API_KEY"
Response 200 (excerpt)json
{
  "organization_id": "org_7Tq2Wd9KxP",
  "request_id": "req_5Tg8Kd2WmQ",
  "request": { "body": "{\"messages\":[{\"role\":\"user\",\"content\":\"Email [EMAIL_1] the report\"}]}", "…": "…" },
  "response": { "…": "…" },
  "upstream": null,
  "redaction_map": [["[EMAIL_1]", "jane@example.com"]]
}

A request without stored originals returns 404 payload_unavailable. A key without traffic:reveal returns 403 insufficient_scope, and too many reveals in a minute return 429 rate_limited.

Errors

CodeStatusMeaning
unknown_parameter400The query has a parameter the endpoint does not accept, or reveal is not true.
invalid_field400A filter or metric has an invalid value, or stats and series have no metrics.
insufficient_scope403A reveal from a key without traffic:reveal.
not_found404No request has that id.
payload_not_captured404No payload was captured for this request.
payload_unavailable404The payload was captured but is no longer stored, or payload storage is off.
payload_not_ready409The payload is still being written. Retry after retry_after_seconds.
export_in_progress429Another export is running.
rate_limited429Too many reveals in a minute. Retry later.
payload_read_failed500The stored payload could not be read. Retry.
traffic_unavailable503Traffic is unavailable. Retry.
PromptsTags
Was this helpful?