Questions and answers

What sellers, buyers and the people building agents ask us most. Something missing? Write to hello@apivend.io.

Selling an API

What does apivend do?

It puts a price on the routes of an API you already run. People and AI agents pay per request in USDC over x402, the HTTP 402 Payment Required protocol, with no account and no API key. The money goes from the caller’s wallet straight to yours.

Do I have to change my API?

No. In the console you give your API’s address, the paths to sell and a price for each. apivend runs the gateway in front of it and your API answers as it always has. To make sure requests come only through apivend, the gateway sends a secret header your API can check; the docs show how.

Does apivend hold my money?

No. Each payment is a USDC transfer on chain from the buyer’s wallet to your payout address. apivend checks the payment and passes the request on; it never holds funds and cannot send them anywhere else.

When do I get paid?

Before the buyer gets the answer: each payment settles on chain first, and the answer goes out with the transaction in its receipt. Your settled payments are on the console’s dashboard and on any Base block explorer.

What does it cost?

Nothing during the launch period. After it, each endpoint gets 100 paid requests free, then a small fee per paid request is drawn from credit you buy in the console. Only payments on Base count; Base Sepolia is never billed.

Can I try it without real money?

Yes. Put an endpoint live on Base Sepolia, a test network with free test USDC, and pay it with Try it in the console. Move to Base when you are ready.

Can I use my own domain?

Yes, a subdomain of a domain you own, such as api.example.com, in place of the apivend.dev address. You add two DNS records and the console does the rest, certificate included.

Can my coding agent set it up for me?

Yes. Create an API key in the console and copy the agent instructions; your agent can create endpoints and put them live on Base Sepolia. Going live on Base and anything that moves money still need your wallet.

Paying for a call

Does a buyer need an account or an API key?

No. A wallet with USDC on Base and any x402 client are enough. We test with the x402 Foundation’s TypeScript (@x402/fetch), Python and Go clients.

How does a payment work?

An unpaid request gets 402 Payment Required with the price, the network and the wallet to pay. The client signs a USDC authorization (EIP-3009) for exactly that amount and sends the request again. The gateway checks it, settles it on chain, and returns the answer with a PAYMENT-RESPONSE header holding the transaction.

Does the buyer pay gas?

No. The buyer only signs. A payment facilitator submits the transfer and pays the network fee.

Can one payment be used twice?

No. Each authorization carries a one-time number, chosen by the buyer’s client, and the gateway accepts it once. The chain enforces the same rule.

Where is the buyer’s receipt?

In the PAYMENT-RESPONSE header of the answer: the transaction on Base. If that header never arrived, the payment is still easy to find: it is a USDC transfer from the buyer’s own wallet, visible on any Base block explorer, and the chain records it with the one-time number the buyer’s client chose. The seller sees the same payment on their dashboard.

When something goes wrong

What if the API fails?

The buyer is not charged. A payment settles only when the API answers with a 2xx. Errors, timeouts and aborted requests cost nothing.

What if the API answers 200 with something broken?

The gateway looks at the form of a JSON answer before it charges. An empty body, JSON cut off, an HTML page where JSON was expected, or an error dressed as a 200 is not charged and never reaches the buyer. Content is never judged: “no results” is an answer.

What if the connection drops after the payment?

x402 clients retry with a new payment. For 60 seconds, the same payer sending the same GET gets the answer it already paid for, with its original receipt, and the new payment is never settled. A retry that arrives while the first call is still running waits for it. This covers JSON answers of up to 256 KiB; a larger answer is charged again on a retry.

Why 60 seconds, and not longer?

Clients retry within seconds, and an x402 payment is valid for about a minute, so a minute covers real retries. A request minutes later is usually a new question: the data may have changed, and the buyer should get today’s answer, not a stale copy. Kept answers are also the seller’s data, so we keep them no longer than needed.

What if apivend itself is down?

Paid requests are refused, never served for free and never charged. If the chain, our state store or payment verification cannot be reached, the gateway says no rather than guess.

Agents and discovery

How do agents find my API?

With listing on, your endpoint goes into Coinbase’s x402 Bazaar after its first payment on Base, and onto x402scan a few minutes after it goes live. A listed endpoint also publishes /llms.txt, /openapi.json and /.well-known/x402, so an agent that lands on it can read what it sells and how to pay.

Can an AI agent pay on its own?

Yes, if it has a wallet and an x402 client. That is what x402 is for: an agent pays per call, with no sign-up, no stored card and no key to manage.

Open source

Can I run it myself?

Yes, on Kubernetes with Envoy Gateway. Your traffic never passes through us, and nothing is owed to apivend. The install guide starts from a single priced route.