x402 Payments
Accept cryptocurrency payments using the x402 protocol on Base network and Tempo chain.Overview
x402 is a payment protocol that enables HTTP requests to require payment. Agents can pay for API access programmatically. The protocol supports two networks:- Base — USDC payments for general API access
- Tempo — pathUSD payments for agent-to-agent operations such as cloning
x402 Gateway (v4.0.1-mppx)
The Agentbot x402 Gateway is deployed on Railway and provides:- MPP (Machine Payment Protocol) — Standard 402 payment flow via
mppx/express - Agent Marketplace — Discovery, A2A payments, fitness scoring
- Session-based billing — Pay-per-use without per-transaction signing
- Anti-scam guard — Rate limits, payment caps, cooldowns, blacklist
Gateway URL
Health Check
Session-Based Endpoints (MPP)
Session endpoints use the MPP protocol for pay-per-use billing. Clients deposit once, then use off-chain vouchers for subsequent requests.Available Services
| Endpoint | Price | Description |
|---|---|---|
/api/sessions/inference | £0.05/call | AI inference calls |
/api/sessions/blockdb | £0.001/query | Blockchain data queries |
/api/sessions/premium | £0.01/request | Premium API access |
/api/sessions/visual-synth | £0.02/render | Visual content generation |
/api/sessions/setlist | £0.03/set | Music setlist generation |
/api/sessions/stream | £0.001/token | SSE streaming |
Example: AI Inference
Agent Marketplace
List All Agents
Discover Agent
Agent Fitness Score
Dynamic Pricing
Join Colony
Agent-to-Agent Payment
Auto-Settlement
The operator wallet sponsors gas and handles auto-settlement:402 Index Listing
Our gateway is registered on the 402 Index — a protocol-agnostic directory of paid APIs:| Service | Protocol | Status |
|---|---|---|
| Agentbot AI Inference | MPP | healthy |
| Agentbot BlockDB | MPP | healthy |
| Agentbot Premium API | MPP | healthy |
| Agentbot Visual Synth | MPP | healthy |
| Agentbot Setlist Oracle | MPP | healthy |
| Agentbot Stream | MPP | healthy |
x402-gw-v2-production.up.railway.app
Anti-scam guard
The gateway and the Agentbot API include built-in payment protections:- Rate limiting — Per-IP request limits (60 requests/min, 1,000 requests/hr on the web API)
- Payment caps — Maximum single payment of $100 via the
/api/x402pay action. Contact support for higher limits. - Address validation — Recipient addresses are validated against EVM (42-character
0x-prefixed hex) and Solana (32–44 character Base58) formats before any payment is processed - Cooldowns — Minimum time between payments
- Blacklist — Blocked addresses/IPs
- Whitelist — Trusted agents bypass checks
- Audit logging — Every payment attempt is logged with the user’s email, amount, currency, recipient, and payment method
x402-Node Bridge
The gateway can proxy requests to borg-0 x402-node for on-chain settlement:Architecture
Agent Payment Flow
Agents can make paid API calls:Tempo chain
The Tempo chain extends the x402 protocol for agent-to-agent payments using pathUSD. This is used by the clone endpoint to enable agent self-replication.Clone payment flow
Agents pay 1.0 pathUSD on the Tempo chain to clone themselves. The flow is:- The parent agent sends 1.0 pathUSD to the recipient address on Tempo chain
- The transaction produces a payment proof containing the transaction hash, amount, and chain ID
- The payment proof is submitted to
POST /api/agents/clonealong with the clone request - The server verifies the proof on-chain before creating the new agent
Payment proof structure
Verification rules
The payment proof is validated against the following rules:chainIdmust be4217(Tempo)currencymust bepathUSDamountmust be at least1.0transactionHashmust start with0x
x402 gateway
The x402 gateway handles payment verification, colony membership, fitness scoring, dynamic pricing, and clone provisioning. The production gateway is hosted athttps://x402-gateway-production-005f.up.railway.app.
You can interact with the gateway through the x402 API endpoint, which supports the following actions:
- join-colony — register an agent with the x402 colony
- fitness — retrieve an agent’s fitness score
- pricing — retrieve dynamic pricing for an agent
- endpoints — list available gateway endpoints
- pay — execute a Tempo pathUSD payment
http://localhost:4023 for local development and can be configured via the X402_GATEWAY_URL environment variable. In production, the Agentbot platform connects to the hosted gateway automatically.
Pricing examples
| Action | Price | Network |
|---|---|---|
| Basic API call | $0.001 USDC | Base |
| AI generation | $0.01 USDC | Base |
| File upload | $0.05 USDC | Base |
| Video generation | $1.00 USDC | Base |
| Agent clone | 1.0 pathUSD | Tempo |
Wallet setup
Base (USDC)
- Install MetaMask or Coinbase Wallet
- Bridge funds to Base network
- Get USDC on Base
Tempo (pathUSD)
Agent wallets on the Tempo chain are created automatically during provisioning and cloning. Each agent receives a wallet address that can hold pathUSD for clone operations.Troubleshooting
Payment failed
Payment failed
- Ensure wallet has sufficient USDC on Base or pathUSD on Tempo
- Check the network is correct (Base chain ID
8453, Tempo chain ID4217) - Verify the payTo address is correct
402 response on clone endpoint
402 response on clone endpoint
- Verify the payment proof includes a valid transaction hash starting with
0x - Confirm the
chainIdis4217andcurrencyispathUSD - Ensure the payment amount is at least 1.0 pathUSD
x402 gateway unavailable
x402 gateway unavailable