Now Z.ai has an official solution to use the package. See below.
First we need to create a custom provider for the Z.ai anthropic API. Follow the instructions for adding a custom provider to opencode.
- Name it
zai-anthropic - Enter your API-key
Edit opencode.json and add this:
"provider": {
"zai-anthropic": {
"npm": "@ai-sdk/anthropic",
"options": {
"baseURL": "https://api.z.ai/api/anthropic/v1"
},
"models": {
"glm-4.5": {
"name": "glm-4.5"
}
}
}Make this model default if you wish:
"model": "zai-anthropic/glm-4.5",

@konstantinosbotonakis creating projects. Calculating just for myself to see which plan suits me best for my tasks. For example, Rovo Dev CLI give 20 million per day without restrictions on requests to choose from two models Sonnet 4 and GPT5. Price 7.53 usd. I also use it to see who can handle which tasks and how.