claude-code - 💡(How to fix) Fix [DOCS] Gateway `/v1/models` discovery docs still describe `/model` picker population as automatic [1 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#56492Fetched 2026-05-06 06:26:37
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×3cross-referenced ×1
RAW_BUFFERClick to expand / collapse

Documentation Type

Incorrect/outdated documentation

Documentation Location

https://code.claude.com/docs/en/llm-gateway

Section/Topic

Model selection in the LLM Gateway guide, plus the gateway discovery note in Model configuration

Current Documentation

The docs currently say:

When ANTHROPIC_BASE_URL points at a gateway that exposes the Anthropic Messages format, Claude Code queries the gateway's /v1/models endpoint at startup and adds the returned models to the /model picker.

And the model configuration page says:

For LLM gateway deployments, Claude Code populates the picker automatically from the gateway's /v1/models endpoint, so this variable is needed only when discovery does not return the model you want.

What's Wrong or Missing?

The v2.1.129 release changed this behavior so gateway /v1/models discovery for the /model picker is opt-in via CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1, but the docs still describe the v2.1.126-v2.1.128 behavior as automatic.

A. The default behavior is outdated

The current wording says Claude Code queries /v1/models automatically at startup when ANTHROPIC_BASE_URL points at a compatible gateway.

B. The enabling step is missing

The docs do not tell gateway users that they must set CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1 to restore picker discovery.

C. The fallback guidance is now incomplete

ANTHROPIC_CUSTOM_MODEL_OPTION is described as a fallback only when automatic discovery misses a model, but after v2.1.129 it is also relevant when users choose not to enable gateway discovery.

Suggested Improvement

Update both pages to reflect the new default and the opt-in flag.

Before:

Claude Code queries the gateway's /v1/models endpoint at startup and adds the returned models to the /model picker.

After:

Gateway /v1/models discovery for the /model picker is disabled by default. To enable it for an Anthropic-compatible gateway, set CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1. When discovery is disabled or incomplete, you can still add manual picker entries with ANTHROPIC_CUSTOM_MODEL_OPTION.

Also add an environment-variable reference for CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY so the LLM gateway and model configuration pages can link to one canonical definition.

Impact

Medium - Makes feature difficult to understand

Additional Context

Affected Pages:

PageLine(s)Context
https://code.claude.com/docs/en/llm-gateway56-62Says Claude Code queries gateway /v1/models at startup and adds models to /model automatically
https://code.claude.com/docs/en/model-config269-281Says ANTHROPIC_CUSTOM_MODEL_OPTION is needed only when automatic gateway discovery does not return the desired model

Total scope: 2 pages affected

Version context: v2.1.129 changed gateway /v1/models discovery for the /model picker to opt-in via CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1, but the current docs still describe the earlier automatic behavior.

extent analysis

TL;DR

Update the documentation to reflect the new default behavior and opt-in flag for gateway model discovery.

Guidance

  • Review the affected pages (LLM Gateway guide and Model configuration page) to ensure consistency with the new behavior introduced in v2.1.129.
  • Update the documentation to indicate that gateway /v1/models discovery is disabled by default and requires CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1 to be enabled.
  • Add an environment-variable reference for CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY to provide a canonical definition for both pages.
  • Verify that the updated documentation accurately describes the use of ANTHROPIC_CUSTOM_MODEL_OPTION as a fallback for both disabled and incomplete discovery scenarios.

Example

The updated documentation should resemble the suggested improvement:

Gateway /v1/models discovery for the /model picker is disabled by default. To enable it for an Anthropic-compatible gateway, set CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1. When discovery is disabled or incomplete, you can still add manual picker entries with ANTHROPIC_CUSTOM_MODEL_OPTION.

Notes

The updates should be applied to the two affected pages: https://code.claude.com/docs/en/llm-gateway and https://code.claude.com/docs/en/model-config.

Recommendation

Apply the workaround by updating the documentation to reflect the new behavior and opt-in flag, as this will provide accurate information to users and resolve the medium-impact issue.

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] Gateway `/v1/models` discovery docs still describe `/model` picker population as automatic [1 participants]