Skip to main content
Agentic payments are payments initiated and completed by autonomous software agents without human confirmation at each step. An agent can detect a payment requirement, authorize a transaction, and settle onchain in milliseconds, using predefined policies and earned balances. Polygon provides three complementary components for agentic payment infrastructure:

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):
npx skills add https://github.com/0xPolygon/polygon-agent-cli
Or install directly:
npm install -g @polygonlabs/agent-cli

Quickstart

# 1. Create an EOA and get a project access key
polygon-agent setup --name "MyAgent"

# 2. Set your access key
export SEQUENCE_PROJECT_ACCESS_KEY=<access-key>

# 3. Create a wallet (opens browser for one-time approval)
polygon-agent wallet create

# 4. Fund the wallet
polygon-agent fund

# 5. Start operating
polygon-agent balances
polygon-agent send --symbol USDC --to 0x... --amount 10 --broadcast
polygon-agent swap --from USDC --to USDT --amount 5 --broadcast

# 6. Register your agent onchain
polygon-agent agent register --name "MyAgent" --broadcast
All commands are dry-run by default. Add --broadcast to execute.

What the CLI covers

CapabilityCommands
Session-based smart contract walletswallet create, wallet list, wallet address
Token balances and historybalances
Send, swap, bridgesend, swap, fund
ERC-8004 agent identity and reputationagent register, agent reputation, agent feedback
x402 micropaymentsx402-pay

Environment variables

One access key covers all three:
export SEQUENCE_PROJECT_ACCESS_KEY=<access-key>
export SEQUENCE_INDEXER_ACCESS_KEY=$SEQUENCE_PROJECT_ACCESS_KEY
export TRAILS_API_KEY=$SEQUENCE_PROJECT_ACCESS_KEY

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.