Home / Agents / OpenCode

OpenCode

Open-source AI coding agent built for the terminal

OpenCode (SST) OpenAI-compatible macOSLinuxWindows

OpenCode is an open-source AI coding agent for the terminal, built on the AI SDK and Models.dev with 75+ providers plus local models. It offers a TUI, a scriptable CLI and IDE integration, and lets engineers point any provider at a custom OpenAI-compatible endpoint.

Base URL (root)https://quantoport.comPut this in each tool's base_url or *_BASE_URL setting.
OpenAI-compatible pathhttps://quantoport.com/v1Append /v1 for anything speaking the OpenAI wire (/v1/chat/completions).
Recommended modelsdeepseek-v4.1-flashclaude-sonnet-5glm-5.3Names published in our own catalogue — confirm the live list for your key with GET /v1/models.

Skip it — one-line setup

The script installs OpenCode from its official source, writes the gateway settings into the tool's own config file (backing up any existing one) and runs a live check. It asks for your gateway key, or take it from --key / --key-file. --uninstall restores exactly what it wrote.

shell
curl -fsSL https://quantoport.com/agents/opencode/setup | bash

1 · Install

Install OpenCode from its own official source.

install
curl -fsSL https://opencode.ai/install | bash   # macOS/Linux; cross-platform: npm install -g opencode-ai

2 · Configure — point it at QuantoPort

Gateway base URL https://quantoport.com; get your key from the console.

config
1) In the TUI run /connect, scroll to Other, enter a provider id (e.g. quantoport) and your API key (stored in ~/.local/share/opencode/auth.json).
2) Add the provider in opencode.json (project root) or the global ~/.config/opencode/opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "quantoport": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "QuantoPort",
      "options": { "baseURL": "https://quantoport.com/v1" },
      "models": { "<model-id>": { "name": "<Model name>" } }
    }
  }
}

On the China endpoint set options.baseURL to https://api.shinlinkai.com/v1 (OpenAI wire only).
3) Run /models and pick the model.

3 · Verify

One request proves you are on our channel.

verify
opencode run "reply with OK"      # or opencode auth list to inspect credentials

4 · Common pitfalls

  • baseURL must include the /v1 version segment.
  • Use npm @ai-sdk/openai-compatible (drives /v1/chat/completions); use @ai-sdk/openai only if the gateway speaks /v1/responses.
  • The global ~/.config/opencode/opencode.json and the project opencode.json are merged; later sources override conflicting keys. OPENCODE_CONFIG can point at a custom config.
  • opencode auth login is equivalent to /connect; credentials live in ~/.local/share/opencode/auth.json.

Sources for the tool-side steps: opencode.ai/docs/providers/ opencode.ai/docs/config/ opencode.ai/docs/cli/ opencode.ai/docs/