List stats

Returns the router observability aggregate.

GET /v1/ai/router/stats

Addresshttps://api.hanzo.ai/v1/ai/router/stats
MethodGET
Operationget_ai_router_stats
AuthAuthorization: Bearer $HANZO_API_KEY

Returns the router observability aggregate. Two scopes, one route:

  • ?scope=platform — PUBLIC-safe aggregate over ALL orgs, no authentication. Emits rates, shares, per-task/per-model counts, throughput, and the cost RATIO (saved_pct) + counterfactual model id, but NEVER absolute $ levels, org identity, raw events, or feature vectors. This is what world.hanzo.ai polls.
  • default (org scope) — requires a signed-in principal; scoped to the caller's OWN org (a super admin may pass ?org= to target another org or "" for all). Carries the absolute $/MTok indices for the admin savings panel.

Window: ?since= (RFC3339) or ?hours= (default 24, capped). Aggregates only.

Request

GET /v1/ai/router/stats takes no parameters and no body — the credential is the whole request.

Response

StatusBodyMeaning
200Success.
401—No credential, or one this service does not accept.
403—A valid credential that may not do this.

200 body — 46 fields.

FieldInTypeAlwaysDescription
databodyany—The operation's own result.
data2bodyany—A second result the operation defines, when it has one.
msgbodystringyesEmpty on success, the reason on failure.
statusbodystringyesOne of ok, error.
data.by_modelbodyobject—
data.by_model.*bodyinteger—
data.by_sourcebodyobject—
data.by_source.*bodyinteger—
data.by_taskbodyobject—
data.by_task.*bodyai.TaskStats—
data.by_task.*.eventsbodyinteger—
data.by_task.*.modelsbodyobject—
data.by_task.*.models.*bodyinteger—
data.costbodyai.CostStats—
data.cost.baseline_modelbodystring—
data.cost.counterfactual_indexbodynumber—
data.cost.cumulative_saved_indexbodynumber—
data.cost.priced_eventsbodyinteger—
data.cost.routed_indexbodynumber—
data.cost.saved_pctbodynumber—
data.orgbodystring—
data.qualitybodyai.QualityStats—
data.quality.avg_confidencebodynumber—
data.quality.learned_sharebodynumber—
data.quality.reward_ratebodynumber—
data.quality.rewarded_eventsbodyinteger—
data.quality.shadow_agreementbodynumber—
data.retrainbodyai.RetrainMeta—
data.retrain.eventsbodyinteger—
data.retrain.gate_basebodynumber—
data.retrain.gate_kindbodystring—
data.retrain.gate_metricbodystring—
data.retrain.gate_passedbodyboolean—
data.retrain.gate_valuebodynumber—
data.retrain.notebodystring—
data.retrain.publishedbodyboolean—
data.retrain.trained_timebodystring—
data.retrain.versionbodystring—
data.scopebodystring—
data.throughputbodyai.ThroughputStats—
data.throughput.per_hourbodyinteger[]—
data.throughput.total_windowbodyinteger—
data.windowbodyai.StatsWindow—
data.window.eventsbodyinteger—
data.window.sincebodystring—
data.window.untilbodystring—

Failure carries the platform error shape — see Errors.

Examples

hanzo ai router stats
import { Configuration, AiApi } from 'hanzoai';

const api = new AiApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getAiRouterStats();
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import AiApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = AiApi(client).get_ai_router_stats()
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.AiAPI.GetAiRouterStats(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, ai_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = ai_api::get_ai_router_stats(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.AiApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new AiApi(client).getAiRouterStats();
curl https://api.hanzo.ai/v1/ai/router/stats \
  -H "Authorization: Bearer $HANZO_API_KEY"

MCP declares no tool for ai — tools/list on https://api.hanzo.ai/v1/mcp names the products it does reach. Use HTTP or an SDK.


AI API · All Hanzo APIs · Interactive reference

Was this page useful?