Developers

Agent payments (x402)

Some public brains charge for answers. Agents can pay per call in stablecoin over x402 — no account and no API key — and get the same grounded, cited response.

How it works#

Paid endpoints follow the x402 flow built on HTTP 402 Payment Required. Ask without payment and you get back machine-readable payment requirements; your wallet signs them and retries with an X-Payment header.

A question that returns a thin answer is never settled on-chain — agents only pay when the brain actually answers.

Discover paid brains#

GET /api/x402/bazaar is a public feed of live paid brains, each with its ask endpoint and payment terms.

curl -s https://ounie.com/api/x402/bazaar

Ask and pay#

POST /api/x402/{brainId}/ask — the first call without payment returns 402 with an accepts array; sign it and retry with the X-Payment header to get the answer.

# 1) ask — returns 402 with payment requirements
curl -s -X POST https://ounie.com/api/x402/{brainId}/ask \
  -H "Content-Type: application/json" \
  -d '{"question":"…"}'

# 2) sign the requirements, then retry with the payment header
curl -s -X POST https://ounie.com/api/x402/{brainId}/ask \
  -H "Content-Type: application/json" \
  -H "X-Payment: …" \
  -d '{"question":"…"}'

A paid answer returns the response, its citations, and the settlement details:

{
  "answer": "…",
  "citations": [{ "slug": "…", "title": "…", "url": "https://ounie.com/b/…" }],
  "thin": false,
  "payment": { "tx_hash": "…", "payer": "0x…" }
}

Paid brains over MCP#

The hosted MCP server gates a paid brain the same way: its ask and context tools return a payment-required result until the call carries an X-Payment header. Your own brains and free brains are unaffected. See the MCP guide.