· 5 min read
What is x402? A plain-English guide for getting started
x402 lets software pay for an API call inside the request itself. Ask, see the price, pay a few cents in USDC, get the result. No account, no API key, no monthly bill.

Way 1 · x402, no sign-up
Your agent pays for itself
The whole idea in four pictures.

1Needs something
Mid-task, your agent needs an image, a search or a voice.

2Finds it on TollNode
It picks the right tool. The price is shown up front.

3Pays a few cents
Its wallet pays for that one use. No sign-up.

4Gets the result
The result comes straight back. If it fails, it's free.
npx agentcash add https://tollnode.comWay 2 · account + API key
Or prepay and use a key
For apps, servers and teams that would rather not run a wallet.

1Add funds
Make a free account and top up $5 to $50.

2Get an API key
One click on your account page.

3Use any tool
Each use comes off your balance. Same prices.
What's on offer
What your agent can do with TollNode
Every skill below works both ways. Filter by what you need, then open a step-by-step guide.
Create and edit imagesFast text-to-image$0.006 per image
Search the webGoogle web search results$0.008 per search
Create and edit imagesFast 2x / 4x upscaler$0.004 per image
Create and edit imagesFLUX Kontext Pro image editing$0.055 per image
Create and edit imagesInstant image editing$0.015 per image
Create and edit imagesNano Banana Pro image generationfrom $0.204 per image
Create and edit imagesGPT Image 2 generation and editingfrom $0.018 per image
Create and edit imagesInstant text-to-image$0.008 per image
Create and edit imagesCrisp image upscaler$0.010 per image
Create and edit imagesSeedream 5 Lite image generation$0.049 per image
Create and edit imagesBackground removal$0.026 per image- Speak and make musicQwen3 text-to-speech$0.028 per clip (up to 1,000 characters)
Create and edit imagesOld photo restoration$0.055 per photo
Create and edit imagesNano Banana 2.1 image generationfrom $0.047 per image
Create and edit imagesRecraft V4 design images$0.055 per image
Create and edit imagesFLUX 3 image generation and editingfrom $0.029 per image- Speak and make musicElevenLabs v3 expressive speech$0.136 per clip (up to 1,000 characters)
- Speak and make musicSong generation with vocals$0.042 per song
- Speak and make musicRealtime text-to-speech$0.035 per clip (up to 1,000 characters)
Create and edit imagesIdeogram 4.5 text-to-imagefrom $0.042 per image
Research businessesCompany contact finder$0.020 per website
Research businessesEmail address verifier$0.003 per email
Research businessesGoogle Maps business search$0.042 per search (up to 10 businesses)
Research businessesGoogle Maps reviews$0.014 per search (up to 20 reviews)
Research businessesTrustpilot reviews$0.022 per search (up to 20 reviews)
Create and edit imagesFLUX 1.1 Pro Ultra 4MP images$0.082 per image
Create and edit imagesFLUX 1.1 Pro image generation$0.055 per image
Create and edit imagesFLUX Dev image generation$0.035 per image
Create and edit imagesFLUX Kontext Max image editing$0.109 per image
Create and edit imagesGPT Image 1.5 generation and editingfrom $0.019 per image
Create and edit imagesGrok Imagine image generation$0.028 per image
Create and edit imagesIdeogram v3 Turbo$0.042 per image
Create and edit imagesNano Banana image generation and editing$0.054 per image
Create and edit imagesQwen Image Edit Plus$0.042 per image
Create and edit imagesSeedream 4.5 image generation$0.055 per image
Create and edit imagesZ-Image Turbo fast images$0.008 per image
Find jobsIndeed job search$0.006 per search (up to 25 jobs)
Find jobsLinkedIn job search$0.016 per search (up to 25 jobs)
Check vehiclesVIN decoder$0.005 per VIN
Look up homesZillow home data$0.006 per home
Search the webGoogle News search$0.035 per search (up to 10 articles)
Search the webGoogle Trends interest$0.037 per report
Search the webURL to Markdown$0.006 per page
Search the webWeb search to Markdown$0.017 per search (up to 3 pages)
Check products and pricesAmazon product data$0.007 per product
Check products and pricesAmazon product reviews$0.014 per product
Check products and priceseBay sold prices$0.049 per search (up to 10 sold listings)
Read social mediaInstagram posts$0.033 per search (up to 10 posts)
Read social mediaInstagram profile stats$0.005 per profile
Read social mediaMeta ad library search$0.022 per search (up to 20 ads)
Read social mediaReddit post search$0.039 per search (up to 25 posts)
Read social mediaTikTok hashtag videos$0.043 per search (up to 10 videos)
Read social mediaX (Twitter) search$0.006 per search (up to 20 posts)
Read social mediaYouTube comments$0.042 per search (up to 20 comments)
Read social mediaYouTube transcript$0.005 per video
Read social mediaYouTube video search$0.042 per search (up to 10 videos)
Find hotelsHotel search by city$0.054 per search (up to 10 hotels)
Make videosP-Video text-to-videofrom $0.136 per 5-second video
Make videosSeedance 1 Lite text-to-videofrom $0.123 per 5-second video
Make videosWan 2.2 image-to-videofrom $0.069 per 5-second video
The fair part
You only pay when it works
Call works
You get the result, then the payment settles. That's the only time money moves.
Call fails · $0
Error, empty result or timeout: we never submit the payment, so nothing leaves your wallet. Nothing to refund.
Numbers
x402 on TollNode at a glance
$0.003
cheapest call
USDC
on Base, a dollar stablecoin
$0 gas
for the buyer
~2 s
to settle on chain
60
models and tools
0
sign-ups needed
Under the hood
What happens on the wire

