tencent cloud

문서大模型服务平台 TokenHub

OpenCode

다운로드
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-08-07 11:45:07
AI 번역
OpenCode is an open-source AI programming agent tool that provides multiple usage methods, including a terminal interface, desktop applications, and IDE extensions. This document describes how to configure and use the Tencent Cloud Large Language Model Enterprise Token Plan in OpenCode.

Prerequisites

Before you start the configuration, ensure that you have completed the following preparations:

Configuring Token Plan Enterprise Edition

Modify the OpenCode configuration file according to the example below. The configuration file path is as follows. If the configuration file does not exist, create it.
macOS / Linux:~/.config/opencode/opencode.json.
Windows: C:\\Users\\<username>\\.config\\opencode\\opencode.json.
Note:
Replace <USER_API_KEY> in the code with your API Key. The model list is pre-filled in the configuration below based on plan and region. Select the configuration that corresponds to the plan you purchased and the region you enabled.
For model access addresses of different plans and regions, see Access Address.
Pro Plan (Guangzhou)
Pro Plan (Singapore)
Lite Plan (Guangzhou)
Lite Plan (Singapore)
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"myprovider": {
"npm": "@ai-sdk/openai-compatible",
"name": "Tencent Cloud",
"options": {
"baseURL": "https://tokenhub.tencentcloudmaas.com/plan/v3",
"apiKey": "<USER_API_KEY>"
},
"models": {
"auto": {
"name": "Auto",
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"options": {
"thinking": {
"type": "enabled"
}
}
},
"glm-5.2": {
"name": "GLM-5.2",
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"options": {
"thinking": {
"type": "enabled"
}
}
},
"minimax-m3": {
"name": "MiniMax-M3",
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"options": {
"thinking": {
"type": "enabled"
}
}
},
"kimi-k2.7-code": {
"name": "Kimi K2.7 Code",
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"options": {
"thinking": {
"type": "enabled"
}
}
},
"kimi-k2.7-code-highspeed": {
"name": "Kimi K2.7 Code HighSpeed",
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"options": {
"thinking": {
"type": "enabled"
}
}
},
"deepseek-v4-flash": {
"name": "DeepSeek-V4-Flash",
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"options": {
"thinking": {
"type": "enabled"
}
}
},
"deepseek-v4-pro": {
"name": "DeepSeek-V4-Pro",
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"options": {
"thinking": {
"type": "enabled"
}
}
},
"deepseek-v4-flash-202605": {
"name": "DeepSeek-V4-Flash Vendor Direct",
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"options": {
"thinking": {
"type": "enabled"
}
}
},
"deepseek-v4-pro-202606": {
"name": "DeepSeek-V4-Pro Vendor Direct",
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"options": {
"thinking": {
"type": "enabled"
}
}
}
}
}
}
}

"$schema": "https://opencode.ai/config.json",
"provider": {
"myprovider": {
"npm": "@ai-sdk/openai-compatible",
"name": "Tencent Cloud",
"options": {
"baseURL": "https://tokenhub-intl.tencentcloudmaas.com/plan/v3",
"apiKey": "<USER_API_KEY>"
},
"models": {
"auto": {
"name": "Auto",
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"options": {
"thinking": {
"type": "enabled"
}
}
},
"glm-5.2": {
"name": "GLM-5.2",
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"options": {
"thinking": {
"type": "enabled"
}
}
},
"minimax-m3": {
"name": "MiniMax-M3",
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"options": {
"thinking": {
"type": "enabled"
}
}
},
"kimi-k2.7-code": {
"name": "Kimi K2.7 Code",
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"options": {
"thinking": {
"type": "enabled"
}
}
},
"kimi-k2.7-code-highspeed": {
"name": "Kimi K2.7 Code HighSpeed",
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"options": {
"thinking": {
"type": "enabled"
}
}
},
"deepseek-v4-flash": {
"name": "DeepSeek-V4-Flash",
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"options": {
"thinking": {
"type": "enabled"
}
}
},
"deepseek-v4-pro": {
"name": "DeepSeek-V4-Pro",
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"options": {
"thinking": {
"type": "enabled"
}
}
},
"deepseek-v4-flash-202605": {
"name": "DeepSeek-V4-Flash Vendor Direct",
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"options": {
"thinking": {
"type": "enabled"
}
}
},
"deepseek-v4-pro-202606": {
"name": "DeepSeek-V4-Pro Vendor Direct",
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"options": {
"thinking": {
"type": "enabled"
}
}
}
}
}
}
}
e{
"$schema": "https://opencode.ai/config.json",
"provider": {
"myprovider": {
"npm": "@ai-sdk/openai-compatible",
"name": "Tencent Cloud",
"options": {
"baseURL": "https://tokenhub.tencentcloudmaas.com/plan/v3",
"apiKey": "<USER_API_KEY>"
},
"models": {
"auto": {
"name": "Auto",
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"options": {
"thinking": {
"type": "enabled"
}
}
}
}
}
}
}
e{
"$schema": "https://opencode.ai/config.json",
"provider": {
"myprovider": {
"npm": "@ai-sdk/openai-compatible",
"name": "Tencent Cloud",
"options": {
"baseURL": "https://tokenhub-intl.tencentcloudmaas.com/plan/v3",
"apiKey": "<USER_API_KEY>"
},
"models": {
"auto": {
"name": "Auto",
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"options": {
"thinking": {
"type": "enabled"
}
}
}
}
}
}
}

Using OpenCode

Run the following command to start OpenCode:
opencode
Enter /models, select the configured model, and use it in OpenCode.



도움말 및 지원

문제 해결에 도움이 되었나요?

피드백