Pin the SDK like you pin your model
The anthropic package on PyPI moves quickly. New SDK releases add helpers, refine types, and occasionally tighten validation. Pin the version in pyproject.toml or requirements.txt the same way you pin your model id — then upgrade deliberately, not accidentally.
Verify what is actually installed
Before you debug an SDK quirk, prove which version is running in the venv. pip show anthropic, python -c "import anthropic; print(anthropic.__version__)", and a quick look at anthropic.Anthropic.__doc__ are the three commands that catch 80% of 'why does this work locally and not in CI' bugs.
The two clients
The SDK ships two clients in one package: Anthropic (sync) and AsyncAnthropic (async). Same surface, different I/O model. Pick by your runtime — sync for scripts, async for FastAPI routes and any code that already runs an event loop.