Skip to content

Wire up OpenCode

  1. Edit opencode.jsonc

    Open ~/.config/opencode/opencode.jsonc (Windows: %AppData%\opencode\opencode.jsonc). For each provider you want compressed:

    {
    "$schema": "https://opencode.ai/config.json",
    "provider": {
    "openai": {
    "options": {
    "baseURL": "http://127.0.0.1:17322",
    "headers": {
    "cmx-provider": "openai",
    "cmx-harness": "opencode"
    }
    }
    }
    }
    }

    Copy the same options block into any other provider entry (moonshotai, github-copilot, …) — just change cmx-provider to match the provider key.

  2. Make sure the provider exists in cmx config

    ~/.config/cmx/config.json:

    {
    "providers": {
    "openai": { "base_url": "https://api.openai.com/v1" }
    }
    }

    openai, anthropic, openrouter, groq, deepseek, moonshot and zai are preconfigured. Add your own with any OpenAI-compatible or Anthropic-compatible base URL.

  3. Restart and verify

    Terminal window
    cmx restart # pick up config changes

    Start a session in OpenCode, then:

    Terminal window
    cmx status # should show your provider + session

    Sessions are attributed via OpenCode’s session header; each one gets its own ledger, summaries and stats in the dashboard.

See Other harnesses — the pattern is identical: point baseURL at the gateway, send the two cmx-* headers, optionally add a session ID header so requests group into sessions.