Fix OpenRouter model id

This commit is contained in:
Saoud Rizwan committed 2025-09-29 10:47:00 -07:00
1 parent 25b1cf91fc
commit c496f8a90d
4 files changed
+8 -8

No files matched your search

+3 -3
View File
@@ -29,7 +29,7 @@ export async function createOpenRouterStream(
// this was initially specifically for claude models (some models may 'support prompt caching' automatically without this)
// handles direct model.id match logic
switch (model.id) {
case "anthropic/claude-4.5-sonnet":
case "anthropic/claude-sonnet-4.5":
case "anthropic/claude-sonnet-4":
case "anthropic/claude-opus-4.1":
case "anthropic/claude-opus-4":
@@ -89,7 +89,7 @@ export async function createOpenRouterStream(
// (models usually default to max tokens allowed)
let maxTokens: number | undefined
switch (model.id) {
case "anthropic/claude-4.5-sonnet":
case "anthropic/claude-sonnet-4.5":
case "anthropic/claude-sonnet-4":
case "anthropic/claude-opus-4.1":
case "anthropic/claude-opus-4":
@@ -126,7 +126,7 @@ export async function createOpenRouterStream(
let reasoning: { max_tokens: number } | undefined
switch (model.id) {
case "anthropic/claude-4.5-sonnet":
case "anthropic/claude-sonnet-4.5":
case "anthropic/claude-sonnet-4":
case "anthropic/claude-opus-4.1":
case "anthropic/claude-opus-4":
@@ -108,7 +108,7 @@ export async function refreshOpenRouterModels(
})
switch (rawModel.id) {
case "anthropic/claude-4.5-sonnet":
case "anthropic/claude-sonnet-4.5":
case "anthropic/claude-sonnet-4":
// NOTE: we artificially restrict the context window to 200k to keep costs low for users, and have a :1m model variant created below for users that want to use the full 1m.
modelInfo.contextWindow = 200_000
+1 -1
View File
@@ -590,7 +590,7 @@ export const bedrockModels = {
// OpenRouter
// https://openrouter.ai/models?order=newest&supported_parameters=tools
export const openRouterDefaultModelId = "anthropic/claude-4.5-sonnet" // will always exist in openRouterModels
export const openRouterDefaultModelId = "anthropic/claude-sonnet-4.5" // will always exist in openRouterModels
export const openRouterClaudeSonnet41mModelId = `anthropic/claude-sonnet-4${CLAUDE_SONNET_4_1M_SUFFIX}`
export const openRouterDefaultModelInfo: ModelInfo = {
maxTokens: 8192,
@@ -46,7 +46,7 @@ export interface OpenRouterModelPickerProps {
// Featured models for Cline provider
const featuredModels = [
{
id: "anthropic/claude-4.5-sonnet",
id: "anthropic/claude-sonnet-4.5",
description: "Recommended for agentic coding in Cline",
label: "New",
},
@@ -379,9 +379,9 @@ const OpenRouterModelPicker: React.FC<OpenRouterModelPickerProps> = ({ isPopup,
</VSCodeLink>
If you're unsure which model to choose, Cline works best with{" "}
<VSCodeLink
onClick={() => handleModelChange("anthropic/claude-4.5-sonnet")}
onClick={() => handleModelChange("anthropic/claude-sonnet-4.5")}
style={{ display: "inline", fontSize: "inherit" }}>
anthropic/claude-4.5-sonnet.
anthropic/claude-sonnet-4.5.
</VSCodeLink>
You can also try searching "free" for no-cost options currently available.
</p>