x402 payment protocol extension for Moltbot - enables agents to pay for services with USDC
npm install @zauthx402/moltbot-x402

@zauthx402/moltbot-x402
x402 payment protocol extension for Moltbot
Enables agents to pay for services autonomously. Powered by our database and Coinbase binaries.
``bash`
moltbot plugins install @zauthx402/moltbot-x402
Add to your ~/.clawdbot/moltbot.json:
`json`
{
"plugins": {
"entries": {
"moltbot-x402": {
"enabled": true,
"config": {
"evmPrivateKey": "0x...",
"svmPrivateKey": "base58...",
"maxPaymentUSDC": "0.50",
"defaultNetwork": "base"
}
}
}
}
}
| Option | Type | Description |
| ------------------ | ------ | ------------------------------------------------------------------------- |
| evmPrivateKey | string | Private key for Base/EVM payments (hex format) |svmPrivateKey
| | string | Private key for Solana payments (base58 format) |maxPaymentUSDC
| | string | Maximum payment per request (e.g., "0.50") |defaultNetwork
| | string | Default network:base, base-sepolia, solana, solana-devnet |
Call x402-enabled paid APIs with automatic USDC payment.
``
Agent: I'll fetch the weather data for you.
[Calls x402_payment with url="https://weather.example.com/api/conditions?city=NYC"]
[Automatically pays $0.01 USDC, receives response]
Agent: The current temperature in NYC is 45°F with partly cloudy skies.
Parameters:
- url (required) - The x402-enabled endpoint URLmethod
- - HTTP method (default: GET)params
- - Query params (GET) or JSON body (POST/PUT/PATCH)headers
- - Custom headersnetwork
- - Override network detectionmaxPaymentUSDC
- - Override max payment for this request
Search the zauth directory for x402-enabled APIs.
``
Agent: Let me find weather APIs that accept x402 payments.
[Calls x402_discover with query="weather"]
Agent: I found 3 weather APIs - weather.example.com charges $0.01 per request...
Parameters:
- query - Search term (searches url, title, description)network
- - Filter by network: base, solana, etc.verified
- - Only show verified endpointslimit` - Max results (default: 10, max: 50)
-
EVM:
- Base (mainnet)
- Base Sepolia (testnet)
SVM:
- Solana (mainnet)
- Solana Devnet
- Solana Testnet
1. Agent calls a paid endpoint
2. Server returns HTTP 402 with payment requirements
3. Extension signs and submits USDC payment
4. Extension retries request with payment proof
5. Server validates and returns the resource
All automatic - the agent just calls the API.
- x402 Protocol
- zauth Directory
- Moltbot Docs
MIT