Skip to main content
APISIX reports prompt and completion tokens as two separate metrics from its Prometheus plugin. See the upstream prometheus plugin reference.

What CostGraph scrapes

APISIX only starts reporting LLM metrics after the first AI request passes through it, so an empty scrape before any traffic is expected.

How the metrics map

Both become costgraph_gen_ai_usage_total, with the direction set by which metric the value came from: The unit is always tokens.

Attribute usage to your customers

Nothing to configure. Give each customer its own APISIX consumer; the consumer label is already on every LLM metric, because consumers are APISIX’s own auth identities.

AI gateways

Connecting, pricing, and sending usage yourself.