T402 Documentation
The Official Payment Protocol for USDT · v2.0.0
T402 is an open standard for HTTP-native stablecoin payments. Enable seamless USDT payments across multiple blockchains with a single HTTP header.
Why T402?
| Feature | Description |
|---|---|
| HTTP Native | Pay for any HTTP resource with a single header. No payment forms, no redirects. |
| Multi-Chain | Ethereum, Arbitrum, Base, TON, TRON, Solana - one protocol, all chains. |
| Gasless | ERC-4337 account abstraction for zero-gas user experience. |
| AI Ready | MCP server enables AI agents to pay for APIs autonomously. |
Quick Start
pnpm add @t402/core @t402/evmimport { t402Client } from '@t402/fetch'
import { registerExactEvmScheme } from '@t402/evm/exact/client'
const client = new t402Client()
registerExactEvmScheme(client, { signer })
// Payments handled automatically
const response = await client.fetch('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
X-Payment: scheme="exact-evm";network="eip155:8453";amount="10000";...Client signs and retries
GET /api/premium HTTP/1.1
X-Payment: signature="0x...";payload="..."Server verifies and responds
HTTP/1.1 200 OK
Content-Type: application/json
{"data": "Premium content!"}Popular Use Cases
| Use Case | Description | Link |
|---|---|---|
| AI Agent Payments | Enable AI to pay for APIs autonomously | Learn more → |
| API Monetization | Charge per-request for your APIs | Learn more → |
| Premium Content | Gate content behind micro-payments | Learn more → |
| Micro-Payments | Sub-cent payments on L2 networks | Learn more → |
Packages
Core & Blockchain Mechanisms
| Package | Description |
|---|---|
@t402/core | Protocol types and HTTP utilities |
@t402/evm | EVM chains (Ethereum, Arbitrum, Base, etc.) |
@t402/svm | Solana blockchain support |
@t402/ton | TON blockchain support |
@t402/tron | TRON blockchain support |
WDK Integration
| Package | Description |
|---|---|
@t402/wdk | Tether WDK integration |
@t402/wdk-gasless | Gasless payments (ERC-4337) |
@t402/wdk-bridge | Cross-chain bridging (LayerZero) |
@t402/wdk-multisig | Safe multi-signature wallets |
HTTP Framework Middleware
| Package | Description |
|---|---|
@t402/express | Express.js middleware |
@t402/next | Next.js integration |
@t402/hono | Hono middleware |
@t402/fastify | Fastify plugin |
HTTP Client Libraries
| Package | Description |
|---|---|
@t402/fetch | Fetch API wrapper |
@t402/axios | Axios interceptor |
UI Components
| Package | Description |
|---|---|
@t402/paywall | Universal paywall component |
@t402/react | React hooks and components |
@t402/vue | Vue 3 composables |
Tools
| Package | Description |
|---|---|
@t402/mcp | MCP server for AI agents |
@t402/cli | Command-line tools |
@t402/extensions | Protocol extensions |
Supported Networks
EVM Chains
- Ethereum, Arbitrum, Base, Optimism, Polygon, Ink, Berachain, Unichain
Non-EVM
- TON Mainnet and Testnet
- TRON Mainnet, Nile, and Shasta
- Solana Mainnet and Devnet
See Chains for network IDs and configuration details.
Get Started
Ready to integrate T402?
- Quick Start Guide → - Get up and running in 5 minutes
- Core Concepts → - Understand how T402 works