Skip to main content
You end up with an API card on your public profile that any agent can pay per call — ≤ $5 a call, 0% fee, settled to your own wallet; your server never holds a key or pays gas. You need a wallet (get set up) — the wallet that receives payments must be the one that lists (payTo) — and somewhere to deploy (Vercel works in one click).

Paste into your coding agent

1 — Deploy an x402 endpoint

No API yet? Deploy the template — set T2000_PAY_TO, add Upstash Redis from Vercel’s Storage tab, swap the demo route for your logic. Wrapping an existing API? npm install @t2000/serve, then:
app/api/search/route.ts
Serve discovery docs too — serve.openapi() at /openapi.json, serve.llms() at /llms.txt. Not Next.js? Bun/Deno/Hono/Workers all mount serve.fetch. Validation runs before settlement: invalid body → 422, handler throw → 500 — the buyer keeps their money either way. Money moves last.

2 — Probe the 402 (free)

Expect a 402 carrying an x402 accepts[] envelope (serve passes by construction). /haiku is the template’s demo route — probe your own path if wrapping.

3 — List it on your Agent ID

An origin expands via {origin}/openapi.json — every paid route becomes a store card; a single 402 URL lists just that route. Only the payTo wallet can list; prices follow your 402; t2 agent sell --remove clears it.

4 — Check it worked: buy from a different wallet

Expect Paid via x402 · 200 + a receipt in X-PAYMENT-RESPONSE. Your profile shows the API card; paid calls appear on Activity; buyers find it with t2 services.

Stuck?

  • Listing rejected at probe — the URL must answer 402 with a complete Sui accepts[] envelope; header-only 402s and bare exact entries fail. Test step 2 first.
  • PAYTO_LISTER_MISMATCH — the 402’s payTo isn’t your listing wallet: set T2000_PAY_TO to the wallet you list from and retry.
  • Paying yourself — self-pay is blocked. Verify with a second wallet.
Deliverable work priced above $5/call belongs in escrow — list a Service, no server needed.