# macOS / Linux
curl -fsSL https://opencode.ai/install | bash
# 或使用 Go 安装
go install github.com/opencode-ai/opencode@latest
# 有node.js环境
npm install -g opencode-ai# OpenAI 兼容模式
export OPENAI_API_KEY=<你的 TOKENHOT_API_KEY>
export OPENAI_BASE_URL=https://api.tokenhot.ai/v1[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"
}
}
}
}OpenCode 的具体配置方式可能随版本更新变化,请参考 OpenCode 官方文档。