Guides
Billing and limits
You pay for the tokens a request actually used, at the model's listed price. What follows is the order in which that happens, and each point where a request can be refused.
What happens to one request
Reserve
Before calling the model, the gateway sets aside the most the request could cost, sized from your prompt and the maximum output you allow. If nothing can cover that amount, the request is refused with
402 insufficient_creditand nothing is charged.Call the model
The request goes to the provider. The reservation is held while the model answers.
Settle
When the answer is complete, the charge is recomputed from the real token counts in
usage, and the rest of the reservation is released. A request that fails before the model answers releases all of it.
Prices
Each model has its own price per million input tokens and per million output tokens, in USD, plus lower prices for cached input where the provider supports caching. The current prices are on Models. Every request, with its tokens and cost, is listed in the console under Request logs.
Which credit pays
An account can hold three kinds of funding. For each request they are tried in this order:
| Order | Source | Pays for |
|---|---|---|
| 1 | Free credit | Models marked free, while the free tier is on. From sign-up bonuses and free-credit codes. |
| 2 | Active plan | Models your plan includes, until one of its usage windows is used up. |
| 3 | Balance | Everything else. Topped up on the Billing page. |
When a plan window is used up, the request moves to your balance only if extra usage is switched on for the plan. Otherwise it is refused with 429 extra_usage_disabled, and the response's details say which window ran out and when it resets.
A plan that offers No Cap can be switched to it once, at purchase or from the Subscription page. That removes the 5-hour and weekly windows, leaving the total cap as the only usage limit; the price, expiry and remaining total do not change. It cannot be switched back off.
A plan can also include a number of free web searches and page reads each period. On a request the plan pays for, those are used first and cost nothing; after that, each search or page read is charged at its price like any other usage. See Plans.
Limits that can refuse a request
Account and plan
| Limit | Refused with | Set by |
|---|---|---|
| Balance too low for the reservation | 402 insufficient_credit | Your top-ups |
| Plan does not include the model | 403 plan_model_not_allowed | Your plan |
| Plan usage window used up | 429 extra_usage_disabled | Your plan and its extra-usage setting |
Per key
| Limit | Refused with | Set by |
|---|---|---|
| Spend cap for the day or month | 429 quota_exceeded | You, on the key |
| Requests per minute | 429 rate_limit_exceeded | Your key or plan |
| Requests running at once | 429 concurrency_limit_exceeded | Your key or plan |
Per-minute limits are announced before you hit them in the X-RateLimit-*-Requests headers. See Errors for the headers and retry advice.