Start
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 and on each model in the catalogue. 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, 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.
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:
{"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; 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).
Checking what you spent
- Balance history, in your wallet, records every amount taken from your balance. This is what to reconcile against.
- Usage, on your profile, breaks activity down by key and by model over time.
- Cost traces itemise a single task, step by step. See Cost traces.