[DOCS] Gateway `/v1/models` discovery docs still describe `/model` picker population as automatic

Resolved 💬 2 comments Opened May 6, 2026 by coygeek Closed May 10, 2026

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:

| Page | Line(s) | Context |
|------|---------|---------|
| https://code.claude.com/docs/en/llm-gateway | 56-62 | Says Claude Code queries gateway /v1/models at startup and adds models to /model automatically |
| https://code.claude.com/docs/en/model-config | 269-281 | Says 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.

View original on GitHub ↗

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