Opencode Configuration

Official guide: https://opencode.ai/v2/docs

CLI Version

Linux & macOS

curl -fsSL https://opencode.ai/v2/install | bash
opencode
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "elettragateway": {
      "name": "ElettraGateway",
      "npm": "@ai-sdk/openai-compatible",
      "options": {
        "baseURL": "https://llm-api-gw.elettra.eu/v1",
        "apiKey": "sk_ePkBU....." //insert your apiKey
      },
      "models": {
        "balanced": {
          "name": "balanced",
          "limit": {
            "context": 262144,
            "input": 262144,
            "output": 100000
          },
          "modalities": {
            "input": ["text", "image"]
          }
        },
        "top": {
          "name": "top",
          "limit": {
            "context": 1000000,
            "input": 1000000,
            "output": 100000
          },
          "modalities": {
            "input": ["text", "image"]
          }
        },
        "fast": {
          "name": "fast",
          "limit": {
            "context": 131000,
            "input": 131000,
            "output": 100000
          }
        }
      }
    }
  }
}

Windows

We suggest you use the Windows Subsystem for Linux (WSL)
After activating it, use the same procedure as described in Linux & macOS to install and use it!

DESKTOP Version

Tutorial: https://kb.elettra.eu/books/scientific-and-quantum-computing/page/opencode-desktop-configuration



Revision #8
Created 2026-10-23 08:34:37 UTC by Matteo Bille`
Updated 2026-10-30 08:55:42 UTC by Matteo Bille`