claude-code - 💡(How to fix) Fix [DOCS] Model picker docs missing gateway `/v1/models` discovery behavior [1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

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#55182Fetched 2026-05-02 05:46:06
View on GitHub
Comments
1
Participants
1
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
labeled ×4closed ×1commented ×1
RAW_BUFFERClick to expand / collapse

Documentation Type

Missing documentation (feature not documented)

Documentation Location

https://code.claude.com/docs/en/model-config

Section/Topic

"Add a custom model option" and LLM gateway model selection behavior for /model

Current Documentation

The model configuration page currently documents manually adding one custom picker entry:

Use ANTHROPIC_CUSTOM_MODEL_OPTION to add a single custom entry to the /model picker without replacing the built-in aliases. This is useful for LLM gateway deployments or testing model IDs that Claude Code does not list by default.

It also says:

The custom entry appears at the bottom of the /model picker. ANTHROPIC_CUSTOM_MODEL_OPTION_NAME and ANTHROPIC_CUSTOM_MODEL_OPTION_DESCRIPTION are optional. If omitted, the model ID is used as the name and the description defaults to Custom model (<model-id>).

The LLM gateway page currently says:

By default, Claude Code will use standard model names for the selected API format.

If you have configured custom model names in your gateway, use the environment variables documented in Model configuration to match your custom names.

What's Wrong or Missing?

Claude Code v2.1.126 added behavior where the /model picker lists models from a gateway's /v1/models endpoint when ANTHROPIC_BASE_URL points at an Anthropic-compatible gateway.

The current docs still describe gateway model selection as a manual environment-variable workflow and do not mention:

  • that Claude Code can discover gateway models from /v1/models
  • what response shape or compatibility expectations the gateway's /v1/models endpoint must satisfy
  • how discovered gateway models interact with ANTHROPIC_CUSTOM_MODEL_OPTION, availableModels, pinned default model environment variables, and _NAME / _DESCRIPTION / _SUPPORTED_CAPABILITIES
  • what users should expect in /model when the endpoint is absent, inaccessible, or returns no usable models

This leaves gateway administrators with the older mental model that every custom gateway model must be manually exposed through environment variables.

Suggested Improvement

Add a subsection under "Add a custom model option" or the LLM gateway "Model selection" section, for example:

Gateway model discovery

When ANTHROPIC_BASE_URL points at an Anthropic-compatible gateway, Claude Code v2.1.126 and later can populate the /model picker from the gateway's /v1/models endpoint.

Document:

  • the /v1/models endpoint requirement for gateways that want automatic picker population
  • whether Claude Code calls <ANTHROPIC_BASE_URL>/v1/models directly and what authentication headers are sent
  • the expected model-list response fields Claude Code uses for picker ID, display name, and description
  • fallback behavior when the endpoint is unavailable
  • precedence and interaction with ANTHROPIC_CUSTOM_MODEL_OPTION, availableModels, ANTHROPIC_DEFAULT_*_MODEL, and _SUPPORTED_CAPABILITIES

Impact

Medium - Makes feature difficult to understand

Additional Context

Affected Pages:

PageLine(s)Context
https://code.claude.com/docs/en/model-config253-267Documents manual ANTHROPIC_CUSTOM_MODEL_OPTION workflow for one custom /model picker entry
https://code.claude.com/docs/en/model-config316-330Mentions ANTHROPIC_BASE_URL gateway display-name variables but not automatic /v1/models picker discovery
https://code.claude.com/docs/en/llm-gateway50-57Gateway model selection section points users back to environment variables for custom model names

Version context: This behavior was added in Claude Code v2.1.126.

extent analysis

TL;DR

Update the documentation for "Add a custom model option" and LLM gateway model selection to include information on automatic gateway model discovery from the /v1/models endpoint.

Guidance

  • Review the current documentation for "Add a custom model option" and LLM gateway model selection to identify areas that need updates.
  • Add a new subsection to document the automatic gateway model discovery feature, including the required /v1/models endpoint, expected response fields, and fallback behavior.
  • Clarify the interaction between discovered gateway models and existing environment variables, such as ANTHROPIC_CUSTOM_MODEL_OPTION and availableModels.
  • Verify that the updated documentation accurately reflects the behavior of Claude Code v2.1.126 and later.

Example

No code snippet is provided as the issue is related to documentation updates.

Notes

The updates should be made to the pages listed in the "Affected Pages" section, specifically the lines mentioned in the context.

Recommendation

Apply workaround: Update the documentation to reflect the new behavior and provide clear guidance on using the automatic gateway model discovery feature. This will help gateway administrators understand how to use the feature and reduce confusion.

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

claude-code - 💡(How to fix) Fix [DOCS] Model picker docs missing gateway `/v1/models` discovery behavior [1 comments, 1 participants]