Back to Harness Catalog
Terminal / Desktop Agent

OpenCode Integration Guide

Open-source coding agent for terminal and desktop. Connect SacredGPT as a custom OpenAI-compatible provider.

Base URL: https://api.sacredgpt.ru/v1Key: $SACREDGPT_KEYVerified

01 — Version & UI Path

Version Specifics & Navigation

Version Compatibility Note: Verified on OpenCode v1.18.13+ (opencode.json → provider → @ai-sdk/openai-compatible).

02 — Step-by-Step Setup

Step-by-Step Setup

1

1. Install OpenCode

Install the latest build via npm or brew, then create an API key in SacredGPT.

1. Install OpenCode
npm i -g opencode-ai@latest
# or: brew install anomalyco/tap/opencode
2

2. Add the SacredGPT provider

opencode.json

In opencode.json define a custom provider using @ai-sdk/openai-compatible and the SacredGPT baseURL.

2. Add the SacredGPT provider
3

3. Pick a model

In OpenCode open providers, choose SacredGPT, then a model such as gpt-5.6-sol or qwen-3.8-max.

3. Pick a model

03 — Configuration Example

ConfigFile Example

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "sacredgpt": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "SacredGPT",
      "options": {
        "baseURL": "https://api.sacredgpt.ru/v1",
        "apiKey": "{env:SACREDGPT_API_KEY}"
      },
      "models": {
        "gpt-5.6-sol": { "name": "GPT 5.6 Sol" },
        "claude-sonnet-5": { "name": "Claude Sonnet 5" },
        "qwen-3.8-max": { "name": "Qwen 3.8 Max" },
        "minimax-m3": { "name": "MiniMax M3" },
        "deepseek-v4-pro": { "name": "DeepSeek V4 Pro" }
      }
    }
  }
}

04 — Troubleshooting

Troubleshooting & Common Issues

Provider missing from the list

Confirm opencode.json is in the project root or ~/.config/opencode/, then restart OpenCode.

401 Unauthorized

Export SACREDGPT_API_KEY=sgpt_live_… or set apiKey directly. Live keys require 2FA.