Configuring Claude Code

Connecting to the API

At work, we use either AWS Bedrock or Azure Foundry to host the Anthropic models that we connect to. Depending on who gets the most recent models faster, I frequently find myself switching between the two. I figured it was worth it to capture the environment variables that make this possible, so I don't have to keep looking them up.

AWS Bedrock

To connect to AWS Bedrock, I have the following environment variables set in the .claude/settings.json file:

{
  "env": {
    "AWS_BEARER_TOKEN_BEDROCK": "INSERT_KEY_HERE",
    "CLAUDE_CODE_USE_BEDROCK": "1",
    "AWS_REGION": "eu-west-1",
    "ANTHROPIC_DEFAULT_FABLE_MODEL": "global.anthropic.claude-fable-5",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "global.anthropic.claude-opus-4-8",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "global.anthropic.claude-sonnet-4-6",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "global.anthropic.claude-haiku-4-5-20251001-v1:0"
  }
}

Azure Foundry

For Azure Foundry, I have the following environment variables set in the .claude/settings.json file:

{
  "env": {
    "CLAUDE_CODE_USE_FOUNDRY": "1",
    "ANTHROPIC_FOUNDRY_API_KEY": "INSERT_KEY_HERE",
    "ANTHROPIC_FOUNDRY_RESOURCE": "pxl-ailab-sbx-aif01-resource",
    "ANTHROPIC_DEFAULT_FABLE_MODEL": "claude-fable-5",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-8",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4-6",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4-5"
  }
}