Models & pricing
GET /api/models returns the public catalog: which models are available and their KhaBot prices.
{
"models": [
{
"id": "z-ai/glm-5.2",
"available": true,
"priced": true,
"input_per_mtok_usd": 3.0,
"output_per_mtok_usd": 5.0,
"cache_read_per_mtok_usd": 0.3,
"cache_write_per_mtok_usd": 3.75
}
]
}
How billing works
Cost is computed from KhaBot's own published per-model prices:
cost_billed = input_tokens/1e6 × input_price
+ output_tokens/1e6 × output_price
+ cache_read_tokens/1e6 × cache_read_price
+ cache_write_tokens/1e6 × cache_write_price
Cache prices fall back to the input price when unset. Prices are per million tokens (Mtok).
A model with no published price isn't available and returns
403 model_not_priced.Live prices are shown on the homepage and your dashboard.