claude-code - 💡(How to fix) Fix Support multiple ANTHROPIC_CUSTOM_MODEL_OPTION entries in /model picker [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#58583Fetched 2026-05-14 03:44:31
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Author
Timeline (top)
labeled ×2commented ×1

ANTHROPIC_CUSTOM_MODEL_OPTION only supports a single custom model entry in the /model picker. When deploying Claude Code with a LiteLLM gateway that routes to multiple non-Anthropic models (e.g., DeepSeek, GLM), there's no way to expose more than one in the picker.

Root Cause

This is especially needed because gateway model discovery (CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1) does not work when authentication is provided via apiKeyHelper — see #58581. The ANTHROPIC_CUSTOM_MODEL_OPTION env var is the only remaining mechanism to surface non-Anthropic models, but it's limited to one.

Code Example

{
  "env": {
    "ANTHROPIC_CUSTOM_MODEL_OPTION_1": "deepseek",
    "ANTHROPIC_CUSTOM_MODEL_OPTION_NAME_1": "DeepSeek",
    "ANTHROPIC_CUSTOM_MODEL_OPTION_2": "glm",
    "ANTHROPIC_CUSTOM_MODEL_OPTION_NAME_2": "GLM"
  }
}

---

{
  "customModels": [
    { "id": "deepseek", "name": "DeepSeek" },
    { "id": "glm", "name": "GLM" }
  ]
}
RAW_BUFFERClick to expand / collapse

Summary

ANTHROPIC_CUSTOM_MODEL_OPTION only supports a single custom model entry in the /model picker. When deploying Claude Code with a LiteLLM gateway that routes to multiple non-Anthropic models (e.g., DeepSeek, GLM), there's no way to expose more than one in the picker.

Motivation

This is especially needed because gateway model discovery (CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1) does not work when authentication is provided via apiKeyHelper — see #58581. The ANTHROPIC_CUSTOM_MODEL_OPTION env var is the only remaining mechanism to surface non-Anthropic models, but it's limited to one.

Proposal

Support numbered suffixes for multiple entries:

{
  "env": {
    "ANTHROPIC_CUSTOM_MODEL_OPTION_1": "deepseek",
    "ANTHROPIC_CUSTOM_MODEL_OPTION_NAME_1": "DeepSeek",
    "ANTHROPIC_CUSTOM_MODEL_OPTION_2": "glm",
    "ANTHROPIC_CUSTOM_MODEL_OPTION_NAME_2": "GLM"
  }
}

Or alternatively, a JSON settings key:

{
  "customModels": [
    { "id": "deepseek", "name": "DeepSeek" },
    { "id": "glm", "name": "GLM" }
  ]
}

Prior art

  • #2480 — same request, closed due to inactivity with no resolution
  • #58581 — gateway discovery broken with apiKeyHelper, making ANTHROPIC_CUSTOM_MODEL_OPTION the only viable path for non-Anthropic models

Environment

  • Claude Code version: 2.1.140
  • Gateway: LiteLLM with multiple non-Anthropic model backends

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING