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://sacredgpt.pro/v1Key: $SACREDGPT_KEYOpenAI-compatible

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.

3

3. Pick a model

In OpenCode open providers, choose SacredGPT, then a model such as sacredai-heretic.

03 — Configuration Example

ConfigFile Example

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "sacredgpt": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "SacredGPT",
      "options": {
        "baseURL": "https://sacredgpt.pro/v1",
        "apiKey": "{env:SACREDGPT_API_KEY}"
      },
      "models": {
        "sacredai-heretic": { "name": "SacredAI Heretic" }
      }
    }
  }
}

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.

Direct line

Found a bug? Show us.

Tell us what happened and what you expected. The page address and browser details help us reproduce it faster.