Docs

Add 628 tools, the cross-seller index and Smart Order Router, and an OpenAI-compatible /v1 gateway to your agent. Start free with proof-of-work, then pay per call in USDC on the chains in /pricing.

terminal
# one file, no install - pays with COMPUTE (no wallet)
curl -s https://agent402.tools/demo.js -o demo.js
node demo.js

# or settle USDC on Base with a funded EVM key (four packages, same file)
npm i @x402/core @x402/evm @x402/fetch viem
# Use a new wallet holding only a few dollars of USDC. Never your main wallet.
AGENT_KEY=0xYOUR_FUNDED_KEY node demo.js

// an autonomous buyer discovers the catalog, gets quoted over HTTP 402, settles, and uses the result - zero humans.

The demo signs on the EVM rails. To pay on Solana, Stellar or Algorand, see Paying with x402.

How payment works.

01Your agent calls a paid endpoint and receives HTTP 402 Payment Required with the price and payment details.
02An x402 client (@x402/fetch, axios, or any framework adapter) signs a USDC payment from its wallet and retries.
03Payment settles on-chain (Base or any rail the 402 offers) and the response comes back. Total overhead: one extra round trip.

Three ways in.

A / MCPClaude & any MCP client
# Claude Code - hosted connector (no install; free proof-of-work tools, paid tools need a wallet client)
claude mcp add --transport http agent402 https://agent402.tools/mcp

# Claude Code - npm server with a funded EVM key (paid tools settle via x402)
# Use a new wallet holding only a few dollars of USDC. Never your main wallet.
claude mcp add agent402 -s user -e AGENT_KEY=0xYOUR_FUNDED_KEY -- npx -y [email protected]

# Cursor - ~/.cursor/mcp.json
{
  "mcpServers": {
    "agent402": { "url": "https://agent402.tools/mcp" }
  }
}

Every other host, each block read from its own docs: VS Code, Windsurf, Cline, Roo Code, OpenAI Codex CLI, Gemini CLI, Continue, ElizaOS, Bedrock AgentCore, any OpenAI or Anthropic SDK. Shortlinks: agent402.sh/cursor, agent402.sh/vscode, agent402.sh/codex; one-shot install curl -fsSL agent402.sh/install | sh.

B / x402 clientpay in code
// npm i @x402/core @x402/evm @x402/fetch viem
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
client.setSpendControls?.(false);  // your own code bounds spend
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.AGENT_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/extract", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ url: "https://example.com" })
});
console.log(await res.json());
C / SDKresolves a task & pays automatically
npm install agent402-client
import { Agent402 } from "agent402-client";
const a = new Agent402();           // free tier (proof-of-work)
const out = await a.call("hash", { text: "hello", algo: "sha256" });

Free tier - proof-of-work.

The 170 pure-CPU tools (of 628 in the catalog) work with no wallet. Instead of paying USDC, your machine solves a short sha256 puzzle - a fraction of a second of CPU - and the call goes through. Nothing here consumes AI tokens.

GET/api/pow/challenge?slug=<tool>returns a challenge; solve it and resend the call with X-Pow-Solution; free, rate-limited

/v1 - OpenAI-compatible LLM gateway.

Point any OpenAI SDK at base_url https://agent402.tools/v1 and pay per call in USDC over x402 - no API key, no signup, same wallet-is-the-identity model as every other tool. These routes are model-backed. Chat has flat quality tiers ($0.003 nano to $0.50 premium) plus a $0.01 auto tier that routes on your prompt with no model required; embeddings are $0.002 with a default-on cache; image generation is $0.08 per image. A flat-tier answer carries agent402_metered whenever the same body would have been materially cheaper on the metered route, with the two figures and the endpoint to point at.

POST/v1/metered/chat/completionsfrom $0.001 · quoted per request from its body, settles what the call used under that quote
POST/v1/metered/messagesfrom $0.001 · the same quote-then-settle-actual pricing on the Anthropic Messages wire
POST/v1/metered/responsesfrom $0.001 · the same pricing on the OpenAI Responses wire (Agents SDK, Codex CLI)
POST/v1/chat/completions$0.02 · base tier ($0.003–$0.50 across the nano…premium paths)
POST/v1/auto/chat/completions$0.01 · model optional, auto-routed
POST/v1/embeddings$0.002 · free repeat within 10 min
POST/v1/images/generations$0.08 per image
POST/v1/audio/speech$0.06 · mp3/pcm bytes out
and 43 more /v1 routesevery /v1 route with its price

Decide - a plan for any job.

