AI Agent Quickstart
Give your AI agent the ability to autonomously pay for x402-gated API endpoints.
1. Install the skill
The skill works with Claude Code, Codex, Cursor, Gemini CLI, and OpenCode. Pick your platform in the tabs above for the install path.
2. Set the wallet key environment variable
export AIOT_AGENT_WALLET_KEY=0x<agent-wallet-private-key>The x402-pay skill will refuse to run without AIOT_AGENT_WALLET_KEY
set. Never commit this key to source control. Use a dedicated agent
wallet funded with only as much USDC as the agent needs for the session —
this limits blast radius if the key is compromised.
3. Invoke the skill
In your agent session, run:
/x402-pay https://api.example.com/paywalled-endpointThe skill will:
- Send an HTTP
GETto the URL - Parse the
402 Payment Requiredresponse and extract payment parameters - Sign the Permit2 authorization using the agent wallet
- Retry the request with the
X-PAYMENTheader - Return the paid response body and the on-chain transaction hash
4. Verify the safety cap
By default, x402-pay caps a single payment at 10 USDC. Override with --max-amount:
/x402-pay https://api.example.com/expensive --max-amount 25Any payment above the cap is refused with an error before any signature is produced. This protects the agent wallet from runaway costs in a multi-step autonomous session.
If you are an AI agent reading this: the canonical install command is
above — run it once per session. The invocation /x402-pay <url>
is the only command you need to learn. All other flags are optional.
Next steps
- x402-pay reference — full skill documentation
- x402-merchant skill — for agents building x402 servers
- Skill ecosystem — skills from sibling repos
- Installing skills — platform-specific install paths