AI inference
your agent pays for

No account. No API key. No human in the loop. Your agent's wallet is the credential — it gets a 402, signs it, and the tokens come back. OpenAI-compatible, charged per call in USDC over the x402 standard. Running on Base Sepolia testnet today.

agent.ts TypeScript
1// A wallet instead of an API key
2const fetch = wrapFetchWithPayment({ signer })
3
4const res = await fetch(
5  "https://infer.x402cloud.ai" +
6  "/v1/chat/completions", {
7    method: "POST",
8    body: JSON.stringify({
9      model: "fast",
10      messages,
11    }),
12  })
13
14// 402 asks $0.012013, settles the real cost.

Protocol
Four steps. No signup.
Payment negotiation happens over plain HTTP, so any client that speaks the x402 standard can call us — including Cloudflare agents and the official x402 SDKs.
Step 01
Request
Agent posts a completion request
Step 02
402 Response
We return a ceiling price
Step 03
Sign & Retry
Agent signs, we run the model
Step 04
Settle
We settle the metered cost, never more

Why
The wallet is the account
An agent with a wallet and no human cannot sign up for anything. That is the gap this closes — and metering is what makes paying per call worth doing at all.
01

Nothing to sign up for

No signup form, no API key to rotate, no card on file, no dashboard a person has to log into. An agent that can sign a Permit2 authorization can buy inference. That is the whole onboarding.

02

Why not call Workers AI directly?

You can — these are Cloudflare Workers AI models, and we say so. Direct access needs a Cloudflare account, an API token and a billing relationship, all of which need a human. We charge Cloudflare's rate plus 20% and need none of them.

03

Metered, not subscribed

A call's cost is unknown until the tokens exist. Your agent authorizes a ceiling, we run the model, and settlement moves the real figure. The difference is never taken — it was never moved.


Models
Eight models, eleven routes
Eight short-name routes (POST /fast) plus three OpenAI-compatible ones (/v1/chat/completions, /v1/embeddings, /v1/images/generations). Every figure below is a ceiling your agent authorizes, computed from a fixed worst case — 500 input and 2,000 output tokens for text, 8,192 tokens for embeddings, one 1024×1024 image at 4 steps. Settlement takes the metered cost instead. These are Base Sepolia test dollars today, not real ones. Live figures: infer.x402cloud.ai/models.
One caveat on the ceilings: the OpenAI routes cannot know which model you want until they have parsed the body, so they quote the highest ceiling of their kind. POST /v1/chat/completions with "model": "fast" asks your wallet to authorize $0.012013, where POST /fast asks $0.002202. Settlement meters both down to the same real cost — but if you are sizing a wallet allowance, use the short-name routes.
nano

Fastest, simple tasks

IBM Granite 4.0 H Micro. Ceiling $0.000277 per call; you are charged the input and output tokens the model reports.

fast

Quick and capable

Llama 4 Scout 17B. Ceiling $0.002202 per call; you are charged the input and output tokens the model reports.

smart

Reliable workhorse

Llama 3.1 8B Instruct. Ceiling $0.000946 per call; you are charged the input and output tokens the model reports.

big

Highest quality

Llama 3.3 70B FP8. Ceiling $0.005582 per call; you are charged the input and output tokens the model reports.

think

Deep reasoning

DeepSeek R1 Distill Qwen 32B. Ceiling $0.012013 per call; you are charged the input and output tokens the model reports.

code

Code specialist

Qwen2.5 Coder 32B. Ceiling $0.002794 per call; you are charged the input and output tokens the model reports.

embed

Text embeddings

BAAI BGE-M3. Ceiling $0.000115 per call. Charged on the length of the text you send — one token per four characters, counted from the request, not reported by the model.

image

Image generation

FLUX.1 schnell. A flat $0.002280 per image — there is nothing to meter on a generation, so the ceiling and the charge are the same figure. Step count does not change it.


Compatibility
OpenAI wire format, with three edges
The paths are the OpenAI ones — /v1/chat/completions, /v1/embeddings, /v1/images/generations, GET /v1/models — and non-streaming chat completions come back in the shape an OpenAI client expects. Three things do not match, and you will hit them in the first ten minutes, so here they are up front.
01

No streaming

stream: true is ignored and you get a single JSON body. An OpenAI SDK waiting for text/event-stream will throw. If your client streams by default, turn it off.

02

Images come back as PNG bytes

/v1/images/generations returns the raw image with Content-Type: image/png, not OpenAI's {"data":[{"b64_json":…}]} envelope. Read the body as bytes, not JSON.

03

Unknown model names fall back

A name we do not recognise is not an error: the route quietly uses its default model — nano for chat — and bills at that model's rate. Check GET /v1/models rather than assuming a name mapped.


Pricing
Pay per request. Nothing else.
Every completion is a USDC micropayment. No accounts, no API keys, no subscriptions, no minimums — your wallet is your identity.
01

Micropayments, not plans

You sign a Permit2 authorization for a maximum price, and settlement happens on-chain for the actual metered cost — never more than you authorized. Stop calling, stop paying.

02

Priced per model

Each model carries its own per-token or per-image rate. A short prompt to nano costs a fraction of a cent; think costs more because it reasons for longer. Nothing is rounded up to a plan.

03

Try the whole flow for free

Settlement is USDC on Base Sepolia, so the amounts above move test dollars, not real ones. Get test USDC from the Circle faucet and the full flow — 402, signature, inference, on-chain settlement — works end to end at no cost.


Open standard
No lock-in underneath
Payment runs on the Linux Foundation x402 v2 standard, not on anything proprietary to us. Our implementation of it is open source, so you can audit exactly how a charge is calculated and settled — or bring your own client and facilitator. Read the source.

Roadmap — not available yet
Sovereign EU inference is where this is going
Everything above runs on Cloudflare Workers AI, a US provider, and settles in USDC on a US-issued rail. For a GDPR-bound buyer, a healthcare provider or a public body, that is disqualifying no matter how good the developer experience is — and it is not a constraint that gets competed away.
The intended answer is metered inference in front of api.nativekloud.eu: open-weight models on EU bare metal, zero content retention, no US vendor in the serving path. The settlement side is genuinely unresolved — USDC and Base are both US-owned, so a sovereign edition needs an EU settlement path or an explicit, documented exception. We would rather say that plainly than imply it is already solved. Nothing sovereign is running today; if this is the thing you need, it is worth telling us so.