Guys,
Is this correct - Opencode v2.x for using OpenRouter ?
{
"$schema": "https://opencode.ai/config.json",
"autoupdate": false,
"default_agent": "plan",
"model": "openrouter/deepseek/deepseek-v4.1-flash-1017",
// New - Enables background keep-alive requests in OpenCode v2 to preserve server prompt cache
"warming": true,
// Modified - Renamed singular 'provider' to plural 'providers' for OpenCode v2 schema
"providers": {
"openrouter": {
// Modified - Renamed 'npm' key to 'package' for OpenCode v2 adapter definitions
"package": "@ai-sdk/openai-compatible",
"name": "OpenRouter",
// Modified - Renamed provider configuration block from 'options' to 'settings' in v2
"settings": {
"baseURL": "https://openrouter.ai/api/v1",
"apiKey": "sk-or-v1-mykey"
},
"models": {
"deepseek/deepseek-v4.1-flash-1017": {
"name": "DeepSeek V4.1 Flash-1017",
"tool_call": true,
"reasoning": true,
"temperature": true,
"attachment": true,
"modalities": {
"input": ["text"],
"output": ["text"]
},
"limit": {
"context": 1048576,
"output": 393216
},
"options": {
"reasoningEffort": "high",
"provider": {
"only": ["streamlake/fp8"],
"allow_fallbacks": false
}
}
}
}
}
}
}
There is just way too many snippets floating around , v1, v2 etc.