# Billing

> Per-token prices with the margin already included, one prepaid balance, what a 402 means, and where to check what you spent.

## Prices

Every model has a price per million input tokens and per million output tokens, listed on [Pricing](https://app.alphaneural.io/pricing) and on each model in the [catalogue](https://app.alphaneural.io/models). Those prices already include our margin. Nothing is added on top: there is no markup line, no per-request fee and no subscription.

The same prices are available to code as `pricing.prompt` and `pricing.completion` from [`GET /v1/models`](https://app.alphaneural.io/docs/models), and as `displayInputCostPerToken` and `displayOutputCostPerToken` from the catalogue query on the same page. A model without a price has no `pricing` in the list and reports `null` in the catalogue. That means free or unpriced, and the two cannot be told apart, so never read it as a price of zero: an unpriced model is still billed from the cost its provider reports.

## Your balance

You pay from one prepaid balance, in US dollars, shared by every model and by both base URLs. Top it up by card or crypto from your [wallet](https://app.alphaneural.io/profile/me?tab=wallet-management).

A request's cost is taken from your balance after the request, from the usage the gateway records for your key. It normally shows up within about a minute.

## When your balance is zero

`POST https://backend.alfnrl.io/v1/chat/completions` checks your balance before it records or forwards anything. When the balance is zero it answers with status `402`:

```json
{"error": {"message": "insufficient balance: add funds to continue"}}
```

Nothing is added to your thread, so once you have topped up you can send exactly the same request again.

The check is whether your balance is above zero; it does not estimate what the request will cost. To cap what a single request may be billed, use `max_spend` with [routing](https://app.alphaneural.io/docs/routing); `alphaneural/auto` always runs under a ceiling.

Listing and reading threads, and reading cost traces, are never refused for balance.

## Your own deployments

Calls to a model you have deployed yourself are not charged, and the balance check lets them through even at zero. This covers your completed deployments, called by their deployment name (see [Models](https://app.alphaneural.io/docs/models#model-ids)).

## Checking what you spent

- **Balance history**, in your [wallet](https://app.alphaneural.io/profile/me?tab=wallet-management), records every amount taken from your balance. This is what to reconcile against.
- **Usage**, on your [profile](https://app.alphaneural.io/profile/me?tab=usage), breaks activity down by key and by model over time.
- **Cost traces** itemise a single task, step by step. See [Cost traces](https://app.alphaneural.io/docs/traces).

> **Do not reconcile against /spend/logs**
>
>
> Earlier versions of these docs sent you to the gateway's `/spend/logs`, `/spend/tags` and `/spend/calculate`. Those are the gateway's internal accounting endpoints, not part of the AlphaNeural API. They price usage from the gateway's own price table rather than at the prices we quote, so totals built from them will not match [Pricing](https://app.alphaneural.io/pricing). Use your balance history instead.
>
