OpenCode
Connect OpenCode to ShuYou and access Claude, GPT, and Gemini models from one terminal UI.
Prerequisites
- A modern terminal (Windows Terminal, iTerm2, etc.).
- A ShuYou API key from the console.
Step 1: Install OpenCode
Or: brew install anomalyco/tap/opencode
Register a custom provider:
- Select other in the provider list.
- Provider ID:
shuyou-anthropic (repeat for shuyou-openai / shuyou-google if needed).
- Token: any placeholder (the real key goes in
opencode.json).
Edit ~/.config/opencode/opencode.json (Windows: %USERPROFILE%\.config\opencode\opencode.json):
Replace YOUR_SHUYOU_API_KEY and add model slugs from the ShuYou model catalog.
Step 3: Verify
In the TUI, run /models and select a ShuYou provider model.
FAQ
401 / 403: Check apiKey in opencode.json and model slugs on ShuYou.
Config path: ~/.config/opencode/opencode.json (Windows: %USERPROFILE%\.config\opencode\).
Switch models: Use /models inside OpenCode.
Use OpenCode only in project folders you trust. Validate JSON syntax before saving.