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.
Enabled per deployment. When off, the API returns the classic JSON 402 and nothing changes.
$ 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 routeIllustrative 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.
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.
One credit ledger, two doors in. Credits spend identically no matter which rail funded them.
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.
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.
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.
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.
Credits are granted for exactly the settled amount, the generation starts on the locked route, and the response carries a PAYMENT-RESPONSE settlement receipt.
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 comparedCredits 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.
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 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.
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.
$ 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 grantedStripe 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.
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 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.
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.
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.
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.
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.
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.
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.