Claude Code ANTHROPIC_BASE_URL: 1M Context and Permission Defaults

Blog / Relays & gateways

Claude Code ANTHROPIC_BASE_URL: 1M Context and Permission Defaults

Claude Code 2.1.285, released on September 29, 2026, changed several things related to ANTHROPIC_BASE_URL. Sessions that connect through a custom base URL now use the model's native 1M context window. A new allowedProviders managed setting has been added. And -p and SDK sessions on third-party providers start in auto mode when no permission mode is configured. On October 16, version 2.1.302 reverted that last change to default mode under certain conditions. Below is a walkthrough based on the official changelog, plus steps to check your own setup.

What changed in 2.1.285 on September 29?

According to the official changelog, version 2.1.285 (September 29, 2026) has four relevant changes:

  • A new allowedProviders managed setting limits which API providers a machine may use. The scope covers the Anthropic API, custom endpoints, Bedrock, Mantle, Vertex AI, Foundry, Claude Platform on AWS, and Cloud gateway.
  • Sessions behind a custom ANTHROPIC_BASE_URL use the 1M context for models that have a 1M window (the changelog lists Opus 4.7+, Sonnet 5+, and Fable). If your gateway only supports up to 200K, the official advice is to run /autocompact 200k.
  • The one-time prompt about making auto mode the default permission mode now also appears for third-party providers and when telemetry is turned off.
  • claude -p and Python Agent SDK sessions start in auto mode on third-party providers or with telemetry off when no permission mode is configured, matching interactive sessions. --permission-mode can still override this.
VersionDateWhat matters here
2.1.287Oct 1Opus 4.7+ and Fable default to 1M context on Bedrock, Vertex, Foundry, and the Claude apps gateway, with no [1m] suffix needed; set CLAUDE_CODE_DISABLE_1M_CONTEXT=1 to stay at 200K
2.1.295Oct 8Each upstream of the apps gateway can have an optional models list; timeouts.upstream_ttfb_ms caps the wait before the stream starts; if a gateway or cloud vendor rejects the context-1m beta, Claude Code drops it and resends
2.1.302Oct 16On third-party providers, claude -p and Agent SDK sessions start in default mode when no permission mode is set and telemetry is off or the install is fresh; --permission-mode auto still gives auto

Note that the original wording of 2.1.302 carries conditions (third-party provider, telemetry off or fresh install). Check the official docs and your actual version for the exact behavior.

Which base URL and permission mode am I using right now?

  1. Check the environment variable with echo $ANTHROPIC_BASE_URL. If it has a value, requests are not going to the default official address. Also check whether the env field in ~/.claude/settings.json sets it.
  2. Check the version with claude --version. Anything below 2.1.285 will not show the 1M behavior above. For versions above 2.1.302, the latest changelog governs.
  3. Check the permission mode: look at the current mode inside a session, or in scripts write it explicitly, for example claude -p --permission-mode default. If you don't want to depend on version defaults, specify the mode explicitly.
  4. In enterprise environments, check whether your managed settings contain allowedProviders. It restricts which providers are allowed, not which models.

Is the 1M context actually in effect?

Changing the base URL doesn't guarantee the window changes with it, because the gateway has to actually support it. Here is how to tell:

  • First confirm that your model is one of the kinds the changelog lists as having a native 1M window.
  • If a long session triggers compaction too early or fails with a context-exceeded error, your gateway may only go up to 200K. Run /autocompact 200k, as the official advice says.
  • Since 2.1.295, when a gateway rejects the context-1m beta, requests no longer fail one by one. Claude Code strips the beta and resends. That makes "it works, but the window is small" more common than before. Ask your gateway provider about the exact supported range.

How do I measure endpoint latency?

A custom address adds a hop, so time to first token may get longer. On the cdnping home page you can test first-connection and round-trip times for various API entry points. The Anthropic status page shows probe records for the official endpoint, which you can compare against your gateway. If everything seems down, see Is Claude Code down?. For common causes of high latency, see Why is Claude Code slow?

What should I know before using AGI Plan?

AGI Plan is a commercial partner of cdnping. It is compatible with the Anthropic API format, so using Claude Code takes only a change of base URL and no Claude account. The site states clearly that it is not an officially authorized channel, and some models are available only outside mainland China; see https://agiplan.dev/models for specifics. Before going live, read Is a Claude API relay safe? and run the self-checks it describes. For basic setup, see Configuring custom API endpoints for Claude Code, Codex, and OpenCode.

Where can I read more about permission modes?

For how auto mode decides and how to troubleshoot it, see Claude Code now defaults to auto mode.

This information is current as of October 2026. Version behavior may keep changing, so rely on the official changelog.

Sources

Related articles

Keep reading