@paynodelabs/paynode-402-cli
v2.6.0
Published
The official command-line interface for the PayNode protocol. Designed for AI Agents to execute stateless micro-payments via HTTP 402.
Maintainers
Readme
⚡ paynode-402-cli
The official command-line interface for the PayNode protocol. Designed specifically for the Agentic Era, allowing AI Agents to execute zero-install, stateless micro-payments via the HTTP 402 standard.
🛠️ Configuration & Credentials
To enable automated blockchain signing, this tool requires a private key provided via environment variables.
[!IMPORTANT] Mandatory Variable:
CLIENT_PRIVATE_KEY(0x...) All signature and payment operations rely on this key. Ensure it is set in your environment before execution.
[!CAUTION] BURNER WALLET ONLY: NEVER use a primary or "cold storage" wallet. This tool is designed for autonomous agents; always use a dedicated burner wallet with minimal funds (< 10 USDC).
Setup Example (Unix)
export CLIENT_PRIVATE_KEY="0x..."
bunx @paynodelabs/paynode-402-cli check🤖 For AI Agents (Zero-Install)
Your agent can use this tool dynamically via bunx without any manual installation:
1. Check Readiness (Gas & USDC)
bunx @paynodelabs/paynode-402-cli check --network testnet --json2. Access a 402-Protected API
The CLI automatically detects the 402 challenge, performs the handshake, signs the payment (on-chain or EIP-3009), and returns the final resource.
bunx @paynodelabs/paynode-402-cli request "https://api.example.com/data" --network testnet --json3. Mint Test USDC (Base Sepolia)
bunx @paynodelabs/paynode-402-cli mint --amount 100 --network testnet📑 Command Summary
| Command | Description |
| :--- | :--- |
| check | Check ETH/USDC balances and readiness on Base L2 |
| mint | Mint Mock USDC on Base Sepolia for testing |
| request <URL> | Access a protected resource by handling the 402 challenge |
| list-paid-apis | Discover payable APIs from the PayNode Marketplace |
| get-api-detail <id> | Inspect one marketplace API |
| invoke-paid-api <id> | Invoke a marketplace API using the 402 flow |
Global Flags
--network <name>:mainnetortestnet(default:testnet).--json: Format output as machine-readable JSON (preferred for Agents).--confirm-mainnet: Explicit flag required for real USDC transactions on mainnet.--background: Execute in background and return atask_idfor long-running handshakes.
🔗 References
- Marketplace: https://mk.paynode.dev
- Protocol SPEC: PayNode Docs
- GitHub: PayNodeLabs/paynode-402-cli
