Skip to main content
Using an AI agent? Point the assistant at the onboarding skill instead. It handles installation, configuration, and verification: docs.cdp.coinbase.com/cdp-cli/skill.md

Prerequisites

  1. Install the CLI (requires Node.js 22+):
    npm install -g @coinbase/cdp-cli
    
  2. Go to API Keys in the CDP Portal. Sign in (a project is auto-created on first sign-in).
  3. Click Create API Key → download the JSON key file. The key secret is only shown at creation time.

1. Configure the environment

# From the downloaded key file
cdp env live --key-file ./cdp-api-key.json

# Or configure inline
cdp env live --key-id <id> --key-secret <secret>
Verify it works:
cdp evm accounts list
An empty project returns {"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.
cdp env live --wallet-secret-file ./cdp_wallet_secret.txt
# or inline
cdp env live --wallet-secret <secret>
Run cdp env to verify. live should appear with the key ID and a (wallet) indicator.

3. Create an account

cdp evm accounts create name=my-wallet
{
  "address": "0x3c0D84055994c3062819Ce8730869D0aDeA4c3Bf",
  "name": "my-wallet"
}
Server wallet accounts are network-agnostic. The same address works on any EVM network (Base, Ethereum, Arbitrum, etc.). The network is specified when sending a transaction.

4. Fund the account

Capture the address, then use the faucet to get testnet ETH:
address=$(cdp evm accounts by-name my-wallet --jq '.address')
cdp evm faucet address=$address network=base-sepolia token=eth
Verify the funds arrived:
cdp evm token-balances get base-sepolia $address

5. Send a transaction

This is the core workflow: encode an unsigned transaction, sign it with the account, and send it to the network.
# 1. Encode an unsigned transaction
TX=$(cdp util tx-encode \
  --network base-sepolia \
  --to 0x0000000000000000000000000000000000000000 \
  --value 0.00001ether \
  --from $address)

# 2. Sign it
SIGNED=$(cdp evm accounts sign transaction $address \
  transaction=$TX \
  --jq '.signedTransaction')

# 3. Send it
cdp evm accounts send transaction $address \
  network=base-sepolia \
  transaction=$SIGNED
A transactionHash appears in the response. Verify the balance changed:
cdp evm token-balances get base-sepolia $address
Your first on-chain transaction is complete.
The encode-sign-send pipeline is covered in detail on the How it works page, including ERC-20 transfers, Solana, and smart accounts.

Troubleshooting

ErrorCauseFix
Must use a CDP Entity scoped API keyUsing a legacy keyCreate a new API key in the Portal
Wallet authentication errorWallet secret missing or incorrectRe-add with cdp env live --wallet-secret-file
forbiddenAPI key permissions issueCheck key permissions in the Portal
cdp: command not foundCLI not on PATHRun npm install -g @coinbase/cdp-cli again; on Windows, add %APPDATA%\npm to PATH