diff --git a/README.md b/README.md index 873c23a49a..ac9fd9fb00 100644 --- a/README.md +++ b/README.md @@ -1095,6 +1095,47 @@ Settings → API Configuration: Model: if/kimi-k2-thinking ``` +### OpenCode + +**Step 1:** Add OmniRoute as a custom provider: + +```bash +opencode +/connect +# Select "Other" → Enter ID: "omniroute" → Enter your OmniRoute API key +``` + +**Step 2:** Create/edit `opencode.json` in your project root: + +```json +{ + "$schema": "https://opencode.ai/config.json", + "provider": { + "omniroute": { + "npm": "@ai-sdk/openai-compatible", + "name": "OmniRoute", + "options": { + "baseURL": "http://localhost:20128/v1" + }, + "models": { + "cc/claude-sonnet-4-20250514": { "name": "Claude Sonnet 4" }, + "gg/gemini-2.5-pro": { "name": "Gemini 2.5 Pro" }, + "if/kimi-k2-thinking": { "name": "Kimi K2 (Free)" } + } + } + } +} +``` + +**Step 3:** Select the model in OpenCode: + +```bash +/models +# Select any OmniRoute model from the list +``` + +> **Tip:** Add any model available in your OmniRoute `/v1/models` endpoint to the `models` section. Use the format `provider/model-id` from your OmniRoute dashboard. + ---