When to use this
Use this guide if you want:
- OpenCode to switch between DeepSeek, MiMo, OpenAI, Kimi, GLM, DashScope, or another provider from one local UI.
- The
agentgate virtual model to resolve to the currently selected route model.
- OpenCode requests to appear in the same request logs and cost dashboard as Codex and Claude Code.
- One-click restore if you want to go back to the previous OpenCode config.
Quick Setup
- Download MuxLayer from Releases and open the app.
- Add at least one provider in Quick Setup or Providers.
- Start the gateway from Overview or Gateway.
- Open Clients and click Apply Config on the OpenCode card.
- Send a test prompt from OpenCode.
- Check MuxLayer Logs to confirm the OpenCode client, selected provider, model, and route.
What MuxLayer configures
| OpenCode side |
MuxLayer side |
Provider side |
| OpenAI-compatible endpoint |
/v1/chat/completions local gateway route |
Chat-compatible upstream |
openai/agentgate virtual model |
Route-selected real model |
Provider-specific model ID |
| Client config |
Snapshot before write |
One-click restore from MuxLayer |
Troubleshooting
| Symptom |
Check |
| OpenCode keeps using the old model |
Apply the OpenCode config again and restart OpenCode if needed. |
| The provider rejects the model |
Check Model Mapping and the provider default model. |
| Requests do not show in logs |
Confirm OpenCode is using 127.0.0.1:9090 as its base URL. |
| You changed providers but OpenCode still sends an old model name |
Use the agentgate virtual model path rather than hardcoding a provider model. |
Related