Agents pay you. Automatically.
There’s a new kind of customer that pays per call, around the clock. Turn your API into something agents can buy from, in one line.
API monetization is broken.
You built an API. Today, to spend 20 cents, a customer has to create an account, verify their email, add a card, generate a key, and configure billing. Agents aren’t built for that, so a huge amount of commerce never happens.
Who feels it: API providers, data and content sellers, SaaS tools, and indie devs on API marketplaces.
One line, or no code at all.
Self-host with the middleware, or let AgentPay host a paywall proxy in front of your backend. Either way you get 402 handling, receipt checks, and retries for free.
import { Hono } from "hono";
import { requirePayment } from "@agentpay/merchant";
const app = new Hono();
// One line. Returns 402 to unpaid agents, verifies
// the signed receipt, then lets the request through.
app.use("/api/*", requirePayment({ price: "$0.05" }));
app.get("/api/echo", (c) => c.json({ ok: true }));# No code change. Point AgentPay at your backend # and we host the paywall in front of it. # Agents call us: https://agentpay-gateway.fly.dev/m/your-org/search # We return 402, take payment, then forward to: https://your-backend.com/search
// Charge per token / per unit instead of per call.
app.use("/v1/chat", requirePayment({
meter: { unit: "1K tokens", price: "$0.002" },
maxAuthorize: "$5.00", // hold up to $5
}));
// After the work, report usage; we settle the exact amount.
c.header("X-AgentPay-Units", String(tokensUsed));A flat price per request.
The simplest model. $0.05 a call, $2.00 a call, whatever the endpoint is worth. The agent pays it, you serve the response.
Per token, per second, per unit.
Authorize a max hold, do the work, then settle the exact usage. Ideal for inference, search depth, or anything that varies per call.
Cash out to a bank or an on-chain wallet.
Every agent call shows up with the amount, the agent, and the rail it settled on. Earnings net on a schedule and pay out to Stripe Connect or USDC on Base.
Keep your API exactly as it is
No new billing system, no subscriptions to model, no checkout pages. One middleware line, or let us host the proxy.
Trust an agent you’ve never met
Every paying agent carries a signed identity passport. Require verified agents at your door, or take all comers.
Money to your bank or wallet
Earnings settle to Stripe Connect or USDC on Base, netted on a schedule. See revenue by service and by agent.
Get paid by agents.
Whether you run a SaaS API or sell tools to agents, the integration is one line and the sandbox is free.