
Anthropic published v1.0 of its Python SDK on August 20, 2026, and it is not a routine version bump. The HTTP layer moves from httpx to httpx2, Python 3.9 support is dropped, the legacy Text Completions API is gone for good, and async response parsing now requires await in places it did not before. If you call the Claude API from Python, you need to act. Here is exactly what breaks and how to fix it.
What Actually Breaks
1. httpx Is Out, httpx2 Is In
The SDK’s HTTP layer moves to httpx2, a Pydantic-maintained fork of httpx with an identical API. OpenAI’s SDK made the same switch two weeks earlier in their v3.0.0 release on August 12. Whether you notice this change depends entirely on how you configure your client.
If you use the default client — no custom http_client argument — you need zero code changes. Just upgrade the package. If you pass custom transports, clients, or timeout objects, you must migrate those to httpx2 equivalents:
# Before
import httpx
client = Anthropic(http_client=httpx.Client(timeout=30.0))
# After
import httpx2
client = Anthropic(http_client=httpx2.Client(timeout=30.0))
One underrated tip: if your test suite or tracing libraries patch httpx internally, add this at startup to keep them working:
import httpx2
httpx2.alias_httpx() # makes httpx2 respond to `import httpx` patches
2. Text Completions API Is Removed
The old /v1/complete endpoint wrapper — client.completions.create() — is gone. So are the anthropic.HUMAN_PROMPT and anthropic.AI_PROMPT constants, and the Completion and CompletionCreateParams types. This API was deprecated in 2023. If you are still using it, this is the forced migration you have been putting off.
# Before — no longer works in v1.0
response = client.completions.create(
model="claude-3-5-sonnet-20241022",
max_tokens_to_sample=300,
prompt=f"{anthropic.HUMAN_PROMPT} Explain async/await.{anthropic.AI_PROMPT}",
)
print(response.completion)
# After
response = client.messages.create(
model="claude-3-5-sonnet-20241022",
max_tokens=300,
messages=[{"role": "user", "content": "Explain async/await."}]
)
print(response.content[0].text)
Every current Claude model runs through the Messages API. There is no feature gap — just a cleaner interface that the SDK should have enforced sooner.
3. Async Response Parsing Now Needs await
On the async client, .parse(), .read(), .text(), and .json() are now coroutines. If you use with_raw_response, you need to add await:
# Before
response = await client.messages.with_raw_response.create(...)
message = response.parse()
# After
response = await client.messages.with_raw_response.create(...)
message = await response.parse() # now a coroutine
This one fails silently. Missing await returns a coroutine object rather than your message — your code will appear to run without errors until you try to use the result.
4. AnthropicBedrock Now Requires an Explicit Region
Previously, AnthropicBedrock() with no region configured would log a warning and silently fall back to us-east-1. In v1.0, it raises a ValueError at construction time. This is the change most likely to cause a production outage if you upgrade without checking:
# Before — worked with a warning
client = AnthropicBedrock()
# After — raises ValueError immediately
client = AnthropicBedrock(aws_region="us-east-1")
# Or set: AWS_DEFAULT_REGION=us-east-1
5. Python 3.9 Support Dropped
v1.0 requires Python 3.10 or later. Python 3.9 reached end-of-life in October 2024. If you are still on 3.9 in production, upgrading the SDK is the forcing function to fix a two-year-old infrastructure gap. Python 3.10 has been stable since October 2021 and introduces structural pattern matching. There is no good reason to stay behind.
6. Tool Runner compaction_control Removed
The tool runner’s client-side compaction_control parameter is gone. Anthropic now handles context compaction server-side, which is more accurate and requires no client configuration. Remove the parameter from your tool runner setup and let the API manage it.
What Does Not Break
If your code uses the Messages API with the default HTTP client and no custom transports, the upgrade is a one-liner:
pip install "anthropic>=1.0.0"
Streaming, tool use, vision, prompt caching, token counting — all untouched. The temperature, top_p, and top_k parameters are removed from type stubs for newer models, but they already raised 400 errors at runtime on those models. If you were not using them, you will not notice.
Migration Checklist
- Check your Python version. Run
python --version. If it is below 3.10, upgrade Python first. - Search for custom HTTP clients. Grep for
httpx.Client,httpx.AsyncClient, orhttp_client=passed toAnthropic(). Migrate each one tohttpx2. - Search for completions usage. Grep for
client.completions,HUMAN_PROMPT, andAI_PROMPT. Migrate each to the Messages API. - Search for raw async response usage. Find
with_raw_responsein async code. Addawaitto every.parse(),.read(),.text(), and.json()call. - Check AnthropicBedrock initialization. Add
aws_regionexplicitly, or confirmAWS_DEFAULT_REGIONis set.
The full list of changes with before-and-after snippets is in the official MIGRATION.md on GitHub. Simon Willison documented his own upgrade of the llm-anthropic plugin four days after the release — a useful real-world reference. The v1.0.0 release notes on GitHub are also thorough.
This cleanup is overdue. The Text Completions API should have been removed in 2024. Python 3.9 has been EOL for nearly two years. The httpx2 switch aligns the SDK with where the broader Python AI tooling ecosystem is heading — OpenAI got there first, and Anthropic followed. If the migration feels painful, what you are actually paying down is accumulated technical debt. The SDK is not the problem.













