CodeBuddy Code can connect to Tencent Cloud TokenHub through models.json. Tencent Cloud's CodeBuddy Code setup page uses Hy3 as its example; this article changes the model ID to hy4 while following that page's configuration structure. The TokenHub Hunyuan calling guide confirms that Hy4 supports the OpenAI Chat Completions, Responses, and Anthropic Messages protocols. This configuration is adapted from two official documents; Tencent Cloud has not published it as a Hy4-specific configuration, and it has not been tested.
Suitable tasks: Using TokenHub Hy4 in CodeBuddy Code to help read, write, and modify code.
Unsuitable tasks: Scenarios that require the Hy4 and CodeBuddy Code combination to have been specifically validated, or require this article to provide actual call results.
Applicable model version: TokenHub model ID hy4, the official Hy4 release.
Applicable client, agent, or API: CodeBuddy Code; Tencent Cloud TokenHub's OpenAI-compatible interface.
Recommended reasoning level and parameters: The TokenHub Hunyuan calling guide says Hy4's default reasoning level is high. The CodeBuddy Code setup page does not explain how to override the reasoning level in this model configuration, so no additional parameter is added.
Add the following configuration to CodeBuddy Code's model configuration file. If the file already contains other models, keep its existing content and append hy4 only to models and availableModels.
{
"models": [
{
"id": "hy4",
"name": "hy4",
"vendor": "Tencent Cloud",
"apiKey": "<USER_API_KEY>",
"url": "https://tokenhub.tencentmaas.com/v1"
}
],
"availableModels": ["hy4"]
}Configuration file paths:
Windows: C:\Users\<用户名>\.codebuddy\models.json
macOS / Linux: ~/.codebuddy/models.json
Replace <USER_API_KEY> with an API Key created in the TokenHub console. Tencent Cloud's CodeBuddy Code guide does not require an environment variable; following the guide, write the key to the local models.json file and do not commit it to a code repository.
Create an API Key in the TokenHub console and confirm that its access scope includes Hy4. The CodeBuddy Code guide's example uses Hy3; the Hy4 permission entry is adapted based on the TokenHub Hunyuan model list.
Create or edit models.json at the path above, add the hy4 configuration, and save the file.
Run codebuddy in a terminal to start CodeBuddy Code.
After signing in to CodeBuddy Code, enter /model in the interactive interface and select hy4 from the model list.
Submit a simple code explanation request, confirm that you receive a model response, and check that hy4 is still selected. This is a suggested user-side verification step; CodeBuddy Code was not actually run and no model call was made for this article.
Tencent Cloud's CodeBuddy Code setup guide was last updated on 2026-09-07. The page provides a models.json field example with id, name, vendor, apiKey, and url, and requires the model to also be added to availableModels. The startup command is codebuddy; after signing in, use /model to select a configured model. The example model on the page is Hy3.
Tencent Cloud's Hunyuan calling guide lists the official model ID hy4 and says Hy4 is compatible with the OpenAI Chat Completions API, OpenAI Responses, and Anthropic Messages protocols. Its TokenHub request example uses https://tokenhub.tencentmaas.com/v1.
The Hunyuan calling guide lists Hy4's context window as 1,024k, maximum input as 960k, and maximum output as 64k, and says Hy4's default reasoning level is high. This information is used to verify the model identity and interface; the CodeBuddy Code page does not publish Hy4-specific parameters.
The hy4 configuration adapts the Hy3 example in CodeBuddy Code's official guide according to its model configuration structure. Tencent Cloud's documentation does not publish a Hy4-specific CodeBuddy Code configuration or say that this combination has undergone dedicated testing.
Configuration parameters may vary between CodeBuddy Code versions. If the models.json schema has changed in your current version, follow that version's interface or documentation.
This article has not verified API Key permissions, streaming output, tool calls, visual input, or actual response quality. A protocol compatibility statement does not replace end-to-end verification in CodeBuddy Code.
The documentation does not provide an environment variable name or injection method for this configuration. Do not apply variable names from other clients directly to CodeBuddy Code.
On 2026-11-16, Tencent Cloud's CodeBuddy Code setup guide and TokenHub Hunyuan calling guide were read using Tabbit. The configuration follows the former's Hy3 example structure, with the model ID changed to the official hy4 release listed in the latter. CodeBuddy Code was not installed or run, no local configuration was changed, and no request was made using an API Key.
Hy4