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
- Model calls: exactly the upstream provider's public rate. Zero markup.
- Top-up fee: 10%, and this is our only revenue. Example: pay $100, $90.00 lands in your balance.
- Failed requests are never charged and never touch your balance.
- No monthly fee, no minimum spend, no token bundles you're locked into.
Peak windows, caching and context tiers
- Where the upstream has peak/off-peak rates (e.g. deepseek-flash), we bill by the time the request actually happened. Peak is 2× off-peak.
- Peak window: 01:00–04:00 and 06:00–10:00 UTC, Monday to Friday. Every other hour is off-peak.
- Input tokens that hit the provider's prompt cache are billed at the cache rate (as low as 1/50 of standard). The saving is passed to you in full.
- Some models are tiered by the input length of a single request; rates rise above 128K.
- On models with a thinking mode, output is billed at the thinking rate — see the pricing page.
Balance and bills
- Signing up grants $1.00 of credit — enough to run the whole integration without adding a card.
- Balances are in USD and charges are exact to 1e-9 USD. The ledger stores integers, so there is no floating-point drift.
- Every line in the console's bill expands to: input / cache-read / cache-write / output cost, token breakdown, peak flag, request_id, latency and the price-table version used.
- Filter by model and export CSV — usable directly for internal cost allocation.
- Lines appear within 1–2 minutes of the call (upstream metering is written in batches).
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) / modelsFor 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.