Billing & invoices

USD pay-as-you-go with zero model markup: how charges are computed, peak windows, cache discounts and reading your bill.

The formula

charge = non-cached input tokens × input rate + cache-hit input tokens × cache-read rate + cache-write tokens × cache-write rate + output tokens × output rate. Rates are USD per million tokens — see the full rate card. “auto” is billed at the model it routed to; routing itself is free.

What we charge

Peak windows, caching and context tiers

Balance and bills

Querying your balance

curl https://api.aigateway.ltd/key/info \
  -H "Authorization: Bearer ${AIGATEWAY_API_KEY}"
# returns: spend (USD, gateway guard value) / max_budget (USD cap) / models

For the authoritative balance and per-request detail, use the console (/console) — it is computed by the billing engine from provider rate cards. The spend field from /key/info is the gateway's coarse guard value and may differ slightly from your bill.

Requests return 402 once the balance runs out. Set a balance alert in the console or top up ahead of time.
Price table version 2026-09-11.1. Upstreams that bill in CNY are converted at 1 USD = 7.30 CNY; the rate is frozen with the price-table version, so historical bills are unaffected by later rate or FX changes.