1. Request
A normal POST. No price known yet.
2. 402 + price
The PAYMENT-REQUIRED header says how much, in which token, to which address.
3. Signed retry
Same request plus PAYMENT-SIGNATURE. Signing is permission; nothing has moved.
4. Result + receipt
Work done, then settled. PAYMENT-RESPONSE holds the transaction hash.
The cast
Four parties, one request
Buyer
Your agent or app, with a wallet holding USDC.
Seller
The API (TollNode). Quotes the price, does the work.
Facilitator
Checks the signature, submits the transfer, pays the gas.
Base
The network where the USDC actually moves.
Get started
Pick your starting point
In your AI editor
Claude Code, Cursor or Codex. Creates a wallet and adds every node as a tool.
npx agentcash add https://tollnode.comIn your own code
Wrap fetch with an x402 client and cap what it may spend per call.
Show the JavaScript
// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const signer = privateKeyToAccount(process.env.AGENT_WALLET_KEY);
const client = registerExactEvmScheme(
new x402Client().setSpendControls({ maxAmountPerPayment: "$0.50" }),
{ signer },
);
const pay = wrapFetchWithPayment(fetch, client);
const res = await pay("https://tollnode.com/api/v1/nodes/web-search", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ query: "x402 protocol" }),
});
console.log(res.status, await res.json());Just look
See a real 402 price quote. Free, nothing is charged.
curl -i -X POST https://tollnode.com/api/v1/nodes/vin-decode \
-H 'content-type: application/json' \
-d '{"vin":"1HGCM82633A004352"}'Funding tip: send USDC on the Base network, not Ethereum. Your address is the same on both, so a transfer on the wrong one still "arrives", just where the agent can't spend it. We learned that one the expensive way.
For the curious
The details
Why is it called 402?
HTTP has had a status code for Payment Required since the 1990s. It was marked "reserved for future use", and for about thirty years almost nothing used it, because there was no way to pay in the middle of a request. Cards need a checkout page and bank transfers take days.
Stablecoins on fast networks fixed that. A wallet signs in milliseconds and the transfer lands in a couple of seconds for a fraction of a cent. x402, created by Coinbase, is the agreement on how a server asks and how a client answers. The reference SDKs are open source as the @x402 packages on npm.
What is inside a 402 response?
The decoded PAYMENT-REQUIRED header from one of our endpoints, trimmed a little:
{
"x402Version": 2,
"resource": {
"url": "https://tollnode.com/api/v1/nodes/image-instant",
"method": "POST",
"description": "Instant text-to-image. Charged only when the call succeeds."
},
"accepts": [
{
"scheme": "exact",
"network": "eip155:8453",
"amount": "8000",
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"payTo": "0x58F2…2fFac",
"maxTimeoutSeconds": 300,
"extra": { "name": "USD Coin", "version": "2" }
}
]
}amount is in the token's smallest unit: USDC has six decimals, so 8000 is $0.008. eip155:8453 means Base mainnet. asset is the USDC contract and payTo the seller's wallet. maxTimeoutSeconds is how long the signature stays valid, which gives the seller time to do the work before settling. A careful client checks all of it before signing.
Why USDC on Base?
USDC is meant to be worth exactly one dollar, so prices don't swing while you pay. Base is a network built on Ethereum where fees are a fraction of a cent and blocks arrive about every two seconds. That is what makes a half-cent purchase sensible; on Ethereum itself the fee would often cost more than the call. x402 also runs on other networks such as Solana, and each seller lists what it accepts in the 402.
Why does the buyer pay no gas?
The buyer signs an authorization (EIP-3009) instead of sending a transaction. The facilitator submits it on chain and pays the network fee, so a wallet that holds only USDC can pay.
V1 and V2 headers
Version 1 put the requirements in the 402's JSON body and used an X-PAYMENT request header. Version 2 moved everything into headers: PAYMENT-REQUIRED, PAYMENT-SIGNATURE and PAYMENT-RESPONSE. The official SDK speaks both, and TollNode accepts both.
I want to sell with x402. What did you learn?
You need a wallet address to receive payments, a facilitator account, and middleware that answers 402. A few lessons from building TollNode: verify before doing the work and settle after it, so a backend failure never needs a manual refund. Make payments idempotent, because clients retry the same signature. Quote a fixed price to requests without a body, since indexers probe endpoints bare. And publish /openapi.json, /llms.txt and /.well-known/x402, then register on x402scan so agents can find you.
FAQ
Quick answers
Is x402 a cryptocurrency?
No. x402 is a protocol, a set of HTTP headers and rules. The money it moves is usually USDC, a stablecoin worth one US dollar, on a fast network such as Base.
Do I need ETH to pay with x402?
No. The buyer only signs an authorization. The facilitator submits the transfer and pays the network fee, so a wallet holding only USDC on Base can pay.
What happens if the API fails after I paid?
It depends on the seller. Signing does not move money; settlement does. TollNode settles only after a usable result, so a failed or timed-out call is never charged.
Can a seller take more than the quoted price?
No. Your wallet signs an exact amount to an exact address with an expiry time. The signature cannot be reused for more, and a good client checks the amount before signing.
How much USDC should an agent wallet hold?
Only what you are happy for it to spend. A few dollars covers hundreds of cheap calls. Set a per-payment cap in your client as well.
Can I use x402 without a wallet?
Not directly. If you would rather not manage a wallet, TollNode also sells the same calls through a normal API key on a prepaid balance.
60 models, one price each, paid per call
Image, video, speech, music, web search and more. From $0.003 a call.