For models available via Anthropic-compatible (currently Kimi-K2, GLM, Deepseek), the simplest way to use them with CC is by setting up a function in .zshrc:
This is mainly because Chinese online payment infrastructure didn't have good support for subscriptions or auto payments (at least until relatively recently) so this pattern is the norm
It's more of a culture thing. People just hate the concept of "idk how much I'm going to pay let's just try this and find out later".
Also people would be confused as they expect things to be prepaid, so if you let them use the service they'd think it's a free trial or something, unless you literally put very big, clear price tag and require like triple confirmation. If not and you ask them to pay later they would perceive this as unfair deceptive tricks, and may scam you by report the loss of their credit card (!), because apparently disputing transactions in China is super hard.
but in my testing other models do not work well, looks like prompts are either very optimized for Claude, or other models are just not great yet with such agentic environment
I was especially disappointed with grok code. it is very fast as advertised but in generating spaces and new lines in function calling until it hits max tokens. I wonder if that isn't why it gets so much tokens on openrouter.
gpt-5 just wasn't using the tools very well
I didn't tested glm yet, but with current anthropic subscription value, alternative would need to be very cheap if you consider daily use
edit: I noticed that also have very inexpensive subscription https://z.ai/subscribe, if they trained model to work well with CC this might actually be viable alternative
> but in my testing other models do not work well, looks like prompts are either very optimized for Claude, or other models are just not great yet with such agentic environment
I think there are multiple things going on. First, models are either trained with tool calling in mind or not, the ones that don't, won't work well as agents. Secondly, each companies models are trained with the agent software in mind, and the agent software is built with their specific models in mind. Thirdly, each model responds differently to different system/user prompts, and the difference can be really stark.
I'm currently working on a tool that lets me execute the same prompts with the same environment over multiple agents. Currently I'm running Codex, Claude Code, Gemini, Qwen Code and AMP for every single change, just to see the differences in responses, and even reusing the same system prompt across all of them gives wildly different results. Not to mention how quickly the quality drops off the cliff as soon as you switch out any non-standard model for any of those CLIs. Mix-and-match models between those five tools, and it becomes clear as day that the model<>software is more interlocked than it seems.
The only project I've had success with switching out the model of, has been using GPT-OSS-120b locally with Codex, but that still required me to manually hack in support for changing the temperature, and changing the prompts Codex use a bit, to get OK results.
It’s probably not that hard to take the OSS models and fine tune them for CC. Which means with a little bit of reverse engineering and some free time you could get an open source models working perfectly with it.
Claude code router is a good first step. But you also need to MITM CC while it’s running and collect the back and forth for a while. I would do it if I had more free time, surprised someone smart hasn’t already tried.
> But in my testing, other models do not work well. It looks like prompts are either very optimized for Claude, or other models are just not great yet with such an agentic environment.
Anybody who has done any serious development with LLMs would know that prompts are not universal. The reason why Claude Code is good is because Anthropic knows Claude Sonnet is good, and that they only need to create prompts that work well with their models. They also have the ability to train their models to work with specific tools and so forth.
It really is a kind of fool's errand to try to create agents that can work well with many different models from different providers.
You don't need claude code router to use GLM, just set the env var to the GLM url. Also, I generally advise people not to bother with claude code router, Bifrost can do the same job and it's much better software.
Quick glance over readme suggest it's only openai compatible but I also found HN post [1] explaining use of claude code with ollama
But anyways, claude-code-router have advantage of allowing request transformers, those are required for getting GitHub copilot as provider and grok-code limitations to messages format.
I called it "chinnese chatpcha", back then chinnese chaptcha is so much harder than western counterpart
but now gchaptcha spam me with 5 different image if I missing a tiles for crossroad, so chinnese chaptcha is much better in my opinion
also there is variant that match the image based on shadow and different order of shape
its much better in my opinion because its use much more interactivity, solving western chaptcha is so much mind numbing now that they require you at least multiple image identification for crossroad,sign,cars etc
I've been using GLM 4.5 and GLM 4.5 Air for a while now. The Air model is light enough to run on a macbook pro and is useful for Cline. I can run the full GLM model on my Mac Studio, but the TPS is so slow that it's only useful for chatting. So I hooked up with openrouter to try but didn't have the same success. Any of the open weight models I try with open router give sub standard results. I get better results from Qwen 3 coder 30b a3b locally than I get from Qwen 3 Coder 480b through open router.
I'm really concerned that some of the providers are using quantized versions of the models so they can run more models per card and larger batches of inference.
> I get better results from Qwen 3 coder 30b a3b locally than I get from Qwen 3 Coder 480b through open router. I'm really concerned that some of the providers are using quantized versions of the models so they can run more models per card and larger batches of inference.
This doesn't match my experience precisely, but I've definitely had cases where some of the providers had consistently worse output for the same model than others, the solution there was to figure out which ones those are and to denylist them in the UI.
You can see that these providers run FP4 versions:
* DeepInfra (Turbo)
And these providers run FP8 versions:
* Chutes
* GMICloud
* NovitaAI
* Baseten
* Parasail
* Nebius AI Studio
* AtlasCloud
* Targon
* Together
* Hyperbolic
* Cerebras
I will say that it's not all bad and my experience with FP8 output has been pretty decent, especially when I need something done quickly and choose to use Cerebras - provided their service isn't overloaded, their TPS is really, really good.
Interesting. Thanks for sharing. What about qwen3-coder on Cerebras? I'm happy to pay the $50 for the speed as long as results are good. How does it compare with glm-4.5?
I wish that Cerebras had a direct pay per use API option instead of pushing you towards OpenRouter and HuggingFace (the former sometimes throws 429, so either the speed is great, or there is no speed): https://www.cerebras.ai/pricing but I imagine that for most folks their subscription would be more than enough!
* it sits between Gemini 2.5 Pro and GPT-5 mini
* it beats out Kimi K2 and the older Claude Sonnet 3.7
* but loses out to Claude Sonnet 4 and GPT-5
Personally, I find it sufficient for most tasks (from recommendations and questions to as close to vibe coding as I get) on a technical level. GLM 4.5 isn't on the site at the time of writing this, but they should match one another pretty closely. Feeling wise, I still very much prefer Sonnet 4 to everything else, but it's both expensive and way slower than Cerebras (not even close).
Update: also seems like the Growth plan on their page says "Starting from 1500 USD / month" which is a bit silly when the new cheapest subscription is 50 USD / month.
(OpenRouter COO here) We are starting to test this and verify the deployments. More to come on that front -- but long story short is that we don't have good evidence that providers are doing weird stuff that materially affects model accuracy. If you have data points to the contrary, we would love them.
We are heavily incentivized to prioritize/make transparent high-quality inference and have no incentive to offer quantized/poorly-performing alternatives. We certainly hear plenty of anecdotal reports like this, but when we dig in we generally don't see it.
It does take providers time to learn how to run the models in a high quality way; my expectation is that the difference in quality will be (or already is) minimal over time. The large variance in that case was because GPT OSS had only been out for a couple of weeks.
For well-established models, our (admittedly limited) testing has not revealed much variance between providers in terms of quality. There is some but it's not like we see a couple of providers 'cheating' by secretly quantizing and clearly serving less intelligence versions of the model. We're going to get more systematic about it though and perhaps will uncover some surprises.
So what's the deal with Chutes and all the throttling and errors. Seems like users are losing their minds over this.. at least from all the reddit threads I'm seeing
Unsolicited advice: Why doesn’t open router provide hosting services for OSS models that guarantee non-quantised versions of the LLMs? Would be a win-win for everyone.
Would make very little business sense at this point - currently they have an effective monopoly on routing. Hosting would just make them one provider among a few dozen. It would make the other providers less likely to offer their services through openrouter. It would come with lots of concerns that openrouter would favor routing towards their own offerings. It would be a huge distraction to their core business which is still rapidly growing. Would need massive capital investment. And another thousand reasons I haven't thought of.
Surprised to see no one here is worried about privacy. Z.ai's privacy policy pretty much allows them to store and use prompts/code in a perpetual, irrevocable, worldwide, sublicensable license to use and train their models.
I have already assumed that on every chat service I use, they store and train on my prompts either way, since I use the service for free. If you actually want privacy, host it yourself or look for a llm service with another business-model
* This is an excellent alternative to Sonnet - which was my daily driver. I'm glad I tried GLM 4.5. You won't find any difference.
* My context usage per session was about 50% with Sonnet earlier, but it fills up fast with GLM, and I hit 80-90% often. Could be the lower context size that is hurting.
* Sonnet used to be very painful to work with as the context size goes beyond 80% (hence my habit of shorter conversations). GLM holds itself well even until the last bit of remaining context. Does not deviate from the assigned task.
I would be interested to know where the claim of the “killer combination” comes from. I would also like to know who the people behind Z.ai are — I haven’t heard of them before. Their plans seem crazy cheap compared to Anthropic, especially if their models actually perform better than Opus.
> I would also like to know who the people behind Z.ai are — I haven’t heard of them before.
To be clear, Z.ai are the people who built GLM 4.5, so they're talking up their own product.
But to be fair, GLM 4.5 and GLM 4.5 Air are genuinely good coding models. GLM 4.5 Air costs about 10% of what Claude Sonnet does (when hosted on DeepInfra, at least), and it can perform simple coding tasks quite quickly. I haven't tested GLM 4.5 Air, but it seems to be popular as well.
If you can easily afford all the Claude Code tokens you want, then you'll probably get better results from Sonnet. But if you already know enough programming to work around any issues that arise, the GLM models are quite usable.
But you can't easily run GLM 4.5 Air quickly without professional workstation- or server-grade hardware (RTX 6000 Pro 96GB would be nice), at least not without a serious speed hit.
Still, it's a very interesting sign for the future of open coding models.
For agentic coding I found the price difference more modest due to prompt caching, which most GLM providers on Openrouter don't offer, but Anthropic does. Look at the cache read/write columns: https://openrouter.ai/z-ai/glm-4.5
Been playing with Grok Code Fast 1 in Cline via Open Router. It supports prompt caching as far as I can tell, and it certainly is cheap. It's been quite good for the stuff I've tried. YMMV.
Actually Z.ai is a spinoff of Tsinghua University and one of the first China labs open sourcing its own large models (GLM released in 2021) .
https://github.com/THUDM/GLM
With a little search you can find it's a laboratory within the CS department of THU. It's a fairly large lab though, not those led by just one or two professors.
Why trying CC why not using alternatives like Opencode or Goose that are open and made for this purpose instead of trying to use a tool tailored by Anthropic for Anthropic models?
This is really cool and should work well with something like RooCode as well. Usually I keep going back to either Claude Sonnet or Gemini 2.5 Pro (also tried out GPT-5, was quite unimpressed) but both of those are relatively expensive.
I've tried using the more expensive model for planning and something a bit cheaper for doing the bulk of changes (the Plan / Ask and Code modes in RooCode) which works pretty nicely, but settling on just one model like GLM 4.5 would be lovely! Closest to that I've gotten to up until now has been the Qwen3 Coder model on OpenRouter.
I think I used about 40M tokens with Claude Sonnet last month, more on Gemini and others, that's a bit expensive for my liking.
I wonder how you justify this editorialized title, and if HN mods share your justification. The linked article has no the word "killer" in it.
I think this is why many people have concerns about AI. This group can't express neutral ideas. They have to hype about a simple official documentation page.
It's weird, but using Claude Code (CC) with GLM 4.5 from Z.ai, I spent $5 just starting CC and asking it to read the spec and guideline files. This on an API that advertises $0.6 per million tokens input, and $2.2 per million tokens output.
Then, I noticed that after the original prompt, any further prompt I gave CC (other that approving its actions) did not have any effect at all on it. Yes, any prompt is totally ignored. I have to stop CC and restart with the new prompt for it to take effect.
This is really strange to me. Does CC have some way of detecting when it is running against an API other than Anthropic's? The massive cost and/or token usage and crippled agentic mode is clearly not due to GLM 4.5 not being capable. Either CC is crippled in some way when using a 3rd party API, or else Z.ai's API is somehow not working properly.
Hmm with the lower context length I'm wonder how it holds up for problems requiring slightly larger context given we know most models tend to degrade fairly quickly with context length.
Maybe it's best for shorter tasks or condensed context?
I find it interesting the number of models latching onto Claude codes harness. I'm still using Cursor for work and personal but tried out open code and Claude for a bit. I just miss having the checkpoints and whatnot.
Z.AI is the company that created GLM and the link goes to their official documentation. It’s really weird to complain that their official documentation on their official website has a “conflict of interest”.
The title has been changed. The original title was wildly positive, and OP has acknowledged it was inappropriate and changed it (see comments below).
My issue was with an article being posted with a title saying how amazing two things are together (making it seem like it was somehow an independent review), when it was actually just a marketing post by one of the companies.
I was blown away by this model. It was definitely comparable to sonnet 4. In some of my tests, it performed as good as Opus.
I subscribed to their paid plan, and now the model seems dumb?
I asked it to find and replace a string. It only made the change in one file. Codex worked fine.
Can Z.ai confirm if this is the model we get through their API or is it quantized for Claude Code use?
"So, we only know the Y-axis for some models in the scatter plot. Let's make up an X-axis value on the bad side of the graph and include the data points anyway."
Chinese software always has such a design language:
- prepaid and then use credit to subscribe
- strange serif font
- that slider thing for captcha
But I'm going to try it out now.
https://github.com/pchalasani/claude-code-tools/tree/main?ta...
Surprised that Qwen didn’t do the same, (though I know they have their own CLI-coding agent).
This is mainly because Chinese online payment infrastructure didn't have good support for subscriptions or auto payments (at least until relatively recently) so this pattern is the norm
Also people would be confused as they expect things to be prepaid, so if you let them use the service they'd think it's a free trial or something, unless you literally put very big, clear price tag and require like triple confirmation. If not and you ask them to pay later they would perceive this as unfair deceptive tricks, and may scam you by report the loss of their credit card (!), because apparently disputing transactions in China is super hard.
but in my testing other models do not work well, looks like prompts are either very optimized for Claude, or other models are just not great yet with such agentic environment
I was especially disappointed with grok code. it is very fast as advertised but in generating spaces and new lines in function calling until it hits max tokens. I wonder if that isn't why it gets so much tokens on openrouter.
gpt-5 just wasn't using the tools very well
I didn't tested glm yet, but with current anthropic subscription value, alternative would need to be very cheap if you consider daily use
edit: I noticed that also have very inexpensive subscription https://z.ai/subscribe, if they trained model to work well with CC this might actually be viable alternative
I think there are multiple things going on. First, models are either trained with tool calling in mind or not, the ones that don't, won't work well as agents. Secondly, each companies models are trained with the agent software in mind, and the agent software is built with their specific models in mind. Thirdly, each model responds differently to different system/user prompts, and the difference can be really stark.
I'm currently working on a tool that lets me execute the same prompts with the same environment over multiple agents. Currently I'm running Codex, Claude Code, Gemini, Qwen Code and AMP for every single change, just to see the differences in responses, and even reusing the same system prompt across all of them gives wildly different results. Not to mention how quickly the quality drops off the cliff as soon as you switch out any non-standard model for any of those CLIs. Mix-and-match models between those five tools, and it becomes clear as day that the model<>software is more interlocked than it seems.
The only project I've had success with switching out the model of, has been using GPT-OSS-120b locally with Codex, but that still required me to manually hack in support for changing the temperature, and changing the prompts Codex use a bit, to get OK results.
Claude code router is a good first step. But you also need to MITM CC while it’s running and collect the back and forth for a while. I would do it if I had more free time, surprised someone smart hasn’t already tried.
Anybody who has done any serious development with LLMs would know that prompts are not universal. The reason why Claude Code is good is because Anthropic knows Claude Sonnet is good, and that they only need to create prompts that work well with their models. They also have the ability to train their models to work with specific tools and so forth.
It really is a kind of fool's errand to try to create agents that can work well with many different models from different providers.
Quick glance over readme suggest it's only openai compatible but I also found HN post [1] explaining use of claude code with ollama
But anyways, claude-code-router have advantage of allowing request transformers, those are required for getting GitHub copilot as provider and grok-code limitations to messages format.
[1] https://news.ycombinator.com/item?id=45127509
but now gchaptcha spam me with 5 different image if I missing a tiles for crossroad, so chinnese chaptcha is much better in my opinion
also there is variant that match the image based on shadow and different order of shape
its much better in my opinion because its use much more interactivity, solving western chaptcha is so much mind numbing now that they require you at least multiple image identification for crossroad,sign,cars etc
they want those self driving car are they
I'm really concerned that some of the providers are using quantized versions of the models so they can run more models per card and larger batches of inference.
This doesn't match my experience precisely, but I've definitely had cases where some of the providers had consistently worse output for the same model than others, the solution there was to figure out which ones those are and to denylist them in the UI.
As for quantized versions, you can check it for each model and provider, for example: https://openrouter.ai/qwen/qwen3-coder/providers
You can see that these providers run FP4 versions:
And these providers run FP8 versions: I will say that it's not all bad and my experience with FP8 output has been pretty decent, especially when I need something done quickly and choose to use Cerebras - provided their service isn't overloaded, their TPS is really, really good.You can also request specific precision on a per request basis: https://openrouter.ai/docs/features/provider-routing#quantiz... (or just make a custom preset)
As for how Qwen3 Coder performs, there's always SWE-bench: https://www.swebench.com/
By the numbers:
Personally, I find it sufficient for most tasks (from recommendations and questions to as close to vibe coding as I get) on a technical level. GLM 4.5 isn't on the site at the time of writing this, but they should match one another pretty closely. Feeling wise, I still very much prefer Sonnet 4 to everything else, but it's both expensive and way slower than Cerebras (not even close).Update: also seems like the Growth plan on their page says "Starting from 1500 USD / month" which is a bit silly when the new cheapest subscription is 50 USD / month.
We are heavily incentivized to prioritize/make transparent high-quality inference and have no incentive to offer quantized/poorly-performing alternatives. We certainly hear plenty of anecdotal reports like this, but when we dig in we generally don't see it.
An exception is when a model is first released -- for example this terrific work by artificial analysis: https://x.com/ArtificialAnlys/status/1955102409044398415
It does take providers time to learn how to run the models in a high quality way; my expectation is that the difference in quality will be (or already is) minimal over time. The large variance in that case was because GPT OSS had only been out for a couple of weeks.
For well-established models, our (admittedly limited) testing has not revealed much variance between providers in terms of quality. There is some but it's not like we see a couple of providers 'cheating' by secretly quantizing and clearly serving less intelligence versions of the model. We're going to get more systematic about it though and perhaps will uncover some surprises.
However your providers do have such an incentive.
https://openrouter.ai/provider/chutes
* This is an excellent alternative to Sonnet - which was my daily driver. I'm glad I tried GLM 4.5. You won't find any difference.
* My context usage per session was about 50% with Sonnet earlier, but it fills up fast with GLM, and I hit 80-90% often. Could be the lower context size that is hurting.
* Sonnet used to be very painful to work with as the context size goes beyond 80% (hence my habit of shorter conversations). GLM holds itself well even until the last bit of remaining context. Does not deviate from the assigned task.
I would be interested to know where the claim of the “killer combination” comes from. I would also like to know who the people behind Z.ai are — I haven’t heard of them before. Their plans seem crazy cheap compared to Anthropic, especially if their models actually perform better than Opus.
To be clear, Z.ai are the people who built GLM 4.5, so they're talking up their own product.
But to be fair, GLM 4.5 and GLM 4.5 Air are genuinely good coding models. GLM 4.5 Air costs about 10% of what Claude Sonnet does (when hosted on DeepInfra, at least), and it can perform simple coding tasks quite quickly. I haven't tested GLM 4.5 Air, but it seems to be popular as well.
If you can easily afford all the Claude Code tokens you want, then you'll probably get better results from Sonnet. But if you already know enough programming to work around any issues that arise, the GLM models are quite usable.
But you can't easily run GLM 4.5 Air quickly without professional workstation- or server-grade hardware (RTX 6000 Pro 96GB would be nice), at least not without a serious speed hit.
Still, it's a very interesting sign for the future of open coding models.
This is the data for that claim: https://huggingface.co/datasets/zai-org/CC-Bench-trajectorie...
Why trying CC why not using alternatives like Opencode or Goose that are open and made for this purpose instead of trying to use a tool tailored by Anthropic for Anthropic models?
But they can sort of compete on model quality, by no longer dumbing down their models. That'll be expensive too, but it's a lever they have.
I've tried using the more expensive model for planning and something a bit cheaper for doing the bulk of changes (the Plan / Ask and Code modes in RooCode) which works pretty nicely, but settling on just one model like GLM 4.5 would be lovely! Closest to that I've gotten to up until now has been the Qwen3 Coder model on OpenRouter.
I think I used about 40M tokens with Claude Sonnet last month, more on Gemini and others, that's a bit expensive for my liking.
I think this is why many people have concerns about AI. This group can't express neutral ideas. They have to hype about a simple official documentation page.
Then, I noticed that after the original prompt, any further prompt I gave CC (other that approving its actions) did not have any effect at all on it. Yes, any prompt is totally ignored. I have to stop CC and restart with the new prompt for it to take effect.
This is really strange to me. Does CC have some way of detecting when it is running against an API other than Anthropic's? The massive cost and/or token usage and crippled agentic mode is clearly not due to GLM 4.5 not being capable. Either CC is crippled in some way when using a 3rd party API, or else Z.ai's API is somehow not working properly.
Maybe it's best for shorter tasks or condensed context?
I find it interesting the number of models latching onto Claude codes harness. I'm still using Cursor for work and personal but tried out open code and Claude for a bit. I just miss having the checkpoints and whatnot.
Also fascinating how they solved the issue that Claude expects a 200+k token model while GLM 4.5 has 128k.
> GLM-4.5 and GLM-4.5-Air are our latest flagship models
Maybe it is great, but with a conflict of interest so obvious I can't exactly take their word for it.
My issue was with an article being posted with a title saying how amazing two things are together (making it seem like it was somehow an independent review), when it was actually just a marketing post by one of the companies.
After Claude models have recently become dumb, I switched to Qwen3-Coder (there's a very generous free tier) and GLM4.5, and I'm not looking back.
RooCode can use OAuth as well (but you have to install Qwen Code first).
"So, we only know the Y-axis for some models in the scatter plot. Let's make up an X-axis value on the bad side of the graph and include the data points anyway."
Visually disingenuous!
This is quite nice. Will try it out a bit longer over the weekend. I tested it using Claude Code with env variables overrides.