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.

Priced per token, with a ceiling known before the model runs

You pay for the prompt tokens and the completion tokens the provider counts, at the model's input and output rates per million. Before the model runs, the size of your request and your max_tokens fix a ceiling: a balance draw reserves it and releases what the tokens did not cost; a pay-per-request settlement pays it on chain and the rest is added to your balance. Give reasoning models room to think — a ceiling too small truncates the answer.

A pay-per-request call carries one on-chain settle, read from live gas at the moment you ask; a request drawn from a balance carries none. The 402 quotes the exact ceiling 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?

You know the most it can cost: the size of your request and your max_tokens fix a ceiling the 402 quotes before a token is generated. The charge is the tokens actually used, never more than the ceiling.

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.