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
| Item | Value |
|---|---|
| OpenAI-compatible endpoint | https://ai.hctopup.com/v1 |
| Provider ID | hcai |
| Example model | gpt-5.5 |
| API Key | Use the Key created in HCAI |
Store Credential
Recommended terminal flow:
sh
opencode auth loginChoose a custom or Other Provider, then enter this Provider ID:
txt
hcaiPaste 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
opencodeInside the TUI, run:
txt
/modelsConfirm that the HCAI provider and configured model appear in the list.