Skip to content

OpenCode: Manual Configuration

OpenCode can connect to HCAI through a custom OpenAI-compatible provider. The gpt-5.5 value below is only a model-name placeholder; replace it with a model available to your key group.

Access Information

ItemValue
OpenAI-compatible endpointhttps://ai.hctopup.com/v1
Provider IDhcai
Example modelgpt-5.5
API KeyUse the Key created in HCAI

Store Credential

Recommended terminal flow:

sh
opencode auth login

Choose a custom or Other Provider, then enter this Provider ID:

txt
hcai

Paste your HCAI Key when prompted.

If you need to write the credential manually, create ~/.local/share/opencode/auth.json:

json
{
  "hcai": {
    "type": "api",
    "key": "Replace with your HCAI Key"
  }
}

Configure Provider

Create opencode.json in the project root, or create the global file ~/.config/opencode/opencode.json:

json
{
  "$schema": "https://opencode.ai/config.json",
  "model": "hcai/gpt-5.5",
  "provider": {
    "hcai": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "HCAI",
      "options": {
        "baseURL": "https://ai.hctopup.com/v1"
      },
      "models": {
        "gpt-5.5": {
          "name": "gpt-5.5"
        }
      }
    }
  }
}

Start OpenCode

sh
cd /path/to/your/project
opencode

Inside the TUI, run:

txt
/models

Confirm that the HCAI provider and configured model appear in the list.

Next Steps