Problem: I'm not able to choose from all of the custom models in the web UI.
{
"$schema": "https://opencode.ai/config.json",
"model": "openrouter-custom/openai/gpt-5.2",
"small_model": "openrouter-custom/google/gemini-3-flash-preview",
"provider": {
"deepseek-custom": {
"npm": "@ai-sdk/openai-compatible",
"name": "deepseek-custom",
"options": {
"baseURL": "https://api.deepseek.com/v1",
"apiKey": "{env:DEEPSEEK_API_KEY}"
},
"models": {
"deepseek-chat": {
"name": "deepseek-chat",
"cost": {
"input": 2,
"output": 3,
"cache_read": 0.2,
"cache_write": 3
},
"limit": {
"context": 128000,
"output": 8000
}
}
}
},
"aliyun": {
"npm": "@ai-sdk/openai-compatible",
"name": "aliyun",
"options": {
"baseURL": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"apiKey": "{env:BAILIAN_API_KEY}"
},
"models": {
"qwen3-max": {
"name": "qwen3-max",
"cost": {
"input": 10,
"output": 40,
"cache_read": 10,
"cache_write": 40
},
"limit": {
"context": 262144,
"output": 65536
}
},
"qwen3-coder-plus": {
"name": "qwen3-coder-plus",
"cost": {
"input": 6,
"output": 24,
"cache_read": 6,
"cache_write": 24
},
"limit": {
"context": 1000000,
"output": 65536
}
},
"qwen3-coder-480b-a35b-instruct": {
"name": "qwen3-coder-480b-a35b-instruct",
"cost": {
"input": 6,
"output": 24,
"cache_read": 6,
"cache_write": 24
},
"limit": {
"context": 262144,
"output": 65536
}
},
"deepseek-v3.2": {
"name": "deepseek-v3.2",
"cost": {
"input": 2,
"output": 3,
"cache_read": 2,
"cache_write": 3
},
"limit": {
"context": 131072,
"output": 65536
}
},
"glm-4.7": {
"name": "glm-4.7",
"cost": {
"input": 3,
"output": 14,
"cache_read": 3,
"cache_write": 14
},
"limit": {
"context": 202752,
"output": 16384
}
}
}
},
"openrouter-custom": {
"npm": "@ai-sdk/openai-compatible",
"name": "openrouter-custom",
"options": {
"baseURL": "https://openrouter.ai/api/v1",
"apiKey": "{env:OPENROUTER_API_KEY}"
},
"models": {
"openai/gpt-5": {
"name": "openai/gpt-5",
"cost": {
"input": 1.25,
"output": 10,
"cache_read": 0.125
},
"limit": {
"context": 400000,
"output": 128000
}
},
"openai/gpt-5.2": {
"name": "openai/gpt-5.2",
"cost": {
"input": 1.75,
"output": 14,
"cache_read": 0.175
},
"limit": {
"context": 400000,
"output": 128000
}
},
"google/gemini-2.5-pro": {
"name": "google/gemini-2.5-pro",
"cost": {
"input": 1.25,
"output": 10,
"cache_read": 0.31,
"cache_write": 1.625
},
"limit": {
"context": 1048576,
"output": 65536
}
},
"google/gemini-2.5-flash": {
"name": "google/gemini-2.5-flash",
"cost": {
"input": 0.3,
"output": 2.5,
"cache_read": 0.075,
"cache_write": 0.383
},
"limit": {
"context": 1048576,
"output": 65536
}
},
"google/gemini-3-flash-preview": {
"name": "google/gemini-3-flash-preview",
"cost": {
"input": 0.5,
"output": 3,
"cache_read": 0.05,
"cache_write": 3
},
"limit": {
"context": 1048576,
"output": 65536
}
},
"deepseek/deepseek-v3.2": {
"name": "deepseek/deepseek-v3.2",
"cost": {
"input": 0.25,
"output": 0.38,
"cache_read": 0.25,
"cache_write": 0.38
},
"limit": {
"context": 163840,
"output": 163840
}
},
"qwen/qwen3-max": {
"name": "qwen/qwen3-max",
"cost": {
"input": 1.2,
"output": 6,
"cache_read": 0.24,
"cache_write": 6
},
"limit": {
"context": 256000,
"output": 32800
}
},
"qwen/qwen3-coder-plus": {
"name": "qwen/qwen3-coder-plus",
"cost": {
"input": 1,
"output": 5,
"cache_read": 0.1,
"cache_write": 5
},
"limit": {
"context": 128000,
"output": 65536
}
},
"z-ai/glm-4.6": {
"name": "z-ai/glm-4.6",
"cost": {
"input": 0.6,
"output": 2.2,
"cache_read": 0.6,
"cache_write": 2.2
},
"limit": {
"context": 200000,
"output": 128000
}
},
"z-ai/glm-4.7": {
"name": "z-ai/glm-4.7",
"cost": {
"input": 0.4,
"output": 1.5,
"cache_read": 0.4,
"cache_write": 1.5
},
"limit": {
"context": 202752,
"output": 131100
}
}
}
}
}
}
But I'm not able to choose from all of the custom models in the web UI (but the ones that are ever used in the TUI):
Question
opencode version: 1.0.220
Problem: I'm not able to choose from all of the custom models in the web UI.
Here is my config (
~/.config/opencode/opencode.json):{ "$schema": "https://opencode.ai/config.json", "model": "openrouter-custom/openai/gpt-5.2", "small_model": "openrouter-custom/google/gemini-3-flash-preview", "provider": { "deepseek-custom": { "npm": "@ai-sdk/openai-compatible", "name": "deepseek-custom", "options": { "baseURL": "https://api.deepseek.com/v1", "apiKey": "{env:DEEPSEEK_API_KEY}" }, "models": { "deepseek-chat": { "name": "deepseek-chat", "cost": { "input": 2, "output": 3, "cache_read": 0.2, "cache_write": 3 }, "limit": { "context": 128000, "output": 8000 } } } }, "aliyun": { "npm": "@ai-sdk/openai-compatible", "name": "aliyun", "options": { "baseURL": "https://dashscope.aliyuncs.com/compatible-mode/v1", "apiKey": "{env:BAILIAN_API_KEY}" }, "models": { "qwen3-max": { "name": "qwen3-max", "cost": { "input": 10, "output": 40, "cache_read": 10, "cache_write": 40 }, "limit": { "context": 262144, "output": 65536 } }, "qwen3-coder-plus": { "name": "qwen3-coder-plus", "cost": { "input": 6, "output": 24, "cache_read": 6, "cache_write": 24 }, "limit": { "context": 1000000, "output": 65536 } }, "qwen3-coder-480b-a35b-instruct": { "name": "qwen3-coder-480b-a35b-instruct", "cost": { "input": 6, "output": 24, "cache_read": 6, "cache_write": 24 }, "limit": { "context": 262144, "output": 65536 } }, "deepseek-v3.2": { "name": "deepseek-v3.2", "cost": { "input": 2, "output": 3, "cache_read": 2, "cache_write": 3 }, "limit": { "context": 131072, "output": 65536 } }, "glm-4.7": { "name": "glm-4.7", "cost": { "input": 3, "output": 14, "cache_read": 3, "cache_write": 14 }, "limit": { "context": 202752, "output": 16384 } } } }, "openrouter-custom": { "npm": "@ai-sdk/openai-compatible", "name": "openrouter-custom", "options": { "baseURL": "https://openrouter.ai/api/v1", "apiKey": "{env:OPENROUTER_API_KEY}" }, "models": { "openai/gpt-5": { "name": "openai/gpt-5", "cost": { "input": 1.25, "output": 10, "cache_read": 0.125 }, "limit": { "context": 400000, "output": 128000 } }, "openai/gpt-5.2": { "name": "openai/gpt-5.2", "cost": { "input": 1.75, "output": 14, "cache_read": 0.175 }, "limit": { "context": 400000, "output": 128000 } }, "google/gemini-2.5-pro": { "name": "google/gemini-2.5-pro", "cost": { "input": 1.25, "output": 10, "cache_read": 0.31, "cache_write": 1.625 }, "limit": { "context": 1048576, "output": 65536 } }, "google/gemini-2.5-flash": { "name": "google/gemini-2.5-flash", "cost": { "input": 0.3, "output": 2.5, "cache_read": 0.075, "cache_write": 0.383 }, "limit": { "context": 1048576, "output": 65536 } }, "google/gemini-3-flash-preview": { "name": "google/gemini-3-flash-preview", "cost": { "input": 0.5, "output": 3, "cache_read": 0.05, "cache_write": 3 }, "limit": { "context": 1048576, "output": 65536 } }, "deepseek/deepseek-v3.2": { "name": "deepseek/deepseek-v3.2", "cost": { "input": 0.25, "output": 0.38, "cache_read": 0.25, "cache_write": 0.38 }, "limit": { "context": 163840, "output": 163840 } }, "qwen/qwen3-max": { "name": "qwen/qwen3-max", "cost": { "input": 1.2, "output": 6, "cache_read": 0.24, "cache_write": 6 }, "limit": { "context": 256000, "output": 32800 } }, "qwen/qwen3-coder-plus": { "name": "qwen/qwen3-coder-plus", "cost": { "input": 1, "output": 5, "cache_read": 0.1, "cache_write": 5 }, "limit": { "context": 128000, "output": 65536 } }, "z-ai/glm-4.6": { "name": "z-ai/glm-4.6", "cost": { "input": 0.6, "output": 2.2, "cache_read": 0.6, "cache_write": 2.2 }, "limit": { "context": 200000, "output": 128000 } }, "z-ai/glm-4.7": { "name": "z-ai/glm-4.7", "cost": { "input": 0.4, "output": 1.5, "cache_read": 0.4, "cache_write": 1.5 }, "limit": { "context": 202752, "output": 131100 } } } } } }I launched opencode under my project path (just
opencode), then opened web UI. I'm able to switch model in the TUI and I can choose from all of the custom models:But I'm not able to choose from all of the custom models in the web UI (but the ones that are ever used in the TUI):