anthropic 2.14.0 (24 November 2026) lets proxy= override HTTPS_PROXY and NO_PROXY. Measured on 2.13.0 and 2.14.0: seven of thirteen setups change route.
What changed on 24 November 2026
Version 2.14.0 of the Anthropic Python SDK, anthropic on PyPI, was released on 24 November 2026. Besides new API resources, its release notes contain one bug fix that changes network routing: the default HTTP clients now honour proxy= and trust_env. In the notes' words, DefaultHttpxClient and DefaultAsyncHttpxClient "read HTTP_PROXY, HTTPS_PROXY, ALL_PROXY and NO_PROXY even when the caller passed proxy= or trust_env=False, and the variables won". From 2.14.0, an explicit proxy= is used for every request and the variables are not read, and trust_env=False ignores them, matching plain httpx2, the HTTP library the 2.x SDK is built on (pydantic/httpx2, BSD-3-Clause).
The notes also say what to watch for: "with proxy= set, a host listed in NO_PROXY used to be reached directly and now goes through your proxy", and to keep a host off the proxy you pass mounts={"all://that.host": None}.
For most applications nothing changes. For anyone who sets both a proxy argument and proxy variables, which is common on corporate networks and in CI, the hop that requests take can change on upgrade, in either direction: traffic that went direct may now go through a proxy, and traffic that went through the environment's proxy may now go through a different one. This guide measures exactly which configurations change and how to test yours.
How the two versions build the proxy map
The difference is a few lines in DefaultHttpxClient.__init__ in anthropic/_base_client.py, which builds the client's mounts: a map from URL patterns to transports, where a None transport means a direct connection.
# 2.13.0: environment mounts always, applied over the proxy= argument
proxy_map = {key: None if url is None else Proxy(url=url) for key, url in get_environment_proxies().items()}
# 2.14.0: proxy= alone, otherwise the environment only when trust_env is true
proxy_map = {}
if (proxy := kwargs.pop("proxy", None)) is not None:
proxy_map["all://"] = proxy
elif kwargs.get("trust_env", True):
proxy_map.update(get_environment_proxies())In 2.13.0 the proxy= argument was passed through to httpx2, which turned it into an all:// mount, and the SDK's environment mounts were then applied over it. httpx2 picks the most specific matching pattern for each request: patterns with a host beat patterns without one, and a scheme such as https:// beats all://. So an HTTPS_PROXY variable produced an https:// mount that outranked the explicit all:// proxy, and every NO_PROXY entry produced a host pattern mapped to a direct connection that outranked both.
Measured with both versions
The measurements used two virtual environments on CPython 3.13, one with anthropic==2.13.0 and one with anthropic==2.14.0, both with httpx2==2.16.2. Two methods were used, and they agree. The first sends a real Messages request through local listeners: a fake upstream API, proxy A set through the environment and proxy B passed as proxy=. It records which listener received the request. The second builds DefaultHttpxClient and asks it which mount pattern serves the target URL, without sending anything. No request left the machine and the API key was a placeholder.
| Configuration | 2.13.0 route | 2.14.0 route |
|---|---|---|
| No proxy settings | direct | direct |
HTTP_PROXY only | proxy A | proxy A |
proxy= B and HTTP_PROXY A | proxy A | proxy B |
proxy= B and ALL_PROXY A | proxy A | proxy B |
proxy= B and NO_PROXY=localhost | direct | proxy B |
proxy= B, HTTP_PROXY A, NO_PROXY=localhost | direct | proxy B |
trust_env=False and HTTP_PROXY A | proxy A | direct |
proxy= B with mounts={"all://localhost": None} | direct | direct |
HTTP_PROXY A with NO_PROXY=localhost | direct | direct |
The first nine rows target http://localhost and were measured with real requests. For the real API host, https://api.anthropic.com, the mount probe gives the same pattern: proxy= B with HTTPS_PROXY A went to A on 2.13.0 and to B on 2.14.0, and proxy= B with NO_PROXY=.anthropic.com went direct on 2.13.0 and to B on 2.14.0. Of the thirteen configurations tested, seven change their route on upgrade.
The NO_PROXY formats matter too, because httpx2 turns each entry into a pattern with its own reach. localhost matches only that name. .anthropic.com becomes all://*.anthropic.com, which matches subdomains such as api.anthropic.com but not anthropic.com itself. anthropic.com becomes all://*anthropic.com, which matches the domain and its subdomains but not notanthropic.com. An entry containing :// is used as a pattern unchanged. The companion tests assert each of these rules against the model.
Two details are easy to miss. First, trust_env=False did nothing on 2.13.0: the environment proxy was still used. Code that set it to bypass a CI proxy was not bypassing anything. Second, NO_PROXY=* is special in httpx2: it discards every environment proxy, so with proxy= set both versions use the explicit proxy.
Who is affected
- Applications that pass
proxy=and run where proxy variables are set. On 2.13.0 the variables silently overrode the argument. On 2.14.0 the argument wins. If the variable pointed at the proxy your network actually allows, the upgrade can break connectivity. - Applications that relied on
NO_PROXYwithproxy=, for example to reach a local model gateway directly while sending API traffic through a corporate proxy. On 2.14.0 the gateway traffic goes through the proxy too, unless you add a mount. - Code that set
trust_env=Falseexpecting direct connections. It gets them only from 2.14.0. - Applications that configure proxies only through variables see no change.
Upgrade steps
- Find every place that constructs
DefaultHttpxClientorDefaultAsyncHttpxClient, or passeshttp_client=to the SDK client, and note whether it setsproxy=,trust_envormounts. - For each deployment, record the proxy variables present at runtime, including lowercase forms, which urllib also reads.
- Decide the intended route for each target host: the API, any gateways, internal services called with the same client.
- If a host must stay direct while
proxy=is set, add it explicitly as a mount, as in the snippet below. - Test the route before and after the upgrade with the companion probe, which runs offline, and keep the test in CI so a later change is caught.
import anthropic
from anthropic import DefaultHttpxClient
client = anthropic.Anthropic(
http_client=DefaultHttpxClient(
proxy="http://proxy-b.bookstore.test:3128",
mounts={"all://gateway.bookstore.test": None},
)
)Testing your own configuration
The companion example anthropic_proxy_precedence contains three pieces. probe.py sends real requests through local listeners for the nine localhost scenarios. probe_mounts.py asks the installed SDK which pattern serves each fixture URL without sending anything; run it in each version's virtual environment. And example.py is a small model of the precedence rules. Its tests check it against both recorded probes on all thirteen scenarios, and the interactive lab uses the same rules, so you can try your own variables and see the route on both versions.
Limits of the measurement
The model and lab cover host names only. httpx2 also accepts IP addresses and CIDR ranges in NO_PROXY, which are not modelled. On Windows and macOS, Python's urllib.request.getproxies(), which httpx2 uses, falls back to the system proxy settings when no proxy variable is set, so a machine with a system proxy behaves as if a variable were set. The async client was not measured separately; its code change is identical in the 2.14.0 diff.
Verification
After upgrading, confirm the route rather than assuming it. In a test environment, point proxy= at a local listener, set the same variables as production, and assert that requests arrive where you expect. The probe in the companion example does this in a few seconds. In production, proxies usually log the requests they forward, so a route change shows up in those logs as a sudden appearance or disappearance of API traffic. Check them for the first hour after the upgrade.
Interactive experiment
Anthropic SDK proxy routing: proxy=, proxy variables and NO_PROXY. Synthetic browser-local fixtures, adjustable inputs, decision traces and JSON export.