> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tokz.si/llms.txt
> Use this file to discover all available pages before exploring further.

# Billing

> Prepaid credits, with low-balance alerts before you run out.

The Decisions API bills per token read, by model: **$0.025 to $0.035 per million
billed tokens**, at least 256 tokens a request. There is no subscription and no seat
count. Every account starts with \$5 of free credit, no card needed: 200 million billed
tokens on `opendecision-large-packed`. See [what is billed](https://docs.tokz.si/decisions.md#what-is-billed).
Training a [fine tune](#fine-tunes) has its own price, and only a win is charged.

## Prepaid credits

Buy credit up front in the dashboard under **Billing**; each request draws down the
balance.

At a zero balance `POST /v1/decide` returns `402`:

```json theme={null}
{ "error": "insufficient_credits", "balance": 0, "requestId": "req_..." }
```

Nothing else changes — keys stay valid, and requests succeed again the moment credit
lands. **An account can never spend more than it holds.**

Credits do not expire.

## Low-balance alerts

Set the dollar balances you want to hear about — $5, $1 and empty by default — in
the dashboard under **Settings**. Crossing one emails the organization's **owners
and admins**, or a single address if the org sets one there. Members are not
emailed: they cannot buy credit, so the alert would be noise about a problem they
cannot fix.

Alerts warn. They do not stop anything: at a zero balance the credit gate itself is
what refuses the request. A new top-up resets the mark, so the same account can warn
again the next time its balance runs low.

## Handling 402 in an agent

```ts theme={null}
import { Tokz, TokzInsufficientCreditsError } from "@tokz/sdk";

const tokz = new Tokz({ apiKey: process.env.TOKZ_API_KEY! });

try {
  await tokz.decide({ inputs: "charged twice", decisions: { urgent: { type: "bool" } } });
} catch (err) {
  // A billing state, not an outage: page whoever tops up, not on-call.
  if (err instanceof TokzInsufficientCreditsError) console.warn("tokz balance", err.balanceCents);
  else throw err;
}
```

Retrying a `402` will not succeed until credit is added.

## Fine tunes

A [fine tune](https://docs.tokz.si/fine-tune.md) with a file costs **\$2.00**, charged only if it beats
OpenDecision-Small on rows labeled by you. A job with no file is never charged. A job that
fails, is canceled, or does not win costs nothing.

Starting any fine tune needs $2.00 in your balance. A job with a file holds $2.00 until it
ends, and the hold then becomes the charge or goes back to your balance. A hold counts as
spent while it lasts, so a low balance can get a `402` on `/decide`, or a low-balance email,
until the hold ends. **Billing** lists each hold and charge.

Hosted calls to a fine tune bill at the `opendecision-small` price. Running one on your
machine and downloading it are free. See [prices and limits](https://docs.tokz.si/fine-tune.md#prices).

## Payments and invoices

Payments are processed by [Stripe](https://stripe.com) and sold through
[Link](https://support.link.com/topics/sold-through-link), our merchant of record. Link
handles cards, currency and sales tax, sends the receipt and invoice, and appears on
your statement as `LINK.COM*`.

We store no card details. tokz keeps the credit ledger and the usage counters behind
it; the payment instrument never reaches our servers.

## What we count

Billed tokens of the text and questions you send, priced by model, and any fine tune
that won. Answers are free, and requests that fail (any 4xx or 5xx) are not billed.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.