In latest version v0.11.3 How to config and use GLM-4.5 model if there isn't in the list? #1810

Closed
opened 2026-02-16 17:32:42 -05:00 by yindo · 5 comments
Owner

Originally created by @coopeu on GitHub (Sep 24, 2025).

Originally assigned to: @rekram1-node on GitHub.

We have a valid GLM-4.5 API key and want to use it on our Debian 12 server through OpenCode CLI. We’ve already installed the latest version of OpenCode (v0.11.3). However, when we check the /models list inside the CLI, GLM-4.5 is not available.

How can we configure or install OpenCode so that it recognizes and allows us to use the GLM-4.5 model via our API key

Originally created by @coopeu on GitHub (Sep 24, 2025). Originally assigned to: @rekram1-node on GitHub. We have a valid GLM-4.5 API key and want to use it on our Debian 12 server through OpenCode CLI. We’ve already installed the latest version of OpenCode (v0.11.3). However, when we check the /models list inside the CLI, GLM-4.5 is not available. How can we configure or install OpenCode so that it recognizes and allows us to use the GLM-4.5 model via our API key
yindo closed this issue 2026-02-16 17:32:42 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Sep 24, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #2431: Add support for Z.ai GLM Coding Plan (Anthropic-compatible provider) - discusses GLM-4.5 support and configuration
  • #2557: AI_APICallError: The messages parameter is illegal. Please check the documentation. - Zhipu AI GLM-4.5 - provides working configuration for GLM-4.5 via z.ai
  • #1559: Please adapt to the official GLM-4.5 direct connection version instead of Openrouter - discusses GLM-4.5 configuration
  • #1442: Add support for GLM-4.5 models - original request for GLM-4.5 support
  • #1397: GLM-4.5 Full (non-Air) not in model dropdown for OpenRouter? - discusses GLM-4.5 availability issues

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Sep 24, 2025): This issue might be a duplicate of existing issues. Please check: - #2431: Add support for Z.ai GLM Coding Plan (Anthropic-compatible provider) - discusses GLM-4.5 support and configuration - #2557: AI_APICallError: The messages parameter is illegal. Please check the documentation. - Zhipu AI GLM-4.5 - provides working configuration for GLM-4.5 via z.ai - #1559: Please adapt to the official GLM-4.5 direct connection version instead of Openrouter - discusses GLM-4.5 configuration - #1442: Add support for GLM-4.5 models - original request for GLM-4.5 support - #1397: GLM-4.5 Full (non-Air) not in model dropdown for OpenRouter? - discusses GLM-4.5 availability issues Feel free to ignore if none of these address your specific case.
Author
Owner

@OpeOginni commented on GitHub (Sep 24, 2025):

Hey @coopeu follow this guide as I guess you are making use of the Z.ai model provider? https://opencode.ai/docs/providers/#zai

Then put in the key as prompted, then you will have access to the model

@OpeOginni commented on GitHub (Sep 24, 2025): Hey @coopeu follow this guide as I guess you are making use of the Z.ai model provider? https://opencode.ai/docs/providers/#zai Then put in the key as prompted, then you will have access to the model
Author
Owner

@coopeu commented on GitHub (Sep 24, 2025):

Configuring OpenCode CLI for GLM-4.5
It sounds like you need to configure OpenCode CLI to recognize your GLM-4.5 model. Here's how to approach this:

  1. Check OpenCode Configuration
    First, locate the OpenCode configuration directory. It's typically in:

bash
~/.opencode/

  1. Add GLM-4.5 to ConfigurationYou'll likely need to edit the configuration file to add your GLM-4.5 model. The process usually involves:

Create or edit the config.yaml or config.json file in the OpenCode directory
Add your GLM-4.5 API key and endpoint information
Example configuration might look like:

models:
glm-4.5:
api_key: "your_api_key_here"
endpoint: "https://open.bigmodel.cn/api/paas/v4"
model: "glm-4.5"

  1. Alternative Method: Environment Variables
    You might also be able to set the configuration through environment variables:

bash
export OPENCODE_GLM45_API_KEY="your_api_key_here"
export OPENCODE_GLM45_ENDPOINT="https://open.bigmodel.cn/api/paas/v4"

  1. Verify Configuration
    After making changes, restart the OpenCode CLI and check the model list again:

bash
/models list

  1. Check Documentation
    Since OpenCode CLI might have changed in version 0.11.3, I recommend checking their official documentation for the most accurate configuration instructions. You can typically find this at:

The project's GitHub repository
The official OpenCode documentation website
If you continue to have issues, providing the exact output of the /models list command and any error messages would help in troubleshooting further.

@coopeu commented on GitHub (Sep 24, 2025): Configuring OpenCode CLI for GLM-4.5 It sounds like you need to configure OpenCode CLI to recognize your GLM-4.5 model. Here's how to approach this: 1. Check OpenCode Configuration First, locate the OpenCode configuration directory. It's typically in: bash ~/.opencode/ 2. Add GLM-4.5 to ConfigurationYou'll likely need to edit the configuration file to add your GLM-4.5 model. The process usually involves: Create or edit the config.yaml or config.json file in the OpenCode directory Add your GLM-4.5 API key and endpoint information Example configuration might look like: models: glm-4.5: api_key: "your_api_key_here" endpoint: "https://open.bigmodel.cn/api/paas/v4" model: "glm-4.5" 3. Alternative Method: Environment Variables You might also be able to set the configuration through environment variables: bash export OPENCODE_GLM45_API_KEY="your_api_key_here" export OPENCODE_GLM45_ENDPOINT="https://open.bigmodel.cn/api/paas/v4" 4. Verify Configuration After making changes, restart the OpenCode CLI and check the model list again: bash /models list 5. Check Documentation Since OpenCode CLI might have changed in version 0.11.3, I recommend checking their official documentation for the most accurate configuration instructions. You can typically find this at: The project's GitHub repository The official OpenCode documentation website If you continue to have issues, providing the exact output of the /models list command and any error messages would help in troubleshooting further.
Author
Owner

@rekram1-node commented on GitHub (Sep 24, 2025):

@coopeu did you get this figured out?

@rekram1-node commented on GitHub (Sep 24, 2025): @coopeu did you get this figured out?
Author
Owner

@rekram1-node commented on GitHub (Sep 30, 2025):

closing since @OpeOginni gave correct guidelines, if this is still an issue lmk

@rekram1-node commented on GitHub (Sep 30, 2025): closing since @OpeOginni gave correct guidelines, if this is still an issue lmk
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1810