Primitive/payments5 min read

Introducing /payments: let your AI agent pay for x402 resources in USDC

Give each agent its own crypto wallet and let it settle x402 paywalls autonomously — quote the price, pay in USDC on Base, and reconcile every receipt, with the spend cap enforced inside the custody plane.

Read the docs →

/payments /payments /payments /payments /payments /payments /payments /payments /payments /payments
/payments /payments /payments /payments /payments /payments /payments /payments /payments /payments
/payments /payments /payments /payments /payments /payments /payments /payments /payments /payments
/payments /payments /payments /payments /payments /payments /payments /payments /payments /payments
/payments /payments /payments /payments /payments /payments /payments /payments /payments /payments
/payments /payments /payments /payments /payments /payments /payments /payments /payments /payments
/payments /payments /payments /payments /payments /payments /payments /payments /payments /payments
/payments /payments /payments /payments /payments /payments /payments /payments /payments /payments
/payments /payments /payments /payments /payments /payments /payments /payments /payments /payments
/payments /payments /payments /payments /payments /payments /payments /payments /payments /payments
/payments /payments /payments /payments /payments /payments /payments /payments /payments /payments
/payments /payments /payments /payments /payments /payments /payments /payments /payments /payments
/payments /payments /payments /payments /payments /payments /payments /payments /payments /payments
/payments /payments /payments /payments /payments /payments /payments /payments /payments /payments
Primitive/payments
TL;DR
  • /payments the buy-side x402 primitive: give an agent a crypto wallet and let it settle paywalls in USDC on Base
  • quote probe an x402 URL for its price with zero side effects; the wallet is not even loaded
  • pay fetch, sign a USDC payment within the wallet's limits, retry once, keep the receipt
  • receipts every settled payment links to its onchain transaction; reconcile buy-side and sell-side
  • No approval queue the per-transaction cap is enforced inside the custody plane at signing time, so it holds even if the runtime is compromised
  • Opt-in and per-agent off by default, no company-level fallback; pairs with /wallet, /cards, and /research

An agent that can research, email, and file paperwork still hits a wall the moment a resource costs money — the metered API, the paywalled report, the pay-per-call model endpoint. Naïve is the autonomous company infrastructure that gives agents real-world capabilities, and /payments is the primitive for the open-web equivalent of pulling out a card: give each agent its own crypto wallet and let it settle x402 paywalls in USDC — quote the price, pay, and keep the receipt.

x402 is the HTTP 402 payment protocol. A paywalled resource answers a request with 402 Payment Required and a header describing what it accepts. /payments gives each agent a per-agent wallet (USDC on Base) and lets it settle those 402s autonomously: quote the price, sign a USDC payment, retry the request, keep the receipt.

The three verbs

CommandDescription
naive payments quoteProbe an x402 URL for its price — no side effects
naive payments payPay for and fetch an x402 resource — sensitive, spends real USDC
naive payments receiptsList x402 payment receipts

quote runs only the first two steps of the flow, which is why it has zero side effects. pay runs the full buy-side flow: fetch → decode the 402 → check the caps → sign in the custody plane → retry once with the payment attached → persist the receipt.

Quote — learn a price safely

naive payments quote --url https://api.example.com/report
naive payments quote --url https://api.example.com/report --method POST

Probes the URL and returns its payment requirements without paying. Zero side effects — the wallet is not even loaded, so this is the safe way to learn a price. If the resource is not paywalled, quote returns free: true with the real HTTP status.

Pay — the full buy-side flow

naive payments pay --url https://api.example.com/report
naive payments pay --url https://api.example.com/report --max-amount 0.50
naive payments pay --url https://api.example.com/report --method POST

Fetches the resource; if it returns 402, signs a USDC payment from the agent's wallet, retries the request once with the payment attached, and returns the resource body plus a receipt.

FlagDescription
--url <url>The x402 resource URL (required)
--max-amount <amount>Refuse to pay more than this — a per-call ceiling in decimal USDC
--method <method>HTTP method (default GET)

pay is sensitive — it spends real USDC. There is deliberately no approval queue. What bounds a payment:

  • The wallet balance — an agent cannot spend what isn't there.
  • perTxMax — enforced at runtime and as a static policy inside the custody plane at signing time. Set it with naive wallet policy.
  • dailyBudget (optional) — a rolling runtime counter, reserved before the payment is signed.
  • --max-amount — a ceiling on this one call. The effective cap is min(--max-amount, perTxMax).

If the resource returns something other than 402, no payment is made — the response comes back with paid: false and no receipt.

Receipts — reconcile every payment

