Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.ruoli.dev/llms.txt

Use this file to discover all available pages before exploring further.

OpenCode is an open-source AI coding agent that supports 75+ model providers.

Installation

curl -fsSL https://opencode.ai/install | bash
Or via npm / Homebrew:
npm install -g opencode-ai@latest
# or
brew install anomalyco/tap/opencode
Open CC Switch and add a RuoLi configuration:
FieldValue
API URLhttps://ruoli.dev/v1
API KeyYour Key
Select OpenCode and click Apply.

Manual Configuration

Create opencode.json:
{
  "$schema": "https://opencode.ai/config.json",
  "model": "claude-sonnet-4-20250514",
  "provider": {
    "ruoli": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "RuoLi",
      "options": {
        "baseURL": "https://ruoli.dev/v1",
        "apiKey": "{env:RUOLI_API_KEY}"
      },
      "models": {
        "claude-sonnet-4-20250514": {
          "name": "Claude Sonnet 4",
          "limit": { "context": 200000 }
        },
        "gpt-4o": {
          "name": "GPT-4o",
          "limit": { "context": 128000 }
        }
      }
    }
  }
}
Set the environment variable:
export RUOLI_API_KEY=sk-YOUR-KEY

Switch Models

Change the model field in opencode.json to switch models. Add the models you need to the models section in the config file. You can also switch in CC Switch.
Official Documentation: opencode.ai