400 Bad Request for every openrouter prompt for 0.2.22
The following error appears for openrouter promts.
ERROR 2025-07-10T15:54:07 +0ms service=tui failed to send message: POST "http://127.0.0.1:56639/session/ses_80af4d182ffe4EJ3Nw2XR5s0yS/message": 400 Bad Request {"name":"ProviderInitError","data":{"providerID":"openrouter"}}
And the opencode auth.
same issue here... any idea anyone?
Same issue
The issue is gone when I disable my config.json file + removing ~/.cache/opencode folder
My config.json
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"openrouter": {
"npm": "@openrouter/ai-sdk-provider",
"name": "OpenRouter",
"options": {},
"models": {
"mistralai/devstral-medium": {
"name": "Mistral: Devstral Medium"
},
"mistralai/devstral-small": {
"name": "Mistral: Devstral Small 1.1"
},
"inception/mercury": {
"name": "Inception: Mercury"
}
}
}
}
}
Still having this issue after removing config.json and clearing cache/opencode.
same issue on my side
@openrouter/ai-sdk-provider does not work with ai sdk v5 which we use. remove the npm field you don't need it. also we added devstral to models.dev so you can probably get rid of the whole config
Removing the config do not solve the issue for me.
@openrouter/ai-sdk-provider does not work with ai sdk v5 which we use. remove the
npmfield you don't need it. also we added devstral to models.dev so you can probably get rid of the whole config
Is it only available via the Mistral provider?
Edit: nvm, I use this setup for Devstral Openrouter and it works
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"openrouter": {
"name": "OpenRouter",
"options": {},
"models": {
"mistralai/devstral-medium": {
"name": "Devstral Medium",
"attachment": false,
"reasoning": false,
"temperature": true,
"tool_call": true,
"release_date": "2025-07-10",
"cost": { "input": 0.4, "output": 2 },
"limit": { "context": 128000, "output": 128000 }
},
"mistralai/devstral-small": {
"name": "Devstral Small",
"attachment": false,
"reasoning": false,
"temperature": true,
"tool_call": true,
"release_date": "2025-05-07",
"cost": { "input": 0.1, "output": 0.3 },
"limit": { "context": 128000, "output": 128000 }
}
}
}
}
}