Pricing and billing
There is no card on file, no monthly invoice, and no plan tier. You deposit 0G into an on-chain balance, each request debits it, and every response tells you what that request cost.
How pricing works
Section titled “How pricing works”Text inference is priced per token. The charge for one chat request is:
input_tokens × prompt_price + output_tokens × completion_priceImage generation is priced per image, and speech transcription per second of audio.
You never have to compute this. Every Router response carries an x_0g_trace block, and its billing field holds the resolved charge for that call:
{ "x_0g_trace": { "request_id": "65cc8e6e-e4d6-49b9-b6b1-7e3d2596436c", "provider": "0xB01EBd79c3fd63ff52fD47C3935119601EEe2FdB", "billing": { "input_cost": "32890000000000", "output_cost": "1914160000000000", "total_cost": "1947050000000000" } }}Live response, 2026-07-20. Costs are integer strings in the smallest unit of 0G (1018 per 0G), so this call cost 0.00194705 0G. See Track what each request costs for parsing them without losing precision.
total_cost is what the request debited from your balance. That number is available the moment the response arrives — there is no statement to wait for and no estimate to reconstruct from token counts. See Track what each request costs.
Current per-model prices are listed in the Console. This page does not repeat them, because providers set their own prices and those prices change.
Prices vary by provider
Section titled “Prices vary by provider”A model ID on the Router names a capability, not a single backend. Several independent providers may serve the same model, and each prices its own capacity. So “what does this model cost” has no single answer: it depends on which provider served the request. See Models and providers.
The provider field in x_0g_trace tells you, after the fact, which one you got. Two routing headers let you influence it beforehand:
| Header | Effect |
|---|---|
X-0G-Provider-Sort: price |
Prefer cheaper providers when ordering candidates |
X-0G-Provider-Max-Price-Usd-Prompt / -Completion / -Image |
Reject any provider above the stated ceiling |
The two are different in kind. Sorting is a preference: it changes the order of the candidate list, and any provider on that list may still serve you. A maximum price is a hard filter that runs before sorting and before failover, so an outage cannot route you to a provider above your ceiling as a fallback.
The filter can empty the candidate set. When it does, the request fails with 400 and code: no_provider_within_max_price. That is a structural failure, not a transient one — retrying the same request produces the same result. Either raise the ceiling or pick a different model.
Full syntax, value rules, and error codes for both headers are in Headers. For a worked ceiling, see Cap what a single request may cost.
Paying with 0G
Section titled “Paying with 0G”Your balance lives on chain. You deposit 0G into the Router’s on-chain payment contract, the contract holds the balance, and each request debits it.
Be clear about what a deposit is before you make a large one:
- One-way. There is no withdrawal path back to your wallet.
- Not refundable. The balance cannot be converted back into transferable tokens.
- Inference only. It pays for requests and nothing else.
- No expiry. An unused balance stays available indefinitely.
The practical consequence: deposit what you expect to spend over a reasonable horizon, and deposit again when you need to. The acquisition and deposit steps are in Get 0G and fund your account.
Balance is a cliff, not a slope. While funds remain, every request is served; at zero, every request returns 402 with code: insufficient_balance. This is not a rate limit — backing off and retrying will never clear it. The only fix is a deposit. Build the warning yourself: see Monitor balance and usage.
What you are charged for
Section titled “What you are charged for”| Charged | Not charged |
|---|---|
| Chat completions | GET /v1/models — public, no authentication required |
| Image generation and edits | Account endpoints under /v1/account/* |
| Audio transcription | Requests rejected with 400 or 401, which never reached a provider |
Billing produces metadata, and the metadata is deliberately thin. What is kept: request ID, wallet address, model and provider, token counts, trust tier served, cost, and timestamp. What is not kept: the content of your requests or the responses to them. Nothing in the billing record can reconstruct a prompt. See Why 0G Private Computer.
Related
Section titled “Related”- Get 0G and fund your account — acquire tokens and make the first deposit
- Track what each request costs — read and log the billing block
- Monitor balance and usage — account-level balance and usage stats
- Cap what a single request may cost — enforce a price ceiling per request
- Models and providers — why one model ID has more than one price