Add credits
Open Billing and enter a code under Add credits to redeem a promo code. Card payments aren’t available yet.How a request is priced
Each endpoint sets an input, output and cached input price in USD per million tokens. After a request finishes, its cost is calculated from the token usage the endpoint reported:- Prompt tokens served from the provider’s prompt cache are charged at the cached input price.
- The remaining prompt tokens are charged at the input price.
- Generated tokens are charged at the output price.
The calculator uses the same formula as billing. Your actual token counts come from the endpoint that served the request.
What isn’t billed
- Requests that fail before any output is delivered, including attempts that failed over to another endpoint.
- Requests you cancel before any output arrives.
Balance
Requests are refused with402 insufficient_credits while your balance is zero. Nothing is reserved before a request starts, so a request that begins with a small balance can cost more than you have left. In that case your balance stops at zero; it never goes negative.
Turn on Billing emails in Settings to hear about credits added and low balances.
Transactions
Billing lists every change to your balance. Filter by type:
Read the same data from code with
GET /v1/balance and GET /v1/transactions.