naive payments receipts
naive payments receipts --direction buy --limit 10
naive payments receipts --origin https://api.example.com
naive payments receipts --since 2026-07-01T00:00:00Z
FlagDescription
--direction <direction>buy (paid out) or sell (received)
--origin <origin>Filter to one resource origin
--since <iso>Only receipts at/after an ISO-8601 timestamp
--limit <n>Max receipts to return

Every settled x402 payment is recorded here, each linking the payment to its onchain transaction (txHash). Amounts on a receipt are decimal USDC strings. An agent-to-agent payment produces two receipts sharing an origin and nonce — a buy on the payer and a sell on the payee.

From code

The same three verbs are on the SDK client, per agent:

// Probe the price — zero side effects
const quote = await naive.forUser(alice.id).payments.quote({
  url: "https://api.example.com/report",
});
// quote.free, quote.status, quote.accepts[]
 
// Pay for and fetch it, refusing to spend more than $0.50 on this call
const result = await naive.forUser(alice.id).payments.pay({
  url: "https://api.example.com/report",
  max_amount: "0.50",
});
// result.status, result.body, result.paid, result.receipt
 
// Reconcile
const receipts = await naive.forUser(alice.id).payments.receipts({
  direction: "buy",
  limit: 10,
});

Or the raw API — the endpoints are POST /v1/users/:user_id/payments/quote, POST …/pay, and GET …/receipts:

const res = await fetch(
  "https://api.usenaive.ai/v1/users/USER_ID/payments/pay",
  {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${process.env.NAIVE_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      url: "https://api.example.com/report",
      max_amount: "0.50",
    }),
  },
);
const { status, body, paid, receipt } = await res.json();

Inside an agent loop, the same surface is available as MCP tools — naive_payments_quote, naive_payments_pay (marked sensitive), naive_payments_receipts, and the read-only naive_wallet_balance. The wallet's admin verbs are deliberately not agent tools.

What you can build

Pay for pay-per-call research and data — Pair /payments with /research so an Employee can buy the metered API or premium report it needs, then cite it. The purchase is a receipt, not a mystery line item.

Evaluate vendors, then commit — A finance Employee quotes several priced endpoints, compares, and pays for the one it picks — every step reconciled against the receipt log.

Build agent-to-agent economies — One Employee pays another for work by URL; both sides get a receipt sharing the same nonce, so settlement between agents is auditable end to end.

Settle metered steps inline — Pay the paid image model, the paid TTS endpoint, or the paid enrichment API mid-pipeline, bounded by a cap the agent physically cannot exceed.

Get started

Drop this starter prompt into any coding agent to wire up Naïve:

Read https://usenaive.ai/skill.md and use it to set up Naïve in my project.

Frequently Asked Questions
What is /payments?+
/payments is the Naïve primitive that lets an agent settle x402 paywalls (HTTP 402 Payment Required) autonomously. Each agent gets its own crypto wallet (USDC on Base); the agent quotes a resource's price, signs a USDC payment within its spend limits, retries the request with the payment attached, and keeps an onchain receipt. It has three verbs: quote, pay, and receipts.
When should I use quote vs pay?+
Use quote to learn a price safely — it returns the resource's payment requirements without paying, with zero side effects (the wallet is not even loaded). Use pay when the agent has decided the resource is worth it: pay fetches the resource, and if it returns 402, signs and settles a USDC payment and returns the body plus a receipt. pay is sensitive — it spends real funds.
Why is there no approval prompt before a payment?+
Because the per-transaction cap (perTxMax) is enforced inside the custody plane at signing time, not just in the runtime. The signer will refuse to authorize a payment over the cap no matter what the agent asks — a guarantee that survives a fully compromised runtime, which a human approval click cannot make. A payment is bounded by four things: the wallet balance, perTxMax, an optional dailyBudget, and the per-call --max-amount ceiling.
What units are amounts in?+
A quote's accepts[].amount is in atomic units — USDC has 6 decimals, so 500000 means 0.50 USDC. Everything you set or read as a human — --max-amount, perTxMax, dailyBudget, and receipt amounts — is a decimal USDC string like "0.50".
Which providers does it use?+
Custody uses the wallet provider — cdp (Coinbase CDP hosted custody, where you bring your own CDP credentials) or fake (a credential-free in-memory double for local dev). Verification and settlement run through the CDP hosted facilitator when configured, and paid-resource discovery uses the CDP Bazaar catalog with a direct-quote fallback. All x402 wire encoding and decoding is handled by the @x402 libraries — nothing is hand-parsed.
How do I get started with /payments?+
Enable payments on the Account Kit (it is opt-in), select an agent with naive use <alice> since the wallet is per-agent, then run naive payments quote --url <url> to probe a price and naive payments pay --url <url> --max-amount 0.50 to settle it. The full guide is at usenaive.ai/docs/getting-started/payments.
A
AshleyEngineering

Engineering at Naïve. Owns the payments and wallet primitives.

Keep reading