AgentCash creates and manages a local Ethereum wallet that holds USDC for paying premium APIs. The wallet is created automatically the first time you use AgentCash.
Where is the wallet stored?
Your wallet lives at ~/.agentcash/wallet.json with restricted file permissions (600). It contains:
- Your private key
- Your wallet address
- Creation timestamp
Your private key is stored in plaintext on disk. Do not share your wallet file or commit it to version control. Anyone with the private key can spend your USDC.
Using an existing key
To use a specific private key, set the X402_PRIVATE_KEY environment variable:
export X402_PRIVATE_KEY=0xYOUR_PRIVATE_KEY
This is useful for CI/CD environments or when you want multiple machines to share a wallet.
Checking your balance
Ask your agent:
What is my AgentCash balance?
Or use the CLI directly:
This returns your total USDC balance across supported networks.
If you need deposit links or network-specific wallet addresses, run:
This returns the per-network account list, including each address, balance, and deposit link.
Wallet address
Your wallet address is a standard Ethereum address that works across all supported EVM networks. The same address receives USDC on Base, Ethereum, Optimism, Arbitrum, and Polygon.