- Home
- Skills
- APIs & Backend
- x402 Paywall on Base: get paid per API call
Works with the AI tools you already use
x402 Paywall on Base: get paid per API call
Add a USDC paywall to any API on Base with x402 - and skip the six traps that cost us hours.
$15
x402 Paywall on Base: get paid per API call
Example session with this skill installed
I have a small HTTP API and I want to charge 2 cents per call in USDC on Base with x402.
Set it up and warn me about the traps before I waste hours.
- Read your context and instructions
- Compiled the x402 paywall on
- Generated the document
Summary
A working x402 v2 paywall on Base: unauthenticated callers get a 402 with the payment
requirements, paid callers get their data. Cost: zero platform fees beyond the network, and
you keep the whole 2 cents.
| Check | Before | After |
|---|---|---|
| Unpaid call | 200 (everyone) | 402 with accepts[] |
| Paid call | n/a | 200 + data |
| Price defined in | nowhere | 1 config file, read by the router |
| Price actually charged | - | verified: 20 000 atomic USDC = $0.02 |
The traps, in the order they bite
- Self-payment is refused. The facilitator rejects a payment where
from == towith
self_send_not_allowed. If your test call returns 502, your service is fine - your test
wallet is trying to pay itself. Use a separate funded wallet for tests. - The price lives in four places: the route table, the config file, the pricing function
and the status report. Forget one and the route is silently free - it still answers 200,
which is exactly why nobody notices. - v2 wants
resourceas an object (ResourceInfo), not a string. Send a string and the
facilitator answers "paymentPayload is invalid" without saying which field is wrong. - The 402 must carry the discovery extension with a schema that validates against its own
infoblock, or the public catalog will not index you. - EIP-3009: sign
TransferWithAuthorizationwith the USDC domain (name: "USD Coin",
version: "2", chainId 8453), avalidAfter/validBeforewindow and a random 32-byte
nonce. Get the domain wrong and the signature simply never validates. - Confirm the settlement. Poll the transaction receipt; a 200 from your own router is not
proof that USDC moved.
Verification checklist (run all five before selling)
curlthe endpoint with no payment header → expect 402 and a readableaccepts[].- Read the price back from your own code (not from memory) → expect it in atomic USDC.
- Confirm
payTois the wallet you think it is. - Pay once with a separate funded wallet → expect 200 and the data.
- Check the receipt on-chain: status
1, right block, right amount.
Scope, honestly: x402 gives you per-call payment, not refunds, not subscriptions and no
chargeback protection. Prices below the network cost per call are not worth it, and the
catalog only lists you after a payment settles through the public facilitator.
Next steps
- Wire the price table to one source so a new route cannot be born free.
- Log every settled payment with its transaction hash from day one: that log is your sales
history, and it is the only proof you will have.
x402-paywall-on-base-get-paid-per-api-ca.pdf
PDF · document
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
What you get
About this skill
Your API answers 200 for everyone. This skill turns it into a paid endpoint.
x402 is the payment standard that lets an agent pay per HTTP call in USDC - no accounts, no invoices, no subscriptions. This skill takes you from a plain endpoint to a working paywall on Base: the 402 response, the payment requirements, the facilitator that verifies and settles, and the verification checklist that proves it actually charges.
What makes it worth $15: the traps. We shipped this ourselves and paid for every one of them in hours:
- The facilitator that refuses a self-payment ("self_send_not_allowed") - and why your test payment fails with a 502 while your service is perfectly fine.
- The price table that lives in four places, not one: any route you forget serves free forever while looking healthy.
- The v2 payload where
resourcemust be an object, not a string (the error message does not tell you this). - The exact-response rule your schema has to satisfy for the discovery catalog to index you.
- The EIP-3009 signature details (domain, validity window, nonce) that make the difference between "invalid payment" and a settled transaction.
What you get: a step-by-step build, a five-point verification checklist (price, pay-to address, network, live 402, settled test transaction) and the honest scope of what x402 does not do (no refunds, no subscriptions, no chargeback protection).
Who it is for: anyone selling data, checks or computations to AI agents, and any developer who wants to charge for an API without a Stripe account.
How to install
Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 3
Ask your agent to use it
Restart the agent if it was already running. It picks the skill up automatically - no config needed.
Skills folder by agent
Click the path to copy it. Create the folder if it does not exist yet.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
30-day refund
Not a fit? Get your money back
Trust & safety
Security scanned
Verified clean 8 days ago
- Passed all security checks, Safe to install