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",
@iFedyna thank you. That is valuable information to judge the plan. So the 190 requests and 9000000 tokens were consumed within a 5 hour window, I guess. Really a great offer.