Fan-out: Plus login, jsonc fields, compatible gateways, whether switching mid-session rewrites config.
Official OpenAI via /connect#
Start OpenCode, run /connect, choose OpenAI. Plus/Pro can authenticate in a browser; API billing uses a pasted key. Then /models lists openai/ prefixed ids.
Pin a default model#
Project or user opencode.jsonc may set model as provider/model, e.g. openai/gpt-5.6-sol. CLI --model wins. An open session keeps its own selection; editing jsonc does not rewrite old threads.
{
"$schema": "https://opencode.ai/config.json",
"model": "openai/gpt-5.6-sol",
"provider": {
"openai": {
"models": {
"gpt-5.6-sol": {
"options": {
"reasoningEffort": "medium"
}
}
}
}
}
}OpenAI-compatible gateways#
For a self-hosted /v1 endpoint, declare a custom provider id, baseURL, and compatible runtime. Model keys must be the gateway’s real ids. Official api.openai.com usually needs no compatible block.
What to pick in September 2026#
- Repo-scale refactors and computer use: openai/gpt-6-astra.
- Daily edits and tests: openai/gpt-5.6-sol or terra.
- High-volume easy completion: luna or a smaller coding SKU.
Takeaways#
- /connect first, then pin the default in jsonc.
- IDs are always provider/model.
- Keys stay in the environment; only gateways set baseURL.