[FEATURE] Environment Variables/mapping for specific model version overrides

Resolved 💬 6 comments Opened Jan 16, 2026 by mbos-splunk Closed Apr 18, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

Problem Statement

Currently, Claude Code provides environment variables to override model aliases:

  • ANTHROPIC_DEFAULT_OPUS_MODEL → controls the opus alias
  • ANTHROPIC_DEFAULT_SONNET_MODEL → controls the sonnet alias
  • ANTHROPIC_DEFAULT_HAIKU_MODEL → controls the haiku alias

However, the /model command displays specific model versions as separate options (e.g., "Opus 4.1", "Opus 4.5"). These specific version entries are hardcoded and cannot be customized.

Use Case: Users leveraging cloud providers like AWS Bedrock or custom LLM gateways often need to use provider-specific model identifiers (e.g., Bedrock inference profile ARNs, cross-region inference IDs, or custom endpoint models). While the alias-based environment variables allow overriding one "opus" option, there's no way to configure custom endpoints for each specific version shown in the model picker.

Example Scenario:
A user with AWS Bedrock wants both Opus 4.1 and Opus 4.5 available in the /model picker, each pointing to different Bedrock inference profiles:

  • Opus 4.1 → arn:aws:bedrock:us-west-2:123456789:inference-profile/global.opus-4-1-profile
  • Opus 4.5 → arn:aws:bedrock:us-west-2:123456789:inference-profile/global.opus-4-5-profile

Currently, only one can be configured via ANTHROPIC_DEFAULT_OPUS_MODEL and if we pass Opus 4.5 inference profile it will show up in Claude Code as Opus 4.1 and Opus 4.5 will direct to the default model id.

Proposed Solution

Introduce additional environment variables for specific model versions:

# Opus versions

ANTHROPIC_OPUS_4_MODEL="custom-model-id-or-arn"
ANTHROPIC_OPUS_4_5_MODEL="custom-model-id-or-arn"

# Sonnet versions
ANTHROPIC_SONNET_4_MODEL="custom-model-id-or-arn"
ANTHROPIC_SONNET_4_5_MODEL="custom-model-id-or-arn"

# Haiku versions
ANTHROPIC_HAIKU_3_5_MODEL="custom-model-id-or-arn"

Alternative Solutions

Model mapping

Configuration through settings.json file where we can map models to the inference profiles/other models.

  {
    "modelOverrides": {
      "claude-opus-4-20250514": "arn:aws:bedrock:...:inference-profile/us.custom-opus-4",
      "claude-opus-4-5-20251101": "arn:aws:bedrock:...:inference-profile/global.custom-opus-4-5",
      "claude-sonnet-4-5-20250929": "custom-sonnet-model-id"
    }
  }

List of models

Even better solution would be to supply a list of models. This would add support for older models as well as newest ones. This list could be supplied through settings.json and look like:

  {
    "modelList": {
      [
      { "name": "Opus 4.5", "model": "arn:aws:bedrock:...:inference-profile/us.custom-opus-4-5"},
      { "name": "Opus 4.1", "model": "arn:aws:bedrock:...:inference-profile/global.custom-opus-4-1"},
      { "name": "Sonnet 4.5", "model": "custom-sonnet-model-id"}
    }
  }

Priority

High - Significant impact on productivity

Feature Category

CLI commands and flags

Use Case Example

Environment Setup

An enterprise organization has configured Claude Code to use AWS Bedrock with Application Inference Profiles.

# Developer's shell environment
export CLAUDE_CODE_USE_BEDROCK=1
export ANTHROPIC_DEFAULT_OPUS_MODEL="arn:aws:bedrock:us-west-2:123456789012:application-inference-profile/opus-45-prod"
export ANTHROPIC_DEFAULT_SONNET_MODEL="arn:aws:bedrock:us-west-2:123456789012:application-inference-profile/sonnet-45-prod"

---

Current Scenario: Developer Wants to Use Opus 4.5

Step 1: Developer launches Claude Code

  claude

Step 2: Developer types /model to change the model
Step 3: Claude Code displays the model picker with options:

  Select a model:
    > Default
      Opus 4.5
      Opus 4.1
      Haiku

Step 4: Developer selects Opus 4.5
Step 5: Claude Code attempts to use the hardcoded model ID claude-opus-4-5-20251101
Step 6: ❌ Request fails
Bedrock rejects the request because the developer only has permission to access models through inference profiles, not directly

Expected Behavior (With Proposed Feature)

Step 1: Administrator configures environment variables for all model versions:

  export CLAUDE_CODE_USE_BEDROCK=1

  # Alias overrides
  export ANTHROPIC_DEFAULT_OPUS_MODEL="arn:aws:bedrock:us-west-2:123456789012:application-inference-profile/opus-45-prod"
  export ANTHROPIC_DEFAULT_SONNET_MODEL="arn:aws:bedrock:us-west-2:123456789012:application-inference-profile/sonnet-45-prod"

  # Specific version overrides (NEW)
  export ANTHROPIC_OPUS_4_1_MODEL="arn:aws:bedrock:us-west-2:123456789012:application-inference-profile/opus-41-prod"
  export ANTHROPIC_OPUS_4_5_MODEL="arn:aws:bedrock:us-west-2:123456789012:application-inference-profile/opus-45-prod"
  export ANTHROPIC_HAIKU_4_5_MODEL="arn:aws:bedrock:us-west-2:123456789012:application-inference-profile/haiku-4-5-prod"

Step 2: Developer launches Claude Code

claude

Step 3: Developer types /model to change the model

Step 4: Claude Code displays the model picker:

  Select a model:
    > Default
      Opus 4.5
      Opus 4.1
      Haiku

Step 5: Developer selects Opus 4.5
Step 6: Claude Code resolves Opus 4.5 → ANTHROPIC_OPUS_4_5_MODEL → arn:aws:bedrock:us-west-2:123456789012:application-inference-profile/opus-45-prod
Step 7: ✅ Request succeeds through the managed inference profile

Additional Context

I have added a High Impact on this as it does confuse people and understandably requires explanation why Opus 4.5 is actually under Opus 4.1.

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