Coding agent CLI-installable

OpenCode

Open-source coding, open-weight models.

Open-source terminal coding agent. Open source on top, open weights underneath, routed through Melious.

opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "model": "melious/<MODEL_ID>",
  "small_model": "melious/<SMALL_MODEL_ID>",
  "provider": {
    "melious": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Melious",
      "options": {
        "baseURL": "https://api.melious.ai/v1",
        "apiKey": "{env:MELIOUS_API_KEY}"
      },
      "models": {
        "<MODEL_ID>": {
          "name": "<Display Name>",
          "limit": { "context": 128000, "output": 16384 }
        }
      }
    }
  }
}
About

What is OpenCode?

OpenCode is an open-source terminal coding agent from the team behind SST. Model-agnostic, configured through a plain JSON file, and disciplined about tokens. Short prompts, minimal scratchpad chatter, no auto-summarization until it matters. Paired with Melious eco routing it's the cheapest way we've found to do serious agent work.

Visit the official site opencode.ai
Setup

How to use OpenCode with Melious?

  1. Install OpenCode

    Run the official installer. macOS and Linux pull a small shell script. Windows uses npm.

    Shell
    # macOS / Linux
    curl -fsSL https://opencode.ai/install | bash
    
    # Windows (requires Node.js)
    npm install -g opencode-ai
  2. Add Melious as a provider

    Create opencode.json in your project (or ~/.config/opencode/config.json for a global default). The models map is not auto-discovered from /v1/models. Add one entry per model you plan to use, or let the Melious CLI write the file for you on each launch. Browse melious.ai/hub/models for current IDs and context windows.

    opencode.json
    {
      "$schema": "https://opencode.ai/config.json",
      "model": "melious/<MODEL_ID>",
      "small_model": "melious/<SMALL_MODEL_ID>",
      "provider": {
        "melious": {
          "npm": "@ai-sdk/openai-compatible",
          "name": "Melious",
          "options": {
            "baseURL": "https://api.melious.ai/v1",
            "apiKey": "{env:MELIOUS_API_KEY}"
          },
          "models": {
            "<MODEL_ID>": {
              "name": "<Display Name>",
              "limit": { "context": 128000, "output": 16384 }
            }
          }
        }
      }
    }
  3. Run OpenCode

    Export your Melious key, then launch. Every model is namespaced as melious/<MODEL_ID>.

    Shell
    export MELIOUS_API_KEY=sk-mel-<YOUR_API_KEY>
    opencode
Ready?

Three steps from here.

Grab a Melious key. Pick your tool. Follow the guide. Same client, now answering from Europe.