How to sell an API, step by step
To sell an API you need four things: a public HTTPS endpoint that does one job well, a price, a way to take payment and control access, and a page that shows a working request and response. You can build billing yourself with keys and Stripe, list on a marketplace such as RapidAPI, or list on iamai.markets, where AI agents pay per call in USDC with no sign-up and you keep 95%. The first listing is free.
The steps
- Pick a narrow job a buyer would pay to skip building: convert, check, look up, summarise.
- Deploy it on a public https:// address. A serverless function is enough to start.
- Write one example request and one example response. Buyers decide from these in seconds.
- Choose billing: monthly plans, metered usage, or pay per call.
- Protect the endpoint so only paid traffic gets through: API keys, a gateway, or signed calls from a marketplace.
- List it where your buyers look, and watch errors and latency from day one.
Three ways to take payment
RapidAPI's fee is from its Payouts and Finance docs. Many sellers use more than one route; a listing on one doesn't stop you selling on another.
| Route | You handle | Cut |
|---|---|---|
| Your own site with Stripe | Sign-up, keys, metering, invoices, failed cards | Card fees only |
| RapidAPI | Plans and the endpoint; Rapid handles keys and billing | 25% marketplace fee, paid out via PayPal |
| iamai.markets with x402 | The endpoint and a signature check | 5% fee; payout to your crypto wallet after a 7-day hold |
Selling on iamai.markets
- Set a price from $0.01 to $100 per call, in whole cents.
- Buyers, mostly AI agents, pay per call in USDC on Base through x402. No account or key on their side.
- A buyer is charged only when your endpoint answers with a 2xx status within 25 seconds and the response is 1 MB or less.
- Your API appears in our catalogue, in our MCP server, in /.well-known/x402, and with public call stats.
Check that a call came from us
Each forwarded call carries X-Iamai-Timestamp, X-Iamai-Call-Id, X-Iamai-Buyer, X-Iamai-Signature and X-Iamai-Signature-Version: 2. The signature is a hex HMAC-SHA256 of timestamp.call_id.method.path_and_query.body with your signing secret.
import { createHmac, timingSafeEqual } from "node:crypto";
export function isFromIamai(req, rawBody, secret) {
const ts = req.headers["x-iamai-timestamp"];
const id = req.headers["x-iamai-call-id"];
const sig = String(req.headers["x-iamai-signature"] ?? "");
if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false; // older than 5 minutes
const msg = `${ts}.${id}.${req.method}.${req.url}.${rawBody}`; // req.url = path + query
const want = createHmac("sha256", secret).update(msg).digest("hex");
return sig.length === want.length && timingSafeEqual(Buffer.from(sig), Buffer.from(want));
}
Mistakes that cost first sales
- An example request that doesn't work when pasted.
- Answering errors with HTTP 200, so buyers pay for failures.
- Slow cold starts that pass 25 seconds on the first call.
- A price that ignores your own costs per call, such as AI model or data fees.
Questions
Do I need a company to sell an API?
Not on iamai.markets; you need a crypto wallet for payouts. Your local tax rules still apply to what you earn.
What does listing cost?
Your first listing is free. You pay the 5% fee only on sales.
Can I sell the same API on RapidAPI too?
Yes. Nothing stops you listing in several places.
Related
Updated 2026-12-02