Account
Billing and credits
Libremodel is prepaid. You add credit, every request deducts what it used, and nothing is ever charged to your card on its own. This page covers what that means for your code.
Prepaid credit
- You top up in Billing, by card (processed by Stripe) or with crypto (processed by NOWPayments).
- Each top-up can be up to $1,000. What you top up is what you use: the balance you get is the amount you top up. Card top-ups under $10 add a $1 fee, shown before you pay. Crypto top-ups have no fee.
- Everything is in US dollars: prices, balance and top-ups. With crypto, you pay the equivalent in the coin you choose.
- The balance belongs to your organization. All its keys share it, on every model.
Examples and the full price table: Pricing.
Paying with crypto
- In Billing, choose Pay with crypto and enter the amount in dollars. You go to the payment page, where you pick the cryptocurrency and see exactly how much to send.
- No fee: the amount in dollars you chose goes to your balance in full.
- The credits arrive once the network confirms the payment. It can take a few minutes.
- Send exactly the amount shown. If less arrives, the top-up is not credited on its own: write to us with the payment details and we sort it out.
- If the payment page expires before you pay, nothing is charged. Start a new top-up.
What a request costs
Each request pays for the tokens it used, at the model's prices on Models, per million tokens:
- Input tokens at the input price.
- Cached input tokens (read from cache) at the lower cached price.
- Output tokens at the output price. Reasoning tokens are output.
- Each image in the request at the model's price per image (
pricing.imageinGET /v1/models), on top of its tokens. Images that come out of a file count too. The images an agent sends again with the history count again. - Each web search at $0.005, on top of the tokens of its results (Web search). Reading pages with web fetch is free: you pay the tokens of their content.
The usage field of every response has those numbers, and usage.cost has what was charged, in dollars, like OpenRouter. In a stream it comes in the event with the final usage. In Activity you see each request, with what was charged for it.
The hold before each request
Before a request starts, its worst case is held from your balance: the estimated input plus max_tokens of output, at the highest price the request could be billed at. When it ends, you are charged what it actually used, and the rest of the hold is released at once. That is why a 402 can suggest a lower max_tokens.
- The input estimate is on the high side on purpose, and it assumes nothing comes from cache. The final charge uses the real numbers.
- Requests running at the same time each hold their own worst case. Many parallel requests can get a
402even if each one alone would fit. - A large
max_tokensneeds that much balance free, even if the answer ends up short.
When you leave out max_tokens
The model's default limit is used, lowered to what your balance covers, so a low balance still gets an answer instead of an error. If it reaches that limit, the response ends with finish_reason: "length" (or stop_reason: "max_tokens" in the Messages format). If the balance does not cover even 256 output tokens, you get a 402.
402 insufficient_balance
You get 402 insufficient_balance when the balance cannot cover the hold. Nothing is charged and nothing is sent to the model.
- If you sent
max_tokens, the message tells you the largest value your balance covers, when there is one:Lower max_tokens to 1843 or add credits. - To keep going, top up or send a lower
max_tokens. - A stream that runs into the limit of your balance is cut with an
insufficient_balanceevent. You pay for what was delivered.
Failed and cut requests
- A request that fails before the response starts costs nothing.
- A stream cut in the middle, by the model or because you closed the connection, costs only what was delivered to you. See Streaming.
If the balance goes below zero
It should not happen, but in rare cases requests already running can use slightly more than they held. You are charged what was actually used, and while the balance is below zero every new request gets 402 until a top-up brings it back up.