Apache Casbin Gateway
4. Governance

4.3 Usage and model pricing

Usage

An agent on its own subscription relays nothing through Gateway, and a request that goes straight to the vendor leaves no record here — but the agent writes a transcript of it on disk anyway.

Usage reads those transcripts. So the spend of every agent on this machine is on one page from the first start, with no provider configured and nothing routed.

Usage

Two tabs:

TabCoversKnows
Agent spendEvery agent on this machine, routed or notTokens, cache hit rate and cost, over time and by model and by agent
Relayed spendOnly the traffic that came through GatewayThe above, plus which provider answered and whether it failed

The first is the complete account of what this machine costs you. The second is the only one that can tell you which upstream the money went to.

Model pricing

Every figure on the Usage page is worked out from Model pricing, a table of what a million tokens costs.

Model pricing

Vendors change their prices and resellers do not follow, so:

  • Edit a price by hand — that model is then yours, and nothing overwrites it.
  • Or let Gateway reprice the models this machine has run, from the models.dev catalogue, on a schedule. A price you edited yourself is left alone.
SettingEffect
modelsDevSyncModeWhether the catalogue is synced at all
modelsDevSyncIntervalHoursHow often
llmPricingFileA JSON file of your own rates, used instead

A model with no price is counted in tokens and left out of the cost — the Authenticity report says how much of what a provider served is in that state (3.4).

Next: 5.1 Settings and configuration.

Edit on GitHub
Apache Incubator

Apache Casbin (Incubating) is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.

Copyright © 2026 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.

Apache, Apache Casbin, the names of Apache projects, and the feather logo are either registered trademarks or trademarks of The Apache Software Foundation in the United States and/or other countries. All other marks mentioned may be trademarks or registered trademarks of their respective owners.

On this page