Trust & support

How billing works for the LLMBase Inference API

The cost of a request is only known once the model has finished. So that your balance never goes negative, LLMBase first reserves the maximum amount a request could cost. It depends on the length of your input, the model price, and the maximum answer length. At the end you are normally charged only the actual usage, never more than the reservation, and the rest is available again immediately.

Updated Aug 10, 20265 min read

API credit and Chat subscription are separate

Your Chat subscription includes a usage budget for Chat and Agents on llmbase.ai. Requests to api.llmbase.ai with an API key use only your prepaid credit.

Chat and Agent usage does not reduce your API credit, and API requests do not use your Chat budget.

What happens during a request

  1. 1Reserve: before the model runs, LLMBase holds the maximum amount the request could cost.
  2. 2Run: the model processes the request.
  3. 3Bill: when it finishes, you are normally charged the actual usage, never more than the reservation.
  4. 4Release the rest: the unused part of the reservation is available again immediately.
A reservation is not a charge. It only makes sure your balance cannot go negative when many requests run at the same time.

How the reservation is sized

  • Input: the size of your messages, tools, and other input, at the model's input price. It is counted conservatively, about one token per byte, so it is higher than the real token count; the final charge uses the real count.
  • Answer limit: max_tokens at the model's output price. Without max_tokens, a default of 16,384 tokens applies (or the model's maximum, if lower). For reasoning requests the default depends on the effort, typically between 5,120 and 28,672 tokens.
  • n: several choices multiply the reservation.
  • Images: an inline image counts as at most 32,768 tokens. A remote image or file URL can be any size, so it reserves up to the model's full context window.

Why a 402 can happen while you still have credit

What counts is your available credit: your balance minus the reservations of your requests that are still running. If the reservation for a new request is higher, LLMBase rejects it before any cost is incurred. The error names both amounts and, where possible, a max_tokens value that fits.

Example: your balance is $1.50 and ten running requests hold $1.32, so $0.18 is available. A request with about 2,000 bytes of input and no max_tokens to a model at $10 per million input and $25 per million output tokens reserves $0.41 for the answer plus $0.02 for the input, $0.43 in total, and is rejected. With max_tokens set to 1,200 it reserves $0.05 and runs.

How to avoid a 402

  • Set max_tokens to the answer length you actually expect. This often lowers the reservation by more than 90%.
  • Limit parallel requests. Each running request holds its own reservation; an account can run up to 20 requests at the same time.
  • On models that accept images, send them inline instead of as remote URLs, or set max_tokens when you use remote URLs.
  • Enable automatic top-up on the Balance page so your credit is refilled before it runs low.

What happens with interrupted requests

If a request never starts, its reservation is released after 10 minutes at the latest. If the model already responded and the connection drops, you are charged the actual usage; if that cannot be determined, at most the reserved amount. A request that has started can stay active for up to 3 hours until it is settled.

The full field reference for the 402 error is in the Inference API docs under How billing works.

Frequently asked questions

Am I charged the reservation?

Normally not. You are charged the actual usage and the reservation is released as soon as the request finishes. Only if the actual usage cannot be determined is at most the reserved amount charged.

Why does my balance look high enough?

Your balance includes credit that running requests currently hold. The 402 error shows the amount that is actually available.

Still need help?

Send the Support team a sanitized description, timestamp, affected surface, and exact visible error.

Contact Support