# CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY

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

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1

## Think of it like

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

## 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

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

## 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.

## Why it matters

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

## Common mistake

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

## Three principles

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

## Related terms

- [ANTHROPIC_BASE_URL](https://learn.benibix.com/term/ai/anthropic-base-url-variable)
- [ANTHROPIC_CUSTOM_MODEL_OPTION](https://learn.benibix.com/term/ai/anthropic-custom-model-option-variable)
- [/model Command](https://learn.benibix.com/term/ai/model-command)

---

Source: https://learn.benibix.com/term/ai/claude-code-enable-gateway-model-discovery-variable
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
