Guides

Usage and billing

How a request’s cost is worked out, what’s set aside before it runs, and where to see every request you’ve made.

On this page

Prepaid credit

  • Credit is prepaid, in US dollars. Every account starts at $0, and models only run once you’ve added some.
  • Top up on the Billing page, from $5 to $500 at a time. Payment is handled by Stripe.
  • The same balance pays for the API and for chat in the dashboard.
  • Nothing tops up by itself: your card is only charged when you choose to add credit.

How a request is priced

Each request is charged for the tokens it used, at the model’s prices per million tokens:

How the cost is worked out
cost = ( input tokens       × input price
       + output tokens      × output price
       + cache read tokens  × cache read price
       + cache write tokens × cache write price ) ÷ 1,000,000
  • The result is rounded to the nearest millionth of a dollar, and a request that used any tokens costs at least $0.000001.
  • Token counts are the model’s own. If a model doesn’t report them, they’re estimated from the size of the request and the reply.
  • The prices are the ones in force when the request ran. Each request on the Usage page keeps the prices it was charged at, so a later price change never alters an old row.
  • Requests that weren’t run, such as those refused for a rate limit or low credit, cost nothing.

For example, on a model priced at $0.12 per million input tokens and $0.50 per million output tokens, a request with 1,200 input tokens and 300 output tokens costs $0.000144 + $0.000150 = $0.000294.

Credit set aside before a reply

Before a reply starts, credit is set aside for the most it could cost: its estimated input plus max_tokens of output, or 16,000 tokens if you didn’t set it. When the reply ends you’re charged what it really cost, and the rest is released straight away.

Requests running at the same time each set aside their own amount. If your balance, less what’s already set aside, can’t cover a new one, it gets insufficient_quota. A realistic max_tokens keeps the amount set aside, and the balance you need, small.

The Usage page

Every request appears on the Usage page, from the API and from chat, a few moments after it ends. It never shows what you sent or what came back: only counts, prices and the outcome.

You canHow
See spending over timeCharts by model for the last 24 hours, 7, 30 or 90 days, or 12 months, with totals by model and by key.
Filter requestsBy model, by status (succeeded, failed, stopped, or not run and why) and by source: an API key, chat or private chat.
Find one requestSearch by its request ID, from the x-request-id header.
See how it was chargedOpen a request for its tokens of each kind, the price of each, the amount charged, how long it took and, if it didn’t finish, why.
ExportDownload the requests as a CSV file.

Requests refused for a rate limit, low credit, an account restriction or a missing ID check are listed as not run, so you can see why calls failed. Requests that never reach that point, such as malformed ones or those the safety filter blocks, aren’t listed.

How long history is kept

You choose how long request history is kept, in Settings: 7, 30 or 90 days, a year, or for good. It’s 30 days unless you change it. Older rows are deleted automatically, and you can delete the whole history at any time.

This is only the per-request history. Your top-ups and charges are kept separately, as the Privacy policy explains.

Low balance

  • Low balance email. On by default. We email you once each time your balance drops below an amount you choose on the Billing page, with a button to top up.
  • Out of credit email. Sent once when your balance runs out or a request can’t start for lack of credit.
  • Top-up button. The emails’ Top up button opens the Billing page with an amount ready to confirm. Following it never charges you by itself: you confirm on the page first.

There’s no automatic refill. To keep an app running, watch for the emails, or check insufficient_quota errors in your own monitoring.