Skip to content

docs: document CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY for /model picker#141

Open
mateo-berri wants to merge 1 commit into
mainfrom
litellm_gateway_model_discovery_docs
Open

docs: document CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY for /model picker#141
mateo-berri wants to merge 1 commit into
mainfrom
litellm_gateway_model_discovery_docs

Conversation

@mateo-berri
Copy link
Copy Markdown
Collaborator

@mateo-berri mateo-berri commented May 16, 2026

Summary

Adds a new section to the Claude Code Quickstart (docs/tutorials/claude_responses_api.md) covering CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1, which is required for LiteLLM-proxy models to show up inside Claude Code's /model picker.

Without this env var, the picker only lists Anthropic's built-in models even after ANTHROPIC_BASE_URL is pointed at the LiteLLM gateway — discovery is off by default upstream so that gateways backed by a shared API key don't surface every accessible model to every user.

The new section explains:

  • What the flag does (Claude Code calls GET {ANTHROPIC_BASE_URL}/v1/models at startup and adds returned models to /model, labeled "From gateway")
  • Minimum Claude Code version (v2.1.129)
  • The claude / anthropic id-prefix filter that determines which models appear (and the implication for naming entries in config.yaml)
  • Auth model (re-uses ANTHROPIC_AUTH_TOKEN / ANTHROPIC_API_KEY) and cache location (~/.claude/cache/gateway-models.json)
  • When discovery does not run (Bedrock / Vertex pass-through, unset / api.anthropic.com base URL)
  • How to persist the setting via ~/.claude/settings.json
  • Link to Anthropic's upstream LLM gateway docs

Test plan

  • npm run build renders the Quickstart page cleanly
  • Section anchors / sidebar entry under AI Tools → Claude Code still resolve
  • Code blocks and :::tip admonition render correctly

Note

Low Risk
Documentation-only change describing how to enable gateway model discovery in Claude Code; no runtime or API behavior in this repo is modified.

Overview
Adds a new Claude Code Quickstart section explaining how to make LiteLLM gateway models appear in Claude Code’s /model picker via CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1.

Documents how discovery works (startup GET {ANTHROPIC_BASE_URL}/v1/models, auth reuse, cache location), plus version requirements, filtering/limitations (gateway-only, claude/anthropic id prefix), and how to persist the setting in ~/.claude/settings.json with a link to upstream Anthropic docs.

Reviewed by Cursor Bugbot for commit cfaeeea. Bugbot is set up for automated code reviews on this repo. Configure here.

…picker

Adds a section to the Claude Code Quickstart explaining how to enable
gateway model discovery so LiteLLM-configured models appear in Claude
Code's /model picker. Covers requirements (Claude Code v2.1.129+),
the claude/anthropic id prefix filter, caching behavior, and how to
persist the setting in ~/.claude/settings.json.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment May 16, 2026 8:01pm

Request Review

@mateo-berri mateo-berri marked this pull request as ready for review May 16, 2026 20:32
@mateo-berri mateo-berri requested a review from a team May 16, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant