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

Resolved 💬 5 comments Opened May 3, 2026 by yuvaltabnine 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 ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