How to price an API for AI agents
Price each endpoint per call, in sats, at a fixed amount an agent can read before it pays. Start from your cost per call, add the margin you want, and keep the number small and stable enough to fit inside the per-call limits agents run with. The rest of this page explains each part and walks through examples. The examples are illustrations with made-up costs, not recommendations or market data.
Part of How to sell your API to AI agents.
How pricing works on Amazap
- Your price is the amount in your invoice. When you list on /sell, Amazap reads the satoshi amount from the Lightning invoice and stores it. You receive that listed price for each paid call when the live invoice fits the stored price. The displayed price does not refresh on its own. To change it, list the endpoint again.
- Buyers see one all-in price. You receive your listed price, the satoshi amount on your invoice, for each paid call. Amazap sets the shopper's all-in price.
- Agents have budgets. On Amazap, every
buycarries a hard cap from the quote, and balances have per-call and per-day limits. Outside Amazap, the L402 spec says clients should refuse invoices above their configured threshold (L402 spec), and Lightning Labs'lngetclient has a--max-costflag for exactly that (lnget docs). A price above an agent's limit is a price it never pays.
Four rules
- One price per endpoint. If one operation is cheap and another is expensive, make them separate endpoints with separate prices, rather than one endpoint that sometimes costs ten times more.
- Cover your marginal cost, with room to spare. Upstream fees, compute, bandwidth, and the cost of failures (a call that fails earns nothing and can get your listing paused).
- Price the result, not the effort. An agent compares your price with what the answer is worth to its task and with similar listings. Look at what similar endpoints charge on Amazap with
search_catalogthrough the Amazap MCP. - Stay stable. Agents and their humans plan around quoted prices. Change prices rarely, on purpose.
Sats or dollars?
Lightning invoices are in sats, so your L402 price is in sats. If your costs are in dollars, the sats price drifts as the BTC price moves. Two ways to handle it:
- Fixed sats. Simple, and the listing price never changes. Recheck it every so often.
- Dollar target, sats invoice. Compute the sats amount from a dollar target when you create each invoice. Amazap does this for its own Amazap Basics: Page to Markdown is priced at $0.01 and charged in sats at the rate in the quote. On 9 October 2026 that was 13 sats.
If you take the second route, remember that Amazap reads your price from your invoice, so the sats amount agents are quoted moves with your invoice.
Worked examples (illustrations only)
These use the rate seen on Amazap on 9 October 2026, where 13 sats bought $0.01 of Amazap Basics. The costs are invented to show the arithmetic.
Example A: a data lookup. Say each lookup costs you $0.002 in upstream fees and hosting. You want a healthy margin and a round number, so you price it at 10 sats (about $0.0077 at that rate). That is under a cent, which leaves room under most per-call caps.
Example B: model inference. Say one completion on your GPU, capped at 512 output tokens, costs you about $0.005 in electricity and wear. You price it at 20 sats (about $0.015). A long-form endpoint with a 4,096-token cap gets its own listing at a higher price. See Sell your self-hosted AI model.
Example C: a file or dataset extract. Say a cleaned CSV extract costs you little to serve but took real work to build. You price by value: 1,300 sats (about $1.00) per file.
In every case, write the price into the invoice your L402 endpoint issues. That's the number Amazap reads.
Free calls and samples
Agents can't try before they buy unless you let them. Options:
- A free sample endpoint that returns a fixed example response.
- Clear example parameters and an example response in your listing description.
- Answering unpaid requests with the 402 challenge (not an error) so agents and directories can always read your price.
Checklist
- [ ] One fixed sats price per endpoint
- [ ] Price covers cost per call, failures included
- [ ] Price is small enough to pass typical per-call caps
- [ ] Expensive variants are separate endpoints
- [ ] Unpaid requests get a 402 with the invoice, so the price is readable
- [ ] You know how often you'll revisit the price
Need the L402 part? The seller starter kit issues the invoice with your price.
Next: list your endpoint, or go back to protocol basics. Haven't set up payments yet?
Disclosure: Amazap is an Amboss referral partner. Amazap earns a referral credit if you sign up through this link.
FAQ
Should I price my API in sats or dollars?
L402 invoices are in sats, so the price an agent pays is in sats. You can keep a fixed sats price, or set a dollar target and compute the sats amount for each invoice. Amazap Basics are priced in dollars and charged in sats at the rate in the quote.
What is a good starting price per call?
There's no universal number. Start from your cost per call, add your margin, and check what similar listings charge on Amazap. Keep it within the per-call limits agents run with, because a client will refuse an invoice above its cap.
Do buyers on Amazap pay more than my price?
Yes. You receive your listed price, the satoshi amount on your invoice, for each paid call. Amazap sets the shopper's all-in price. The displayed price is the invoice amount at listing time and does not refresh on its own. On each buy, Amazap pays the live invoice only when it fits that stored price.
Can I charge different prices for different endpoints?
Yes. Each endpoint you list has its own L402 challenge, so each can have its own price. Split cheap and expensive operations into separate endpoints.
How do I price LLM inference per query?
Cap the output length on each endpoint, set a fixed price for that cap, and offer longer outputs as a separate, higher-priced endpoint. See the self-hosted model guide for details.