AI Router · CLI · MCPCheapest eligible quotes before you create

402 is a price, not a dead end.

OfflineCreator speaks x402, the open payment standard built on the HTTP 402 status code. When an agent runs out of credits mid-task, the API answers with exact USDC terms instead of an error page — the wallet signs, settlement is confirmed onchain, and the AI router generates on the locked quote in the same request cycle.

Humans keep Stripe. Agents get a rail built for machines.

Challenge
HTTP 402
Settlement
USDC
Human rail
Stripe

Enabled per deployment. When off, the API returns the classic JSON 402 and nothing changes.

OfflineCreator CLI402 → pay → generate
$ npx @offlinecreator/mcp generate \
  --model seedance-2-5-text --quoteToken qte_••••7f2a

402 PAYMENT-REQUIRED · $1.57 in USDC
 signed locally · under session cap
 settled 0x8f42…e91b · 157 credits granted
 generation started on the locked route
Locked quote priceExact USDC amountSpend cap enforced

Illustrative transcript. The challenge is priced from the same signed quote the router locked for the request, so the paid retry can never cost more than the price you saw.

Checkout pages were built for people.

An agent cannot follow a redirect, fill a card form, or wait for an email receipt. x402 moves the payment into the protocol the agent already speaks: the same request, the same headers, one extra signed field. Both rails fund the same credit ledger at the same prices.

Who pays
StripeCreators in the web Studio
x402API-key agents on MCP, CLI, and REST
Checkout
StripeStripe Checkout and subscriptions
x402HTTP 402 challenge inside the API response
Settles in
StripeCard and local payment methods
x402USDC on supported EVM and Solana networks
Credit packs
Stripe1,000 for $15 · 3,000 for $39
x402The same packs at the same prices
Balance runs out
StripeTop up from the pricing page
x402Pay the locked quote inline and keep generating

One credit ledger, two doors in. Credits spend identically no matter which rail funded them.

One request cycle, paid.

The whole exchange happens over HTTP — no checkout session, no webhook wait, no polling for a receipt. Four steps separate an empty balance from a running generation.

  1. 01

    Challenge

    A paid call that your balance cannot cover returns HTTP 402 with a PAYMENT-REQUIRED header stating the exact USDC amount, network, and pay-to address.

  2. 02

    Sign

    The agent's wallet signs the payment payload locally and retries the same request with a PAYMENT-SIGNATURE header. The private key never leaves the agent's environment.

  3. 03

    Settle

    A facilitator verifies the signature and settles the USDC transfer onchain before any credits move. The transaction hash becomes the idempotency key for the grant.

  4. 04

    Deliver

    Credits are granted for exactly the settled amount, the generation starts on the locked route, and the response carries a PAYMENT-RESPONSE settlement receipt.

The router prices the challenge.

This is where x402 and the AI router meet. The router compares eligible provider routes and signs a quote before credits move — and that same signed quote prices the x402 challenge. Settlement grants exactly those credits, the generation runs on the locked route, and a failed generation still refunds its reserved credits automatically.

See how routes are compared

Paid means settled

Credits are granted only after onchain settlement is confirmed, and grants are idempotent on the transaction hash. A retried request cannot double-charge or double-credit.

Payment is not identity

Paying for your account always starts with your API key, and a wallet can never become your account. Pay-per-generation is the one path with no account at all: the payment is the only authorization, it grants no credits, and it can read nothing of yours.

The agent holds the keys

The wallet key lives in the agent's own environment and a client-side spend cap limits what one session may pay. OfflineCreator never custodies agent funds.

Point a wallet at your agent.

Two environment variables make any MCP or CLI session payment capable. Without them, nothing changes — top-ups fall back to Stripe checkout links and an empty balance returns the ordinary 402 error.

OfflineCreator CLIwallet → topup
$ export X402_EVM_PRIVATE_KEY=0x…
$ export OFFLINECREATOR_X402_MAX_USD=25

$ npx @offlinecreator/mcp topup --id topup-1000

 paid $15.00 in USDC via x402
 1,000 credits granted
Key stays localSession spend capStripe fallback

Two rails. One locked price.

Stripe and x402 fund the same account credits at the same published prices, and the router's signed quote governs the charge on both — a payment can never move a price you already approved. Pay-per-generation skips the ledger entirely: one payment buys one job.

402 runbooks

Dedicated operator pages for the shapes, wallet setup, pack top-ups, pay-as-you-go generation, and the Stripe comparison—without burying them in a single marketing scroll.

x402 payments, plainly answered

What is x402?

x402 is an open payment standard that uses the HTTP 402 status code to carry machine-readable payment terms. Instead of a checkout redirect, the API response itself states the exact USDC amount, and an agent's wallet signs and settles it in the same request cycle.

Do human users need a crypto wallet?

No. Nothing changes for people: subscriptions and credit top-ups still go through Stripe Checkout. x402 is a second rail for API-key agents on MCP, CLI, and REST.

Which requests can an agent pay with x402?

Two: credit pack top-ups (the same 1,000 and 3,000 credit packs sold through Stripe) and pay-as-you-go generation, where a request that would fail for insufficient credits returns an x402 challenge priced at the locked quote.

Can an x402 payment change my locked generation price?

No. The pay-as-you-go challenge is priced from the same signed quote the router locked for your request. Settlement grants exactly those credits and the generation runs on the locked route at the approved charge.

What happens when x402 is not enabled?

The API behaves exactly as before: an insufficient balance returns the regular JSON 402 error, and MCP or CLI sessions without a configured wallet simply fall back to Stripe top-up links.

Where are the x402 operator runbooks?

Start at /x402 for the overview, then open the dedicated runbooks for PAYMENT-REQUIRED diagnosis, wallet setup, Stripe vs x402, pay-as-you-go generation, and credit pack top-ups.

Give your agent a way to pay.

Connect MCP or the CLI, add a funded wallet and a spend cap, and your agent can top up credits or settle a locked quote without leaving the request.