Skip to main content
OpenCode works best when you define a dedicated provider block and keep the routed model path explicit.

OS notes

  • macOS and Linux: Use your normal shell and keep the JSON config exactly as shown
  • Windows: Use the same JSON config and paste it through the Windows app or PowerShell-based workflow your install exposes
  • WSL: If OpenCode runs inside WSL, follow the Linux conventions from inside WSL

Example config

Add a provider block like this to your OpenCode config:

What to verify

  1. The provider name and the model prefix line up
  2. baseURL includes /v1
  3. Each OpenCode model alias maps to the routed model you want upstream
If you rename the provider block, update the leading segment in the model field to match.