x402 AI Generation API: Pay Per Call, No Account
Generate images, video and speech over x402: your agent pays USDC on Base per call, with no signup and no API key. Real endpoint, real prices, honest failure handling.

x402 is an open payment protocol that turns the long-dormant HTTP 402 status code into a working paywall: a server answers a request with 402 Payment Required plus machine-readable payment terms, the client signs a stablecoin authorization, retries the same request, and gets its answer. No account, no API key, no monthly plan. Coinbase handed the protocol to the Linux Foundation in April 2026, and by the time the x402 Foundation went operational it had 40 member organizations, AWS, Google, Stripe, Visa and Mastercard among them. So this is not a crypto side quest anymore.
Quick answer: BananaBanana's x402 endpoint is https://bananabanana.pro/api/x402. POST { "tool": "...", "arguments": {...} }, get a 402 back with the exact price for those arguments, pay it in USDC on Base, repeat the request. Images start at $0.03, video at $0.30, speech at $0.01 per 200 characters. Images and speech charge only if the file actually exists.

That last sentence is the part most x402 write-ups skip, so I'll spend most of this post on it. Charging is easy. Not charging for the calls that went wrong is where the design gets interesting.
How the payment actually happens
Four steps, and your HTTP client does three of them.
- Your agent POSTs a normal JSON request. No payment header.
- The server answers
402with anacceptsarray. One payment requirement holds the amount in atomic units, the recipient address, the USDC contract, the chain, and an expiry window. - Your client signs an EIP-3009 transfer authorization for that exact amount and base64-encodes it into the
X-PAYMENTheader. - Same request goes out again, this time with the header. The server hands the signature to a facilitator for verification, does the work, then asks the facilitator to settle on-chain.
The signature is not a transaction. It's an off-chain authorization that only becomes a transfer when someone submits it, which is what makes the two-phase design possible: verify first, work second, settle last.
One practical wrinkle. The v2 spec renames the headers to PAYMENT-SIGNATURE and PAYMENT-RESPONSE, but most clients in the wild still send X-PAYMENT, so that's what we accept today. If you're writing against the official TypeScript SDK you won't notice either way.

What one call costs
Prices are per generation, quoted before you sign anything. The exact number depends on the arguments (a 4K image is not a 1K image), so the 402 response prices your request, not a category.
| Tool | Model | Price |
|---|---|---|
generate_image | Nano Banana 2 Lite | $0.03 (1K only) |
generate_image | Nano Banana 2 | $0.03 – $0.13 (512 → 4K) |
generate_image | Nano Banana Pro | $0.11 – $0.20 (1K → 4K) |
generate_video | Gemini Omni Flash | $0.10 per second, 3–10 s, sound always on |
generate_video | Veo 3.1 family | $0.10 – $4.40 per clip |
generate_speech | Gemini Flash TTS | $0.01 per started 200 characters |
A three-second Omni clip with audio runs $0.30. That's the cheapest real video on the list, and honestly the one I reach for most. Veo looks better, but at 8 seconds and 1080p with audio you're paying an order of magnitude more for a draft you might throw away.
Read the current numbers straight from the machine if you'd rather not trust a blog post: GET https://bananabanana.pro/api/x402 returns the full catalogue for free, no payment involved.

Two requests, start to finish
Here's the whole thing with curl, minus the signing step (your x402 client library does that part).
# 1. Ask. No payment header: this is the quote.
curl -s -X POST https://bananabanana.pro/api/x402 \
-H 'Content-Type: application/json' \
-d '{"tool":"generate_image","arguments":{"prompt":"a paper boat on still water at dawn","model":"nano-banana-pro","resolution":"2048"}}'
{
"x402Version": 1,
"error": "Payment required: $0.11 for generate_image.",
"accepts": [{
"scheme": "exact",
"network": "base",
"maxAmountRequired": "110000",
"resource": "https://bananabanana.pro/api/x402",
"payTo": "0x7c0e9abd1c48380e27ab5bfced1be54f23ce773f",
"asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"maxTimeoutSeconds": 300,
"extra": { "name": "USD Coin", "version": "2" }
}]
}

