Source Intelligence

DisclaimerUnofficial, and not affiliated with Anthropic. Nearly all of this is read straight out of what ships: npm bundles, captured prompts, published docs. Anthropic's own notes go in verbatim, marked as theirs. The rest is my reading, and every entry carries the strings behind it. If one looks wrong, vote it down and say why.

All of v2.1.124 Home All releases olderv2.1.123 v2.1.126newer
Claude Code v2.1.124

Gateway model discovery for ANTHROPIC_BASE_URL

What

When ANTHROPIC_BASE_URL is set against a first-party gateway, Claude Code now discovers the gateway's available Claude/Anthropic models on startup and lists them in the model picker labelled From gateway.

Details
  • On startup it issues GET <baseUrl>/v1/models?limit=1000 (using whichever of ANTHROPIC_AUTH_TOKEN / API key is configured plus any ANTHROPIC_CUSTOM_HEADERS), filters to entries whose id starts with claude or anthropic, and caches them in <config-dir>/cache/gateway-models.json keyed by base URL.
  • Empty / non-OK responses are dropped with debug logs: [gatewayDiscovery] non-OK status …, [gatewayDiscovery] response body failed validation, [gatewayDiscovery] 0 usable models after filter, [gatewayDiscovery] cached N models.
  • Discovery is skipped when the host manages the provider (CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST) or when not in first-party mode.
  • The /model picker merges these into the available list so Bedrock/Vertex-only models get inline labels and descriptions instead of being hidden.
Evidence

Gateway discovery (search for "gateway-models.json", "/v1/models?limit=1000", and "From gateway").

Strings lifted out of the shipped bundle, so the claim above can be checked against them.

See this entry in the whole of v2.1.124 →