Prerequisites
-
Install the CLI (requires Node.js 22+):
- Go to API Keys in the CDP Portal. Sign in (a project is auto-created on first sign-in).
- Click Create API Key → download the JSON key file. The key secret is only shown at creation time.
1. Configure the environment
{"accounts":[]}. This is expected.
2. Add a wallet secret
The wallet secret is a separate credential required for any operation that touches private keys (creating accounts, signing, sending). Generate one in the Server Wallet section of the Portal. Look for Generate Wallet Secret, then download the file.3. Create an account
4. Fund the account
Capture the address, then use the faucet to get testnet ETH:5. Send a transaction
This is the core workflow: encode an unsigned transaction, sign it with the account, and send it to the network.transactionHash appears in the response. Verify the balance changed:
The encode-sign-send pipeline is covered in detail on the How it works page, including ERC-20 transfers, Solana, and smart accounts.
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
Must use a CDP Entity scoped API key | Using a legacy key | Create a new API key in the Portal |
Wallet authentication error | Wallet secret missing or incorrect | Re-add with cdp env live --wallet-secret-file |
forbidden | API key permissions issue | Check key permissions in the Portal |
cdp: command not found | CLI not on PATH | Run npm install -g @coinbase/cdp-cli again; on Windows, add %APPDATA%\npm to PATH |