@zauthx402/openclaw-x402
v0.1.6
Published
x402 payment protocol integration for OpenClaw agents
Readme
Installation
openclaw plugins install @zauthx402/openclaw-x402Configuration
Add to your ~/.openclaw/openclaw.json:
{
"plugins": {
"entries": {
"openclaw-x402": {
"enabled": true,
"config": {
"evmPrivateKey": "0x...",
"svmPrivateKey": "base58...",
"maxPaymentUSDC": "0.50",
"defaultNetwork": "base"
}
}
}
}
}Config Options
| 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 |
Tools
x402_payment
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
x402_discover
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)
Supported Networks
EVM:
- Base (mainnet)
- Base Sepolia (testnet)
SVM:
- Solana (mainnet)
- Solana Devnet
- Solana Testnet
How x402 Works
- Agent calls a paid endpoint
- Server returns HTTP 402 with payment requirements
- Extension signs and submits USDC payment
- Extension retries request with payment proof
- Server validates and returns the resource
All automatic - the agent just calls the API.
Links
License
MIT
