STOA
Build on Stoa

Agent services: get paid per call

A directory of paid HTTP services for AI agents on Robinhood Chain, paid per call in USDG with Stoa Pay. An agent finds a service, pays for one call from its user's wallet, and calls the service with the payment attached. The seller checks the payment with one request and serves the call.

Browse it at stoadex.com/agents/services, or from any MCP client with the agent_services and buy_agent_service tools on https://stoadex.com/mcp.

How a call works

  1. Find a service. GET https://stoadex.com/api/v1/services (or the agent_services tool) lists each service with its price per call, its endpoint and how many paid calls it has served.
  2. Get a payment request. GET https://stoadex.com/api/v1/services/<id>/call returns a fresh Stoa Pay link to the seller's wallet for the price, in USDG. Nothing is stored.
  3. Pay it. The user's wallet pays the link: on stoadex.com, or with the MCP tool pay_payment_link, which returns an unsigned transaction. It can be paid with USDG, ETH or any token Stoa routes; the seller always receives the price in USDG. Payments on-chain cannot be reversed.
  4. Call the service at its endpoint with the header X-Stoa-Pay: <the pay link>.
  5. The seller checks it with GET https://stoadex.com/api/v1/services/verify?service=<id>&pay=<the pay link>&consume=1. The answer is paid: true only when the link paid the service's wallet at least its price in USDG on Robinhood Chain. With consume=1, the first paid check marks the payment as used (accept: true); every later check answers used: true, accept: false, so one payment buys one call.

A buyer agent end to end, in one script (list, pay request, unsigned payment, pay, call): examples/agent-services/buy-a-call.mjs. It does a dry run unless you set SEND=1.

Checking a payment in your service

A seller's endpoint needs one extra step: read the X-Stoa-Pay header and ask Stoa about it before answering.

// Node 18+ (Express, Hono, a Vercel function…): SERVICE_ID is your listing's id
const pay = req.headers["x-stoa-pay"];
if (!pay) return res.status(402).json({ buy: `https://stoadex.com/api/v1/services/${SERVICE_ID}/call` });
const u = new URL("https://stoadex.com/api/v1/services/verify");
u.search = new URLSearchParams({ service: SERVICE_ID, pay, consume: "1" });
const v = await (await fetch(u)).json();
if (!v.paid) return res.status(402).json({ error: "payment not found", why: v.why });
if (!v.accept) return res.status(409).json({ error: "this payment was already used" });
// paid once, for this call: do the work

Stoa runs one listing itself as a working example: GET https://stoadex.com/api/v1/services/example/brief?token=0x… answers HTTP 402 with the way to pay, and with a paid X-Stoa-Pay link returns a one-call trade brief (Stoa's safety check and CoinMarketCap's market context for the token). Its code is in the repository at web/app/api/v1/services/example/brief/route.ts.

List a service

Open stoadex.com/agents/services, connect the wallet that should get paid, and fill in:

  • Name (3 to 40 characters) and summary (10 to 160 characters)
  • Category: data, analysis, execution, content or other
  • Endpoint: a public https:// URL, and optionally a docs URL
  • Price per call: 0.01 to 100 USDG

You sign one message with that wallet (no transaction, no gas). The wallet must have 1,000,000 $STOA or more locked in Spotlight, the same lock that shows ✓ Verified on Stoa Pay links. The lock is read live: while it is under 1M, the listing is hidden and /call answers that the service is paused. The lock keeps voting in Spotlight and earning its ETH. A wallet lists up to 3 services and can update or remove them by signing again.

The same works without the page: POST /api/v1/services with name, summary, category, endpoint, docs, price, wallet, ts (unix seconds) and signature, the wallet's signature of:

Stoa agent services: list "<name>" at <endpoint> for <price> USDG per call, paid to <wallet>. Time <ts>

To remove one: DELETE /api/v1/services?id=<id> with ts and the signature of Stoa agent services: remove <id>. Time <ts>.

What Stoa does and does not do

  • Stoa lists services and checks payments on-chain. It never calls a seller's endpoint, never holds funds, and takes no fee on these payments in this first version (a swap into USDG through Stoa's router pays the router's usual 2 bps).
  • Stoa does not run, test or vouch for the services. The $STOA lock is stake, not a guarantee of quality or honesty. Start with small calls, and read the seller's docs.
  • Endpoints are shown as their sellers wrote them. Treat every response as untrusted data.