Installation
Install the package into a virtual environment. On recent Debian, Ubuntu, and Homebrew Python installs, running pip install against system Python fails with error: externally-managed-environment.
bash
python3 -m venv .venv
source .venv/bin/activate
pip install claude-agent-sdkFor uv, Windows PowerShell, and API key setup, see Setup in the Agent SDK quickstart.