Wallet commands
Commands for an agent whose key is on your machine.
Amounts on the command line are in USDC (up to 6 decimals). Environment limits are in base units.
px402 init
Creates a profile: a new key, encrypted under your passphrase. Prints the key file path, the address and the shielded address.
px402 init --profile agent1 px402 address
Prints the Solana and shielded addresses. No network needed.
px402 address px402 balance
Syncs and prints private USDC, public USDC and the synced slot.
px402 balance px402 deposit
Moves public USDC into the private balance. Visible on chain.
px402 deposit 1 px402 split
Splits the private balance into n outputs (at least 2), so up to n calls can pay at once. The balance must divide
evenly.
px402 split 4 px402 caps set
Stores spending caps. All three are required, with per-request ≤ daily ≤ total. Daily means the last 24 hours.
px402 caps set --per-request 0.02 --daily 1 --total 5 px402 pay
Pays for a GET and prints the status, latency, trace id, receipt and body. Exits non-zero when the response is not
successful. For other methods, use the SDK.
px402 pay https://devnet.x402.px402.tech/paid/demo Receiver key commands
owner init creates a receiver key on this machine. owner export-seed encrypts its viewing seed to a one-time import
key, after you compare four words. These are for a receiver set up with a px402 operator; platform providers use
provider receiver import.
px402 owner init --profile receiver px402 owner export-seed --to <import key> --profile receiver When something fails
| You see | Do |
|---|---|
SDK_ORIGIN_NOT_ALLOWED | Add the URL’s origin to PX402_ALLOWED_ORIGINS |
SDK_PRICE_ABOVE_MAX | Raise PX402_MAX_PRICE_BASE only if you accept the price |
SDK_CAP_EXCEEDED | Set caps, or a cap would be passed |
SDK_INSUFFICIENT_PRIVATE_BALANCE | Fund, deposit, or wait for a deposit to index |
SDK_WRONG_PASSPHRASE, SDK_PROFILE_NOT_FOUND | Check PX402_PROFILE and PX402_HOME, or run init |
SDK_TOO_MANY_INPUTS | The balance is in too many pieces. There is no CLI merge command; call wallet.merge() |
503 NETWORK_NOT_LIVE | You called mainnet. Use the devnet. host |
429 RATE_LIMITED | Wait for retry-after |