OpenCode Configuration#
OpenCode is an open-source terminal AI coding tool — an open-source alternative similar to Claude Code. By connecting through Tokenhot, you can use any model.Configuration Steps#
1. Install OpenCode#
# macOS / Linux
curl -fsSL https://opencode.ai/install | bash
# Or install via Go
go install github.com/opencode-ai/opencode@latest
# Using Node.js
npm install -g opencode-ai
OpenCode supports multiple provider configurations. The OpenAI-compatible mode is recommended:# OpenAI Compatible Mode
export OPENAI_API_KEY=<your TOKENHOT_API_KEY>
export OPENAI_BASE_URL=https://api.tokenhot.ai/v1
3. Configuration File#
You can also configure via OpenCode's config file:
Windows: %USERPROFILE%.config\opencode\opencode.json
macOS/Linux: ~/.config/opencode/opencode.json[providers.Tokenhot]
{
"$schema": "https://opencode.ai/config.json",
"model": "tokenhot/gpt-5.4",
"provider": {
"tokenhot": {
"npm": "@ai-sdk/openai",
"models": {
"gpt-5.4": {
"id": "gpt-5.4",
"name": "gpt-5.4"
},
"deepseek-v4-pro":{
"id":"deepseek-v4-pro",
"name":"deepseek-v4-pro"
},
},
"options": {
"apiKey": "[TOKENHOT_API_KEY]",
"baseURL": "https://api.tokenhot.ai/v1"
}
}
}
}
4. Verify#
Recommended Models#
For recommended models, please refer to the Model Plaza.Modified at 2026-05-29 02:58:02