Polygon Agent CLI
End-to-end blockchain toolkit for AI agents. Wallets, token ops, swaps, onchain identity, and x402 payments in a single install.
x402 Protocol
HTTP-native micropayment protocol using the 402 status code. Agents pay per API call with no subscriptions required.
ERC-8004
Onchain identity, reputation, and validation registries for autonomous agents.
How agentic payments work
Instead of requiring a person to click “confirm”, payments are executed via facilitated flows. An agent detects that an API call costs $0.002 in USDC, confirms the payment requirement, and completes the transaction automatically, all within the HTTP request lifecycle. This makes microtransactions, dynamic subscriptions, and per-use pricing viable for both human-facing apps and fully autonomous AI agents.Polygon Agent CLI
The Polygon Agent CLI gives AI agents everything they need to operate onchain: session-based smart contract wallets with scoped spending permissions, token operations (send, swap, bridge, deposit), ERC-8004 agent identity, and x402 micropayments. Private keys are encrypted at rest and never exposed to the agent’s context. Install as an agent skill (works with Claude Code, Codex, and any skills-protocol agent harness):Quickstart
All commands are dry-run by default. Add
--broadcast to execute.What the CLI covers
| Capability | Commands |
|---|---|
| Session-based smart contract wallets | wallet create, wallet list, wallet address |
| Token balances and history | balances |
| Send, swap, bridge | send, swap, fund |
| ERC-8004 agent identity and reputation | agent register, agent reputation, agent feedback |
| x402 micropayments | x402-pay |
Environment variables
One access key covers all three:GitHub: polygon-agent-cli
Full source, CLI reference, and contribution guide.
npm: @polygonlabs/agent-cli
Latest release and version history.
x402 Protocol
x402 reuses the HTTP 402 Payment Required status code to gate API access behind onchain payments. Clients pay per request; no subscription or API key required. Polygon supports x402 on Mainnet and Amoy.Introduction
What x402 is and how Polygon’s facilitators work.
Quickstart: Buyers
Set up a wallet and make your first paid API request.
Quickstart: Sellers
Gate an API endpoint behind x402 and accept micropayments.
How it works
The full request/payment/response lifecycle.
Tools
x402 CLI
Command-line tool for testing x402-protected endpoints.
Autopay
Automate recurring payments to x402-gated APIs.
ERC-8004
ERC-8004 defines an onchain trust layer for autonomous agents using three registries: Identity, Reputation, and Validation. It lets agents from different organizations discover and assess each other onchain.ERC-8004 on Polygon
Contract deployments, read-only examples, and how ERC-8004 relates to A2A, MCP, and x402.