Sign that, resend with the header, and the second response carries the finished image:
{
"paid_usd": 0.11,
"result": {
"status": "completed",
"images": [{ "url": "https://bananabanana.pro/api/files/..." }]
}
}
Two details worth stealing if you're building your own x402 server. maxAmountRequired is in atomic units. USDC has six decimals, so $0.11 is 110000, and getting that wrong is the single most common integration bug. And extra.name must match what the USDC contract's own name() returns, because it feeds the EIP-712 domain separator. On Base mainnet that string is USD Coin; on Base Sepolia it's USDC. They differ, the signature won't verify if you guess, and the error you get back tells you almost nothing useful. Ask me how I know.
Video is different: pay first, get a token back if it fails
Images and speech finish inside the request. So the order is verify → generate → settle, and settlement only happens if a file came out the other end. A content-filter rejection, an upstream error, a timeout: none of them cost the payer anything. The signature simply never gets submitted.
Video can't work that way. A Veo or Omni render takes one to ten minutes, nobody's holding an HTTP connection open that long, and a generation already running at Google cannot be cancelled (their interactions.cancel returns 501 UNIMPLEMENTED, and I checked, because I wanted the nicer design). So video settles up front, returns a job_id, and you poll a free result endpoint.
Which leaves the honest question: what if a clip you already paid for comes back refused?
You get a refund token. Full amount, bb_rf_…, valid 90 days, redeemable against any later call by passing it as refund_token. Pay $1.30 for a clip that the safety classifier kills, and your next call costs $1.30 less. Change comes back as a new token if you spend less than the credit.
It is not a USDC refund, and I'd rather say that plainly than dress it up. This server holds no private key. It can't move money out, only decline to take it, so an on-chain refund is architecturally impossible here. Given how many x402 services do hold keys, I consider that a feature.
That clip cost $0.30 through the same endpoint. Gemini Omni Flash, three seconds, prompt was a single unbroken shot of ink diffusing through water in a glass tank, soft side light, with the audio described as a low room tone. Sound is baked in by the model; there's no silent mode.
How an agent finds the endpoint
An agent that already knows the URL doesn't need discovery. Every other agent does, so the service publishes a manifest at /.well-known/x402 (and at /.well-known/x402.json, because crawlers try both spellings in roughly equal numbers, and we watched them do it).
The manifest lists each tool as its own resource with a full payment-requirements block, the network as CAIP-2, the payout address, and the facilitator. One deliberate choice in there: the accepts block carries the tool's minimum price, not its maximum. You can't sign a blind payment from a manifest anyway, since the price depends on your arguments. But if I published the ceiling, a well-behaved agent would happily overpay for a $0.03 image. Minimum plus a stated range is the honest shape.
Catalogues also probe endpoints by sending a junk POST and checking the status code. Ours answers 402 to those, with a hint about how to name a tool. It used to answer 400, which read as "not payment-capable" and quietly kept us out of two directories for a week.

x402 or an account?

Both entrances lead to the same generators. Pick by what your agent has.
| x402 | Account (MCP or web) | |
|---|---|---|
| Setup | A funded wallet | Email signup, then an API key or OAuth |
| Per call | Sign, pay, done | Charged from a prepaid balance |
| Deposit bonuses | None | 5% at $50+, 10% at $100+, another 10% with a promo code |
| Generation history | Not kept | Full history, reusable job IDs |
| Video editing | Not available | edit_video, conversational refinement |
| Best for | One-off calls, no human in the loop | Ongoing work, cost tracking, iteration |
The bonus column is the real fork. Deposit $100 with an active promo code and $120 lands on your balance, and that's a 17% discount x402 structurally can't match, because there's no balance to top up. On the other hand, an agent with a wallet and no email can start generating in one round trip, which is the whole point.
If you want the account route, the MCP server covers Claude Code, Cursor, VS Code and anything else that speaks Streamable HTTP, and the generator works in a browser. Same models, same prices, different door.
FAQ
Do I need a Coinbase account to pay?
No. Any EVM wallet holding USDC on Base works. The facilitator settles the transfer; you never create an account with them either.
What happens if my generation is blocked by the content filter?
For images and speech, nothing is charged: settlement runs only after a file exists. For video, you get a refund token worth the full amount, redeemable against a later call.
Which chains and tokens are supported?
USDC on Base mainnet, exact scheme. The manifest at /.well-known/x402 carries the CAIP-2 chain id and the token address, so a client can verify before signing.
Can I edit a video I generated over x402?
Not through x402. Editing operates on clips owned by an account, so edit_video and conversational refinement stay on the MCP side. A fresh generation is always available.
How long is a quoted price valid?
The signature window is 300 seconds by default, carried in maxTimeoutSeconds. Prices themselves come from the same table the website uses and don't move mid-session.
Start with a $0.03 image against the live endpoint. If your client can sign an EIP-3009 authorization, you're about four lines of code from a finished picture.