OpenCode
Set up OpenCode to use Modelway.
Get your Modelway key
Sign in, open API keys and click Create key. Copy it right away: it’s shown once. New to Modelway? Start with getting access.
Install OpenCode
In PowerShell, with Scoop:
scoop install opencode
With Chocolatey, or npm if you have Node.js:
1choco install opencode2npm install -g opencode-ai
OpenCode also recommends running it inside WSL, where you follow the Linux steps.
Point it at Modelway
OpenCode reads its global config from %USERPROFILE%\.config\opencode\opencode.json. Create the folder if it doesn’t exist yet, then open the file in an editor:
1New-Item -ItemType Directory -Force "$env:USERPROFILE\.config\opencode"2notepad "$env:USERPROFILE\.config\opencode\opencode.json"
Paste this in, with your key in place of the placeholder:
1{2 "model": "modelway/claude-sonnet-5",3 "provider": {4 "modelway": {5 "npm": "@ai-sdk/anthropic",6 "options": {"baseURL": "https://modelway.vip/v1", "apiKey": "<your Modelway API key>"},7 "models": {8 "claude-sonnet-5": {"attachment": true, "reasoning": true, "limit": {"context": 1000000, "output": 64000}}9 }10 }11 }12}
Start OpenCode
Open a terminal in a project folder and run:
opencode
It starts on the model in model. Switch with /models.
FAQ
How do I add more models?
Add each model id from the catalog under models, next to the one that’s there. Set model to query/<id> to start on it.
How do I update?
Run opencode upgrade, or update it with the package manager you installed it with.