OpenCode Setup Guide
About third-party compatibility
Any third-party client involves many compatibility differences when integrating with an official API. This guide only demonstrates the basic setup — it cannot guarantee that every model / agent runs flawlessly with zero errors. If a particular model or feature turns out to be incompatible, that's normal; try switching models or adjust per the official docs.
We recommend using each model in its own official product when possible.
1. Open the config directory
OpenCode's config directory is .config/opencode in your home directory, and the config file is opencode.json. Open it according to your OS:
Press Win + R, enter the following and hit Enter:
%userprofile%\.config\opencodeopen ~/.config/opencodecd ~/.config/opencodeYou'll see the directory contents. If there's no opencode.json, create it manually and open it.
2. Edit opencode.json
Write the following into opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"cctq-codex": {
"models": {
"gpt-5.6-sol": {
"name": "gpt-5.6-sol",
"options": {
"reasoningEffort": "xhigh"
}
}
},
"npm": "@ai-sdk/openai",
"options": {
"apiKey": "sk-***",
"baseURL": "https://www.cctq.ai/v1",
"setCacheKey": true
}
}
}
}cctq-codex: the provider ID — customizable (lowercase letters, digits, hyphens only).baseURL: the relay request URL — set it tohttps://www.cctq.ai/v1(must end with/v1).apiKey: your token — replacesk-***with your actual key.models: the models to use — the key is the model ID,nameis the display name.reasoningEffort: reasoning effort (thinking depth) — one oflow/medium/high/xhigh. Higher values make the model think more thoroughly and usually give better results, but respond slower and cost more;xhighis the highest.setCacheKey: enables caching — keep ittrue.
Save, reopen the terminal, and run opencode to start.
