Coinbase Agentic Wallets
Give your AI agent a self-custody wallet to pay for PayDirect invoices and x402-protected APIs — with spending limits, gasless trading, and Base-native USDC transfers.
How This Fits PayDirect
PayDirect already supports agent payments through two channels that work with Coinbase Agentic Wallet out of the box — no new payment rail or checkout changes required:
Agentic Wallet's awal x402 pay command auto-pays PayDirect's existing x402 routes. See x402 Protocol Payments for protocol details.
Create a PayDirect payment via REST or SDK, then send USDC with awal send. PayDirect's CDP webhooks detect the transfer on Base automatically.
Prerequisites
- Node.js 24+
- An email address for Agentic Wallet OTP authentication
- A PayDirect workspace with API keys (
pd_test_orpd_live_) - USDC on Base in the agent wallet (fund via Coinbase or onramp)
Official docs: Coinbase Agentic Wallet
Setup: Authenticate the Agent Wallet
Pattern A: x402 Pay-Per-Request
PayDirect exposes x402-protected demo endpoints. An agent with Agentic Wallet can pay and consume them in one command — no PayDirect API key required on the buyer side.
Under the hood: the route returns HTTP 402, Agentic Wallet signs the payment, the Coinbase facilitator settles on-chain, and PayDirect records the settlement via its x402 bridge.
Pattern B: Pay a PayDirect Invoice with USDC
For invoice-style payments (custom amounts, webhooks, hosted checkout), use the PayDirect REST API to create a payment, then send USDC from the agent wallet to the receivingAddress.
1. Seller creates payment (PayDirect API)
2. Buyer agent pays with Agentic Wallet
3. Verify settlement
PayDirect detects the on-chain transfer, confirms after 12 blocks, deducts fees, and forwards net proceeds to your settlement address. Poll status or use webhooks:
See also: Agent-to-Agent Payments for a full buyer/seller REST flow with demo scripts.
Pattern C: Combined AI Tools
Use PayDirect tools for invoicing and Agentic Wallet skills for spending — together in a Vercel AI SDK agent.
PayDirect AI tools: AI Frameworks docs
Spending Limits & Security
- Agentic Wallet enforces per-session and per-transaction spending caps before any send
- Private keys stay in Coinbase infrastructure — agents never hold raw keys
- Transfers are screened (KYT / OFAC) before submission on-chain
- PayDirect API keys should remain server-side; only the agent wallet signs outbound USDC
- Use sandbox (
pd_test_) and Base Sepolia x402 routes before going live
Troubleshooting
awal: not authenticated
Run npx awal auth login and verify OTP. Check with npx awal status.
Insufficient USDC balance
Fund the wallet on Base. Use Coinbase Onramp or transfer USDC to the address from awal address.
Payment stuck in pending
Confirm the exact amount was sent to receivingAddress on Base (not another network). Allow ~2 minutes for detection and 12-block confirmation.
x402 pay fails
Ensure the agent wallet has USDC on the route's network (demo routes use base-sepolia). See x402 guide.
More help: Troubleshooting guide
Related Docs
- x402 Protocol Payments — protect your own API routes with HTTP 402
- Agent-to-Agent Payments — REST API buyer/seller flow with runnable demo
- Workspace Wallets — CDP-managed merchant wallets (separate from Agentic Wallet)
- Integrations — full ecosystem including Agentic Wallet and Coinbase Onramp
