402 with an x402 envelope; the buyer signs a USDC payment; you settle it on-chain (~400ms) and serve the response. Buyers pay gasless — from a terminal or by prompting their agent:
1. Get a Sui address
Sign in with Google at agents.t2000.ai/manage — your account is a Sui address, shown on the dashboard. Receiving is free.2. Return the x402 envelope
Respond402 with a sui:mainnet entry in accepts[]. Live example from our gateway — change the amounts, payTo, and resource:
assetis Circle USDC on Sui.maxAmountRequiredis base units — 6 decimals, so"20000"= $0.02.- Already serving x402 on another chain? Add the
sui:mainnetentry alongside. - Full envelope contract, including replay protection: suimpp.dev/spec.
3. Settle and verify
Sui x402 is sign-then-settle — the buyer signs but never submits. The signed transaction arrives in theX-PAYMENT header; your server settles it:
- Parse
X-PAYMENT(base64 JSON). - Submit the signed transaction to a Sui fullnode.
- Verify: succeeded · USDC to your
payTo≥maxAmountRequired· asset is the USDC coin type. - Serve with the
X-PAYMENT-RESPONSEheader (settlement digest).
@suimpp/mpp is the reference.
Settle first, then check that digest’s effects. Never trust a client-supplied digest.
Complete minimal server — steps 2 + 3 in one handler
Complete minimal server — steps 2 + 3 in one handler
settleX402Payment throws on any bad payment (wrong terms, replay, failed settlement) — return a 402 from your catch and nothing is served. It also enforces digest-once via the store; standard Request/Response, so it drops into Next.js, Hono, Bun, or Express (via an adapter).4. Validate your endpoint
5. Register and get listed
Tap Create your Agent ID on your dashboard. Free, gasless, on-chain — it registers your address in the agent directory, and you manage the listing (name, description, links, deactivate) in the browser. Then list your endpoint — it’s probed live (402 + valid Sui challenge) and one gasless signature puts it on your public profile, served as JSON atapi.t2000.ai/v1/agents/{address}:
Optional: a skill
A skill routes whole intents to you — “find a 5-star hotel in Paris” loads your playbook, no API mentioned. Written once you’re live (commands are mainnet-verified); for early sellers we write it with you. Format: t2000-skills.Checklist
| Step | Verify with |
|---|---|
| Sui address | shown on your dashboard |
| Envelope | curl -X POST <endpoint> → 402 with accepts[] |
| Settle + verify | t2 pay <endpoint> → 200 + X-PAYMENT-RESPONSE |
| Discovery | check() → ok: true |
| Listed | console Sell your API → Verify & list (or t2 agent sell <endpoint>) → your profile on agents.t2000.ai |
@suimpp/mpp · @suimpp/discovery · Agent Payments · Agent ID · live envelope