Published November 19, 2026
To charge for an AI agent, an API or an MCP server, pick a unit people understand — a call, a task, a month — and sell it in advance as prepaid credits or a plan. Check the balance on your server before each call, and answer an empty balance with a link to top up. Payment can come by card or in crypto; with stablecoins and a non-custodial gateway it goes from the buyer straight to your own wallet, from most countries.
A usage-based product costs you money on every call: model tokens, compute, other people's APIs. The price should follow the same unit, or a bundle of it a person can reason about.
An agent can make hundreds of calls in a minute without anyone watching. If you bill afterwards, a loop in someone's code or a leaked key becomes a debt you have to chase. With credits sold in advance, the most anyone can spend is what they already paid, and the person behind the agent decides how much that is. The payment stays with a person: they top up in the browser, and the agent only spends.
HTTP reserves a status code for this, 402 Payment Required, and leaves its exact use to each API. Return it with a short message and a link where the person can top up, and an agent will show that link to the person it works for instead of failing silently. A paid MCP server can do the same from inside a tool: return the top-up link as the tool's answer, and the assistant passes it on.
There are protocols that let an agent pay for each request from a wallet of its own. They suit payments between machines, but they mean giving software the keys to money, setting limits on it, and accepting payments nobody approved at the time. For most products sold to people today it is simpler and safer for the person to pay, once and in advance, and for the agent to spend a balance it cannot go beyond.
Cards are familiar, but card processors take a percentage of each payment, can hold back payouts, allow chargebacks, and do not reach every country. Stablecoins such as USDC and USDT (the difference) arrive within a minute on low-fee networks (network fees), from most of the world, and cannot be charged back. With a non-custodial gateway, each top-up gets its own address derived from your public key and lands in your wallet, while the gateway watches the chain and, once a top-up is paid, adds the credits to the buyer's balance or tells your server through a signed webhook. More on the set-ups: how to accept crypto payments.
Sell credits or a plan to the person who uses it, check the balance on your server inside each paid tool, and when it runs out return a link to top up. The assistant shows the link, the person pays, and the tool works again.
HTTP reserves it for requests that need payment and leaves the details open. APIs use it to say a balance or a plan has run out, together with a link or instructions to pay.
Credits fit when use and cost vary from request to request; a plan fits steady use. Many products offer both: a plan with a monthly allowance, and credits for anything above it.
It can be given a wallet, but it is usually simpler to let the person pay instead: they buy credits from their own wallet, and the agent spends the balance without holding any money.
This guide explains how things work. It is not financial, investment or tax advice. Something wrong? Write to hi@perly.io and we will correct it.
© 2026 Perly. All rights reserved.