Native router metrics (role-scoped: own rows vs everything)
curl --request GET \
--url https://api.example.com/api/airouter/metrics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/airouter/metrics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/airouter/metrics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/airouter/metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/airouter/metrics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/airouter/metrics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/airouter/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"scope": "user",
"range_days": 123,
"available": true,
"message": "<string>",
"pricing_available": true,
"kpis": {
"requests": 0,
"total_tokens": 0,
"prompt_tokens": 0,
"completion_tokens": 0,
"est_spend_usd": 0,
"blocked": 0,
"p95_latency_ms": 0,
"cache_hit_rate": 0
},
"by_model": [
{
"model": "<string>",
"provider": "<string>",
"requests": 0,
"total_tokens": 0,
"est_spend_usd": 0
}
],
"by_decision": [
{
"decision": "<string>",
"requests": 0,
"total_tokens": 0
}
],
"over_time": [
{
"bucket": "<string>",
"requests": 0,
"total_tokens": 0,
"est_spend_usd": 0
}
],
"top_users": [
{
"user_id": "<string>",
"requests": 0,
"total_tokens": 0,
"est_spend_usd": 0
}
],
"top_teams": [
{
"team": "<string>",
"requests": 0,
"total_tokens": 0,
"est_spend_usd": 0
}
],
"user_filter": "<string>",
"team_filter": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}AI control plane
Native router metrics (role-scoped: own rows vs everything)
Aggregated metrics over router_replay. An nx1_airouter_admin
sees everything (with per-user and per-team leaderboards) and may narrow
it to one user_id and/or one team (realm role); any other
authenticated caller is scoped to their own rows by username.
GET
/
api
/
airouter
/
metrics
Native router metrics (role-scoped: own rows vs everything)
curl --request GET \
--url https://api.example.com/api/airouter/metrics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/airouter/metrics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/airouter/metrics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/airouter/metrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/airouter/metrics"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/airouter/metrics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/airouter/metrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"scope": "user",
"range_days": 123,
"available": true,
"message": "<string>",
"pricing_available": true,
"kpis": {
"requests": 0,
"total_tokens": 0,
"prompt_tokens": 0,
"completion_tokens": 0,
"est_spend_usd": 0,
"blocked": 0,
"p95_latency_ms": 0,
"cache_hit_rate": 0
},
"by_model": [
{
"model": "<string>",
"provider": "<string>",
"requests": 0,
"total_tokens": 0,
"est_spend_usd": 0
}
],
"by_decision": [
{
"decision": "<string>",
"requests": 0,
"total_tokens": 0
}
],
"over_time": [
{
"bucket": "<string>",
"requests": 0,
"total_tokens": 0,
"est_spend_usd": 0
}
],
"top_users": [
{
"user_id": "<string>",
"requests": 0,
"total_tokens": 0,
"est_spend_usd": 0
}
],
"top_teams": [
{
"team": "<string>",
"requests": 0,
"total_tokens": 0,
"est_spend_usd": 0
}
],
"user_filter": "<string>",
"team_filter": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
OAuth2AuthorizationCodeBearerAPIKeyHeader
Query Parameters
Response
Successful Response
Aggregated router metrics, scoped by the caller's role.
Was this page helpful?