Describe a job and get a call-ready plan over this catalog and indexed x402/MPP sellers with a recent live 402. Each step names its tool, endpoint, price and fallbacks, with params that validate against the tool's input schema. Needs no indexed tool covers come back as gaps.

Every candidate is scored by one formula with the same weights: fit, observed reliability, price, schema quality and a freshness pass mark, with no term for who sells the tool. An outside tool is eligible when a live 402 was seen in the last 7 days and its input schema is known. Every tool in a plan carries firstParty, so you always see whose tool it is.

A decide fee paid with a wallet comes back as a credit, valid 24 hours, toward running that plan with /api/decide/execute. First-party steps run at list price; third-party steps are bought from the seller and resold at the seller's price plus a 5% markup. Spend stops at your budget, and any unspent amount returns as credit until the decision's window closes.

POST/api/decidequick $0.003 · plan $0.01 · full $0.03
POST/api/decide/executeplan budget less credit
POST/api/decide/feedbackfree

Why pay here.

Seven claims, each linked to the surface that proves it.

01 / PRICE

Pay for usage, under a quoted ceiling.

Metered calls quote a ceiling in the 402 and settle the actual usage under it, with a receipt on each settled call.

the metered tier →OpenClaw setup →
how it works +

Pay for what the model used, with the ceiling quoted first. On the metered gateway every 402 quotes this exact request from its own body. A wallet that can pay with the upto scheme settles the actual usage under that ceiling; provider discounts such as prompt-cache reads pass through. Every settled x402 or MPP response carries a receipt. A JSON answer bought with an EVM wallet can then be attested on Base by that same wallet: POST /api/attest with the settlement transaction writes an Ethereum Attestation Service record of the tool, the response digest and the payment, from our wallet, so an agent can prove afterwards what it acted on. Streamed and binary answers carry no digest, and wallet-scoped routes such as memory are never attested.

02 / FAILURE

A failed x402 call is not charged.

Settlement runs after the answer and an error cancels it; a keyed retry replays the paid answer instead of paying twice.

check a payment →how it settles →
how it works +

A failed x402 call is not charged, and the response shows it. Settlement runs after the handler answers and an error status cancels it, so a response with no payment receipt, or a receipt marked success:false, moved no money. A retry that carries the same idempotency key and the same payment credential replays the paid answer instead of paying again. The one residual case, a settled receipt on an error response, is detected by our own alarm and recorded as a debt in a refund ledger, never written off silently. A Tempo push payment is sent before the call runs, so a call that then fails is recorded as a refund owed the same way. Anyone holding the settlement transaction can check it for free at /api/refunds/lookup and see our refund transaction once it is sent.

03 / ONE KEY

One key buys everything.

One wallet pays for LLM tiers on four wires, embeddings, images, speech, 500+ tools and finished reports.

tools →gateway models →
how it works +

One key buys everything. The same wallet pays for flat LLM tiers and a metered tier on four wires (OpenAI chat, OpenAI Responses, Anthropic Messages, Gemini generateContent), embeddings, rerank, images, video, speech, transcription, grounded answers with citations, 500+ tools and finished reports, and an EVM wallet also keys its own memory. One paywall, one key.

04 / NO WALLET

Some calls need no wallet.

Proof-of-work pays for the pure-CPU tools, and cards pay over MPP and at report checkout.

ways to pay →card checkout →
how it works +

Some calls need no wallet. Proof-of-work pays for the pure-CPU tools, cards over MPP pay any route priced at $0.50 or more, and card checkout sells the finished reports, beside USDC or USDG on 13 chains and native MPP on Tempo. An agent with a wallet never needs an account.

05 / DELIVERABLES

Finished work, ready to use.

Dossiers, 13F holdings, filing reports, domain audits and deep research from live sources; monitors re-run them on change.

report products →monitors →
how it works +

Finished work, ready to use. Company dossiers, insider flow, 13F holdings, filing reports, IPO digests, domain audits, token risk, deep research, market briefs, recall watch and a LinkedIn article package, grounded in live sources, most with a downloadable data appendix. Monitors check for free on a schedule and re-run the paid report when the facts change, up to 4 full reports in any 30 days; past that a change arrives as an alert.

06 / ROUTING

We source from other sellers.

Route-and-execute buys the result from the best seller, ours or anyone else's, under one receipt.

route-and-execute →the seller index →
how it works +

