Skip to content
BENIBIX Learn

CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY

AI⌨️ Claude CodeConfiguration

Also known as CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1

Set to 1, it fills the model picker from your gateway's list.

Think of it like

It is like you ask the shop for its own list of what is in stock.

Example

Lucy's gateway offers six models, but /model showed only the usual three. She turns this on, and all six appear.

Why it matters

People can pick from what the gateway has, with no list to keep by hand.

Definition

CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY fills the /model list from your gateway. Set it to 1 to turn it on. It works when your base URL points at a gateway such as LiteLLM. It is off by default. With one shared key, it would show each user every model the key can reach.

Example code

bash
export ANTHROPIC_BASE_URL=https://llm.example.com
export CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1
claude
Show the gateway's models in /model.

Common mistake

Turning it on for a gateway with a shared key and no allow list. Then all see every model.

Key takeaways

  1. 1
    Reads the gateway list. Its /v1/models.
  2. 2
    Off by default. Set 1.
  3. 3
    Allowlist still applies. Filter what shows.