Configuration file

Use ~/.config/opencode/opencode.json or opencode.jsonc. Create the file if it does not exist, or configure the key with OpenCode's /connect command.

json
{
  "provider": {
    "openai": {
      "options": {
        "baseURL": "https://milorouter.com/v1",
        "apiKey": "YOUR_MILOROUTER_API_KEY"
      }
    }
  }
}

Model configuration

The Use Key dialog generates OpenCode model examples and reasoning variants. Prefer the latest configuration generated by the dashboard.