We source from other sellers. Route-and-execute resolves a task to the best seller across the whole ecosystem, ours or anyone else's, buys the result from that seller with our own wallet and sells it to the agent under one receipt. Sellers are routable on proven on-chain settlement, with one exception: a seller with no settlement history yet is tried only after every proven candidate, capped at $0.05 a call on Base (at most $0.25 a day per seller, $5.00 a day in all) and $0.01 a call on Solana, and flagged unproven on the receipt.

07 / PROOF

Everything is checkable.

Outside uptime probes, a daily real-money canary, published transactions, open source and an on-chain operator identity.

receipts →status →
how it works +

Everything is checkable. Uptime is observed by two probes outside production, a real-money canary buys through every on-chain rail daily, transactions are published by rail and by wire, and the whole server is open source and self-hostable. The deterministic tools are pure code with no model in their path - parsers, hashes, math, a real browser - and the ones that DO run a model are named rather than blended in: the /v1 gateway tiers, the report products, the image, speech, transcription, embedding and AI-answer tools, the Decide planner, and the judgment model that can pick among the router's shortlisted candidates. Every 402 also carries the SHAPE of the answer before you pay: its first x402 accept declares an outputSchema, so an agent can check what came back against what was promised instead of taking a status code on trust. The operator is identified on-chain too: Agent402 is agent 94639 in the ERC-8004 Identity Registry on Base, and /.well-known/agent-registration.json is the record that registration points at, beside an A2A agent card at /.well-known/agent-card.json. So an agent can resolve who serves this catalog from the chain rather than from this page.

Side by side with the other ways in.

TaskHereBuilding it yourselfCalling each provider directly
Getting startedOne MCP add or one HTTP callWrite, host and monitor each handlerAn account and an API key per provider
PayingPer call over x402 or MPP; proof-of-work for the pure-CPU toolsBilling is yours to buildA plan or a prepaid balance per provider
Finding a toolA searchable catalog and /api/findOnly what you have builtEach provider's own docs
Errors and retriesOne JSON error shape; a keyed retry replays the paid answerYours to designA format per provider
Running itHosted, or self-host the open-source serverYours to runEach provider's own uptime

Examples.

Each task names the calls it makes and what they cost at today's per-call prices, read from the live catalog.

Research 50 public companies overnight

An analyst's agent walks 50 tickers, pulling filings, reported financials, the latest close and price history for each, and leaves 50 structured summaries ready for review in the morning.

Tools: edgar-filings, edgar-company-facts, stock-quote, stock-history

Cost at list price: $0.80 for 50 companies 50 × edgar-filings at $0.00550 × edgar-company-facts at $0.00550 × stock-quote at $0.00150 × stock-history at $0.005

Watch competitor pricing daily

A pricing agent reads 40 product pages every morning (render for the 20 JavaScript-heavy ones, extract for the 20 static ones, both returning markdown it scans for prices) and logs changes to its wallet-keyed memory for trend analysis.

Tools: render, extract, memory-write

Cost at list price: $0.42 per day 20 × render at $0.0120 × extract at $0.0120 × memory-write at $0.001

Answer customer questions with live web search

A support agent searches the live web for product documentation, gets a cited, model-written synthesis from the answer tool (model-backed) and includes the source URLs in its reply.

Tools: search, answer

Cost at list price: $0.09 per question 1 × search at $0.011 × answer at $0.08

Badges.

Show that a project runs on Agent402: paste a snippet into a README, docs page or site. Each image is served from https://agent402.tools/badges/{style}.svg, so an embed always shows the current badge.

Default

Shields-style badge with the tool count

Default badge
Markdown
[![Agent402](https://agent402.tools/badges/default.svg)](https://agent402.tools)
HTML
<a href="https://agent402.tools"><img src="https://agent402.tools/badges/default.svg" alt="Agent402"></a>

Flat

Flat version without the gradient

Flat badge
Markdown
[![Agent402](https://agent402.tools/badges/flat.svg)](https://agent402.tools)
HTML
<a href="https://agent402.tools"><img src="https://agent402.tools/badges/flat.svg" alt="Agent402"></a>

Powered by

Wider badge for project footers

Powered by badge
Markdown
[![Agent402](https://agent402.tools/badges/powered-by.svg)](https://agent402.tools)
HTML
<a href="https://agent402.tools"><img src="https://agent402.tools/badges/powered-by.svg" alt="Agent402"></a>

Reference endpoints.

GET/api/pricingmachine-readable catalog
GET/openapi.jsonfull OpenAPI 3.1 spec
GET/api/statslive counts & receiving wallet
POST/api/extract$0.01 · url → clean markdown
GET/llms.txtagent-readable site map