[BUG] model picker doesn't show gateway's models

Status Fixed / completed
Reported on v2.1.126
Maintainer reply None cached
Activity 5 comments · opened May 3, 2026 · closed May 7, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

I saw the latest release announced:

The /model picker now lists models from your gateway's /v1/models endpoint when ANTHROPIC_BASE_URL points at an Anthropic-compatible gateway

So I tried it.
I created a tiny server whose sole purpose was to return one model. I also wanted to test it with a non-anthropic model, so I set it as GPT-5.

I set the env var ANTHROPIC_BASE_URL=http://127.0.0.1 and saw that the page http://127.0.0.1/v1/models was called.

It returned this JSON at the bottom of this issue. I also tried this with returning a json marking everything as supported.

Then when I ran /model I didn't see the model.
I then saw in the logs: [gatewayDiscovery] 0 usable models after filter
Am I missing something? I'm using the latest version v2.1.126

{
  "data": [
    {
      "id": "1468c314-2acd-496e-a836-161eeb552c40",
      "type": "model",
      "display_name": "GPT-5",
      "created_at": "2026-01-01T00:00:00Z",
      "max_input_tokens": 200000,
      "max_tokens": 16384,
      "capabilities": {
        "batch": {
          "supported": false
        },
        "citations": {
          "supported": false
        },
        "code_execution": {
          "supported": false
        },
        "effort": {
          "supported": true,
          "low": {
            "supported": true
          },
          "medium": {
            "supported": true
          },
          "high": {
            "supported": true
          },
          "max": {
            "supported": false
          },
          "xhigh": {
            "supported": false
          }
        },
        "thinking": {
          "supported": true,
          "types": {
            "enabled": {
              "supported": true
            },
            "adaptive": {
              "supported": true
            }
          }
        },
        "image_input": {
          "supported": true
        },
        "pdf_input": {
          "supported": false
        },
        "structured_outputs": {
          "supported": true
        },
        "context_management": {
          "supported": false,
          "clear_thinking_20251015": {
            "supported": false
          },
          "clear_tool_uses_20250919": {
            "supported": false
          },
          "compact_20260112": {
            "supported": false
          }
        }
      }
    }
  ],
  "first_id": "1468c314-2acd-496e-a836-161eeb552c40",
  "last_id": "1468c314-2acd-496e-a836-161eeb552c40",
  "has_more": false
}


### What Should Happen?

I should have been able to see GPT-5 as one of the models after entering `/model`.
Or maybe even the only one, I'm not sure

### Error Messages/Logs

```shell
I suspect this is the relevant log:
[gatewayDiscovery] 0 usable models after filter

Steps to Reproduce

  1. create a script for "hosting" the models list (only one for this test case):
const http = require("http");

const response = {
  data: [
    {
      id: "1468c314-2acd-496e-a836-161eeb552c40",
      type: "model",
      display_name: "GPT-5",
      created_at: "2026-01-01T00:00:00Z",
      max_input_tokens: 200000,
      max_tokens: 16384,
      capabilities: {
        batch: { supported: true },
        citations: { supported: true },
        code_execution: { supported: true },
        effort: {
          supported: true,
          low: { supported: true },
          medium: { supported: true },
          high: { supported: true },
          max: { supported: true },
          xhigh: { supported: true },
        },
        thinking: {
          supported: true,
          types: {
            enabled: { supported: true },
            adaptive: { supported: true },
          },
        },
        image_input: { supported: true },
        pdf_input: { supported: true },
        structured_outputs: { supported: true },
        context_management: {
          supported: true,
          clear_thinking_20251015: { supported: true },
          clear_tool_uses_20250919: { supported: true },
          compact_20260112: { supported: true },
        },
      },
    },
  ],
  first_id: "1468c314-2acd-496e-a836-161eeb552c40",
  last_id: "1468c314-2acd-496e-a836-161eeb552c40",
  has_more: false,
};

const url = require("url");

const server = http.createServer((req, res) => {
  const pathname = url.parse(req.url).pathname;
  if (req.method === "GET" && pathname === "/v1/models") {
    res.writeHead(200, { "Content-Type": "application/json" });
    res.end(JSON.stringify(response));
  } else {
    res.writeHead(404);
    res.end("Not found");
  }
});

server.listen(80, "127.0.0.1", () => {
  console.log("Models server running at http://127.0.0.1/v1/models");
});

2. Run it with node (node /path/to/file.js)

3. Run claude with `ANTHROPIC_BASE_URL` env var set to `http://127.0.0.1`

4. Run `/model` and see it's not working.

4.1 You can run `claude --debug` and also see the log file with the comment saying it was (probably) filtered out

### Claude Model

Other

### Is this a regression?

I don't know

### Last Working Version

_No response_

### Claude Code Version

2.1.126

### Platform

Other

### Operating System

macOS

### Terminal/Shell

iTerm2

### Additional Information

_No response_

View original on GitHub ↗

5 Comments

github-actions[bot] · 3 months ago

Found 2 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/10169
  2. https://github.com/anthropics/claude-code/issues/47164

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

yuvaltabnine · 3 months ago

This issue is not like #10169 since that issue's talking about setting env vars, and was created before the current release (v2.1.126) which states the feature was added.

This issue is not like #47164 since that one is a feature request to add a section to the settings.json.
This issue is about supporting custom modules via the /v1/models endpoint

yuvaltabnine · 3 months ago

From the docs I missed:

Only models whose ID begins with claude or anthropic are added to the picker

Closing

cflee · 3 months ago

I did not know that they had updated the docs to mention this key point, thank you for mentioning it!

github-actions[bot] · 2 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.