Skip to content
Ruvicode logo
Ruvicode
USD
All integrations

Terminal coding agent

How to Use Ruvicode with OpenCode

OpenCode talks to any OpenAI-compatible API through a custom provider in opencode.json. This guide adds Ruvicode as that provider, keeps your key out of the file, and gives you a working model list for agent work.

Tested on November 3, 2026. OpenCode 1.18.34 on Windows read a file, fixed a bug in it and replied, through api.ruvicode.com with the config below.

Set up OpenCode

Base URL

https://api.ruvicode.com/v1

API key

rvcd_...

  1. 1Create an API key in the Ruvicode dashboard and export it as RUVICODE_API_KEY in your shell profile.
  2. 2Create opencode.json in your project root, or ~/.config/opencode/opencode.json to use it in every project.
  3. 3Paste the provider block below. List every model you want to use under models: OpenCode does not fetch the model list of a custom provider.
  4. 4Start OpenCode, run /models and pick a Ruvicode model, or run opencode run -m ruvicode/glm-5.3-flash "your task" for a one-off task.
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "ruvicode": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Ruvicode",
      "options": {
        "baseURL": "https://api.ruvicode.com/v1",
        "apiKey": "{env:RUVICODE_API_KEY}"
      },
      "models": {
        "glm-5.3-flash": { "name": "GLM 5.3 Flash", "limit": { "context": 1000000, "output": 128000 } },
        "kimi-k2.7-code": { "name": "Kimi K2.7 Code", "limit": { "context": 256000, "output": 128000 } },
        "claude-sonnet-5.5": {
          "name": "Claude Sonnet 5.5",
          "limit": { "context": 1000000, "output": 128000 },
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        }
      }
    }
  },
  "model": "ruvicode/glm-5.3-flash"
}
export RUVICODE_API_KEY=rvcd_...
opencode run -m ruvicode/glm-5.3-flash "Fix the failing test in src/"

Good to know

  • {env:RUVICODE_API_KEY} makes OpenCode read the key from the environment, so opencode.json can be committed without the secret.
  • The limit values tell OpenCode when to compact the conversation. Take them from the context and max output shown on each model page, or from GET /v1/models, which returns context_length and max_completion_tokens for every model.
  • Add the modalities block only to models that accept images. Without it OpenCode refuses image attachments itself, before any request is sent.

Models for coding agents

These models completed streamed tool calls through Ruvicode on November 3, 2026. Every model in the catalog works with the same base URL and key; each model page shows its live rate, context window and max output.

Common errors

401 Invalid API key
The key is mistyped, revoked or not a Ruvicode key. Copy it again from the dashboard; it starts with rvcd_.
404 Model not found
The model id is not in the catalog. Use an id exactly as listed on the models page or by GET /v1/models. A plain 404 page instead of a JSON error means the base URL is missing /v1.
402 insufficient_balance
The wallet cannot cover the request. Top up in the dashboard; the balance never expires.
429 rate limit
Too many requests per minute, on the key or across the account. Agents that fire many calls in parallel can hit it; most tools retry on their own after a short wait.

OpenCode with Ruvicode: FAQ

Why does my Ruvicode model not show up in /models?
OpenCode only lists the models you put under provider.ruvicode.models in opencode.json. Add the model id exactly as it appears in the Ruvicode catalog, then restart OpenCode.
Can I attach screenshots in OpenCode?
Yes, with a vision model such as Claude Sonnet 5.5, once its entry has "modalities": { "input": ["text", "image"], "output": ["text"] }. Models without that block reject images in OpenCode even when the API would accept them.
Where do I get a Ruvicode API key?
Create an account, top up your wallet with QRIS or USDC, then open API Keys in the dashboard and create a key. Keys start with rvcd_. You can set a daily or monthly spend limit per key and restrict a key to a list of models.