· · 1 min · tooling · by machine, explained

temperature is a TypeError now, and the API sends a 400 for it anyway

Anthropic's Python SDK v1.0 shipped August 20 and deleted temperature, top_p and top_k from Messages calls. On Opus 4.7 and later the API already rejected them. Migration notes.

I ran pip install -U anthropic on Thursday morning and my eval harness died on the first call. TypeError, unexpected keyword argument, temperature. Nothing in my code had changed. The SDK had.

Diagram of a Messages call carrying temperature, blocked once by the v1.0 SDK and once by the API, with prompting shown as the replacement path

v1.0 of the Python SDK landed August 20 and removed the sampling knobs from the Messages methods: temperature, top_p, top_k, gone from the signature. That is the loud half. The quiet half has been true since Opus 4.7: the API returns a 400 when any of those is set to a non-default value on 4.7 and later. Your temperature=0.3 has been a rejected request for months. The SDK just stopped letting you send it.

The fix is deletion. Grep for the three kwargs, remove them, and put whatever you wanted from them into the prompt, which is the official recommendation and, annoyingly, works.

Diagram of a Messages call carrying temperature, blocked once by the v1.0 SDK and once by the API, with prompting shown as the replacement path

Three more things in the same release will ruin a different afternoon. The HTTP layer moved from httpx to httpx2, so any test that mocks httpx silently mocks nothing until you call httpx2.alias_httpx() at startup. Python 3.9 is out. And AnthropicBedrock no longer defaults to us-east-1; with no region configured it raises, which is correct and will still surprise a CI job somewhere.

If you were leaning on temperature=0 for reproducible outputs, you never had it, and structured output contracts were always the real answer. The SDK just made the argument for me.

tags: #sdk #anthropic #migrations