Pay-per-request LLM inference over x402
Open models on attested GPUs. One request, one USDC payment, and the exact price is known before the model runs. No signup — or prepay a balance and mint bearer keys.
Deterministic pricing, before the model runs
Input is charged by byte at the input rate: one byte of your messages JSON counts as one token, so the quote is a ceiling known before inference. Output is charged at the max_tokens ceiling you set, used or not — ask for what you need, and give reasoning models room to think.
Every pay-per-request call carries one on-chain settle, read from live gas at the moment you ask. The 402 quotes the exact total for your exact body; models and rates live in GET /api/inference/catalog.
How a request works
POST /api/inference/chat with {"model", "messages", "max_tokens"} and no payment header. The 402 that comes back carries an accepts array, one entry per network with its own exact amount. Sign it (EIP-3009), resend with X-PAYMENT, and the answer carries the completion and the settlement.
A serve failure is a free replay, never a refund.
Cheaper at volume: balances and bearer keys
Prepay a balance with POST /api/inference/credits and the on-chain settle happens once for the whole amount; from then on requests draw from the balance with an X-Wallet-Auth header and no payment header.
A wallet can also mint revocable bearer API keys on its prepaid balance, so plain Authorization: Bearer clients work. Keys draw from the balance and can never overdraw it. The mint contract is in GET /api/inference/docs.
FAQ
Do I know the price before the model runs?
Yes — input is priced by byte and output at your ceiling, so the 402 quotes the exact amount before a token is generated.
Do I need an API key?
No. Pay per request with the wallet directly, or optionally prepay a balance and mint revocable bearer keys on it.
Which models are available?
Read GET /api/inference/catalog — open models running in GPU TEEs, each with a public hardware attestation served beside its price.
What happens if the serve fails?
A failed serve is replayed free. It is never refunded — the model runs again instead.