tencent cloud

OpenCode

Download
Modo Foco
Tamanho da Fonte
Última atualização: 2026-07-23 15:08:38
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.



Ajuda e Suporte

Esta página foi útil?

comentários