Unclear It is not clear whether the Foundry connection already read this variable on its own before this change.
What
ANTHROPIC_FOUNDRY_RESOURCE is the environment variable that tells Claude Code which Microsoft Foundry resource to use when ANTHROPIC_FOUNDRY_BASE_URL is not set. An environment variable is a setting passed to a program from your shell.
- The value must now be 2 to 64 letters, digits or hyphens, and it cannot start or end with a hyphen, for example
my-resource. - Before, the value was dropped straight into
https://<resource>.services.ai.azure.com. Now that address is built only from a valid name. - A value that is a URL or a host name now fails with an error that says to set
ANTHROPIC_FOUNDRY_BASE_URLinstead if you want to use a full URL. - A valid name is passed to the Foundry client explicitly as
resource. - The runner's inference configuration rejects bad names with the same message.
Why
If you had put a full address in ANTHROPIC_FOUNDRY_RESOURCE, Claude Code now tells you plainly what is wrong instead of failing later with a confusing connection error. A malformed value can also no longer turn into a request to an unexpected host.
The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.
* `"customEndpoint"`: the Anthropic API or a cloud provider's API sent to another host, such as an [LLM gateway](/docs/en/llm-gateway) named by `ANTHROPIC_BASE_URL`, a provider's `ANTHROPIC_*_BASE_URL` variable, or an `ANTHROPIC_FOUNDRY_RE…settings-reference see the edit
* **Foundry:** `import "github.com/anthropics/anthropic-sdk-go/foundry"`. Use `foundry.NewClient(cfg)` with a `foundry.ClientConfig` value to construct a client; set `APIKey` (or `AzureADTokenProvider` for Microsoft Entra ID) and `Resource…cli-sdks-libraries/sdks/go see the edit
// It does not read ANTHROPIC_FOUNDRY_BASE_URL.build-with-claude/claude-in-microsoft-foundry see the edit
It is not clear whether the Foundry connection already read this variable on its own before this change.
Anthropic's documentation has since written up ANTHROPIC_FOUNDRY_BASE_URL, on claude-in-microsoft-foundry.
Fixed ANTHROPIC_FOUNDRY_RESOURCE being interpolated into the Foundry endpoint host unvalidated; a value that is not a plain resource name is…