tencent cloud

문서大模型服务平台 TokenHub

OpenCode

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

Prerequisites

Before starting the configuration, make sure you have completed the following preparatory work:
3. Install OpenCode:
3.1. Run the following command to install OpenCode. For more operations, refer to the OpenCode Official Configuration Guide.
npm install -g opencode-ai
3.2. After installation is complete, you can run the following command to check. If the version number is output, it indicates that the installation was successful.
opencode -v

Model Configuration

1. 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 $your_api_key with the API Key exclusive to the Token Plan.
2. Copy and paste the following configuration into the opencode.json file and save it.
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"myprovider": {
"npm": "@ai-sdk/openai-compatible",
"name": "Token Plan",
"options": {
"baseURL": "https://tokenhub-intl.tencentcloudmaas.com/plan/v3",
"apiKey": "$your_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"
}
}
},
"kimi-k2.6": {
"name": "Kimi-K2.6",
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"options": {
"thinking": {
"type": "enabled"
}
}
},
"minimax-m3": {
"name": "MiniMax-M3",
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"options": {
"thinking": {
"type": "enabled"
}
}
},
"deepseek-v4-flash-202605": {
"name": "DeepSeek-V4-Flash Direct from Manufacturer",
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"options": {
"thinking": {
"type": "enabled"
}
}
},
"deepseek-v4-pro-202606": {
"name": "DeepSeek-V4-Pro Direct from Manufacturer",
"modalities": {
"input": [
"text"
],
"output": [
"text"
]
},
"options": {
"thinking": {
"type": "enabled"
}
}
}
}
}
}
}

Use OpenCode

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


도움말 및 지원

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

피드백