T402 Documentation
The open payment protocol for USDT — enable seamless stablecoin payments across 11 blockchain families with a single HTTP header.
Why T402?
Pay for any HTTP resource with a single header. No payment forms, no redirects, no SDKs required on the client.
11 blockchain families: EVM, Solana, TON, TRON, NEAR, Aptos, Tezos, Polkadot, Stacks, Cosmos.
ERC-4337 account abstraction lets users pay without holding native tokens for gas fees.
MCP server enables AI agents to discover and pay for APIs autonomously via Model Context Protocol.
Quick Start
pnpm add @t402/core @t402/evm @t402/fetchimport { t402Client, wrapFetchWithPayment } from '@t402/fetch'
import { registerExactEvmScheme } from '@t402/evm/exact/client'
const client = new t402Client()
registerExactEvmScheme(client, { signer })
// Payments handled automatically on 402
const response = await wrapFetchWithPayment(fetch, client)(
'https://api.example.com/premium'
)How It Works
Client makes request
GET /api/premium HTTP/1.1
Host: api.example.comServer returns 402 Payment Required
HTTP/1.1 402 Payment Required
Payment-Required: scheme="exact";network="eip155:8453";amount="10000";...Client signs and retries
GET /api/premium HTTP/1.1
Payment-Signature: signature="0x...";payload="..."Server verifies and responds
HTTP/1.1 200 OK
Content-Type: application/json
{"data": "Premium content!"}SDKs
Supported Networks
See Chains for network IDs, token addresses, and configuration details.
Use Cases
| Use Case | Description | Price Range |
|---|---|---|
| AI Agent Payments | AI agents pay for APIs via MCP | $0.001 - $0.10/call |
| API Monetization | Charge per-request for endpoints | $0.01 - $1.00/req |
| Premium Content | Gate content behind micro-payments | $0.10 - $10.00/item |
| Micro-Payments | Sub-cent payments on L2 networks | $0.0001 - $0.01/tx |
Packages
Core & Blockchain — @t402/core · @t402/evm · @t402/svm · @t402/ton · @t402/tron · @t402/near · @t402/aptos · @t402/tezos · @t402/polkadot · @t402/stacks · @t402/cosmos · @t402/btc · @t402/stellar · @t402/erc8004
WDK Integration — @t402/wdk · @t402/wdk-protocol · @t402/wdk-gasless · @t402/wdk-bridge · @t402/wdk-multisig
HTTP Server — @t402/express · @t402/next · @t402/hono · @t402/fastify
HTTP Client — @t402/fetch · @t402/axios
UI & Tools — @t402/paywall · @t402/react · @t402/vue · @t402/mcp · @t402/cli
Get Started
- Quick Start Guide — Get up and running in 5 minutes
- Core Concepts — Understand how T402 works
- Installation — Detailed setup for all languages
- API Reference — Facilitator API documentation