The fastest, most efficient x402 payment processor for AI agents and micropayments.
x402 is an open HTTP payment protocol that enables:
- AI agents to pay for API access programmatically
- Micropayments without traditional payment rails
- Multi-chain support (Solana, Base, Polygon, Arbitrum, Optimism, Avalanche, and more)
When a client requests a paid resource, the server responds with HTTP 402 and payment requirements. The client pays and retries with proof of payment.
- Multi-chain: Solana + 7 EVM chains supported
- 0.1% fees: Lowest in the industry
- Sub-second verification: Optimized for speed
- Echo mode: Test payments with real refunds
- Enterprise security: API keys, HMAC signing, rate limiting
- Observability: Structured logging, metrics, health checks
npm install @nory/x402-clientimport { NoryClient } from '@nory/x402-client';
const client = new NoryClient({
baseUrl: 'https://noryx402.com',
apiKey: 'your_api_key', // optional
});
// Make a payment
const result = await client.pay({
resource: 'https://api.example.com/premium-endpoint',
network: 'solana-mainnet',
amount: '1000000', // 1 USDC (6 decimals)
payTo: 'merchant_wallet_address',
});Add x402 payment requirements to any endpoint:
// Return 402 with payment requirements
return new Response(null, {
status: 402,
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
x402Version: 2,
accepts: [{
network: 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp',
amount: '1000000',
currency: 'USDC',
payTo: 'YOUR_WALLET_ADDRESS',
}],
resource: request.url,
}),
});| Endpoint | Description |
|---|---|
POST /api/x402/verify |
Verify a payment before settlement |
POST /api/x402/settle |
Settle a verified payment on-chain |
GET /api/x402/requirements |
Get payment requirements for a resource |
GET /api/x402/transactions/{id} |
Look up transaction status |
GET /api/x402/health |
Service health check |
GET /api/x402/metrics |
Performance metrics |
| Network | Chain ID | Type |
|---|---|---|
| Solana Mainnet | solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp | Solana |
| Solana Devnet | solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1 | Solana |
| Base | eip155:8453 | EVM |
| Polygon | eip155:137 | EVM |
| Arbitrum | eip155:42161 | EVM |
| Optimism | eip155:10 | EVM |
| Avalanche | eip155:43114 | EVM |
| Sei | eip155:1329 | EVM |
| IoTeX | eip155:4689 | EVM |
- Node.js 18+
- PostgreSQL database
- Solana/EVM wallet for receiving payments
- Clone the repository:
git clone https://github.com/TheMemeBanker/x402-pay.git
cd x402-pay- Install dependencies:
npm install- Configure environment:
cp .env.example .env
# Edit .env with your configuration- Initialize database:
npx prisma db push- Run development server:
npm run devSee .env.example for all configuration options. Key variables:
MERCHANT_WALLET- Your wallet address for receiving paymentsDATABASE_URL- PostgreSQL connection stringNORY_API_KEY- Master API key for authenticationREFUND_WALLET_SECRET_KEY- (Optional) For Echo mode refunds
- API key authentication on all sensitive endpoints
- HMAC request signing for webhook verification
- Rate limiting per IP and API key
- No secrets stored in code or git history
Full documentation at noryx402.com/docs
MIT License - see LICENSE
Contributions welcome! Please read our contributing guidelines before submitting PRs.
- Website: noryx402.com
- Documentation: noryx402.com/docs
- NPM Package: @nory/x402-client