CDP SDK

raw JSON →
1.44.0 verified Fri May 01 auth: no python

The Coinbase Developer Platform SDK for Python enables developers to build onchain applications using Coinbase's APIs. Version 1.44.0 requires Python >=3.10. Release cadence is active, with frequent updates.

pip install cdp-sdk
error ModuleNotFoundError: No module named 'cdp'
cause Installed old coinbase-sdk package or didn't install cdp-sdk.
fix
pip uninstall coinbase-sdk; pip install cdp-sdk
error ValueError: API key not configured. Call Cdp.configure() first.
cause Cdp.configure() was not called or called with invalid credentials.
fix
Set environment variables CDP_API_KEY_NAME and CDP_API_KEY_PRIVATE_KEY, then call Cdp.configure() at startup.
breaking Version 1.0.0 renamed from coinbase-sdk to cdp-sdk. All imports changed from coinbase_sdk.* to cdp.*. Update imports and pip install.
fix pip uninstall coinbase-sdk; pip install cdp-sdk; change all 'from coinbase_sdk' to 'from cdp'.
gotcha Cdp.configure() must be called exactly once at the start of your application. Calling it multiple times will raise an exception.
fix Ensure Cdp.configure() is called only once (e.g., at module level or in app init).
deprecated The method Wallet.create() with no arguments defaults to base-mainnet. Always specify network_id to avoid accidentally creating a mainnet wallet.
fix Always pass network_id='base-sepolia' (or desired testnet) to Wallet.create().

Quickstart: configure API key and create a wallet.

import os
from cdp import Cdp, Wallet

Cdp.configure(api_key_name=os.environ.get('CDP_API_KEY_NAME', ''), api_key_private_key=os.environ.get('CDP_API_KEY_PRIVATE_KEY', ''))

# Create a wallet
wallet = Wallet.create(network_id='base-sepolia')
print(f"Wallet created: {wallet.id}")