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?

FeatureDescription
HTTP NativePay for any HTTP resource with a single header. No payment forms, no redirects.
Multi-ChainEthereum, Arbitrum, Base, TON, TRON, Solana - one protocol, all chains.
GaslessERC-4337 account abstraction for zero-gas user experience.
AI ReadyMCP server enables AI agents to pay for APIs autonomously.

Quick Start

pnpm add @t402/core @t402/evm
import { 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.com

Server 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!"}
Use CaseDescriptionLink
AI Agent PaymentsEnable AI to pay for APIs autonomouslyLearn more →
API MonetizationCharge per-request for your APIsLearn more →
Premium ContentGate content behind micro-paymentsLearn more →
Micro-PaymentsSub-cent payments on L2 networksLearn more →

Packages

Core & Blockchain Mechanisms

PackageDescription
@t402/coreProtocol types and HTTP utilities
@t402/evmEVM chains (Ethereum, Arbitrum, Base, etc.)
@t402/svmSolana blockchain support
@t402/tonTON blockchain support
@t402/tronTRON blockchain support

WDK Integration

PackageDescription
@t402/wdkTether WDK integration
@t402/wdk-gaslessGasless payments (ERC-4337)
@t402/wdk-bridgeCross-chain bridging (LayerZero)
@t402/wdk-multisigSafe multi-signature wallets

HTTP Framework Middleware

PackageDescription
@t402/expressExpress.js middleware
@t402/nextNext.js integration
@t402/honoHono middleware
@t402/fastifyFastify plugin

HTTP Client Libraries

PackageDescription
@t402/fetchFetch API wrapper
@t402/axiosAxios interceptor

UI Components

PackageDescription
@t402/paywallUniversal paywall component
@t402/reactReact hooks and components
@t402/vueVue 3 composables

Tools

PackageDescription
@t402/mcpMCP server for AI agents
@t402/cliCommand-line tools
@t402/extensionsProtocol 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?