Article
Solving the Claude Code API Error 400 Deferred Problem
Reproducing the Problem
Recently I connected Claude Code to z-ai/glm-5.3-flash on OpenRouter and hit two pitfalls along the way. My money is already topped up on OpenRouter and I didn't want to move it to Z.ai. So I want to write down my complete setup and the configuration that finally worked. Maybe it can help someone.
To make comparison easier, let me first post my earlier cc-switch configuration here:

The places to focus on are already circled in red, mainly the request URL and the upstream format configuration. If you configured it this way too — and of course this is also the fastest way, nearly just filling in a key and you can use it — then as you keep using Claude Code you will very likely run into the problem I ran into:
PLAINTEXT
复制
API Error: 400 Deferred custom tools are only supported on Anthropic models
and on Anthropic-compatible provider endpoints that implement deferral.
Other endpoints cannot call tools omitted from tools[].
Received z-ai/glm-5.3-flash-20260826The cause is that Claude Code marks some tools as deferred (Tool Search / on-demand loading): the request can leave those tools out of tools[] at first and pull them in later with tool_reference. This is an Anthropic-specific capability.
OpenRouter sees that the target model is GLM — not Claude, and not an "Anthropic-compatible endpoint that implements deferral" — and rejects it outright. The same kind of error appeared earlier with stealth/ox-alpha. Ox Alpha was later officially identified as GLM-5.3-Flash, so this isn't a one-off but a protocol mismatch.
+
The Solution
I won't go into the obvious solutions here, such as switching directly to the endpoint with the Anthropic protocol that GLM officially supports and connecting through GLM's official API. Of course, I haven't verified that approach myself, because my money is all topped up on OpenRouter and I couldn't be bothered to use the official API.
The method I used is cc-switch's local routing: open cc-switch's settings screen, choose Routing, and the reference configuration is as follows:

This is step one; we also need to change the model configuration in cc-switch:
Request URL: https://openrouter.ai/api/v1
Upstream format: OpenAI Chat Completions (routing must be enabled)
That's roughly the flow. After configuring it, reopen Claude and the problem should be solved — at least it solved mine. So I wrote this post to share it....
+
Copyright
Copyright of this article belongs to its author or rights holder. When reposting or quoting, please follow the applicable license terms and keep the link to this article.
Link to this article: https://xuyi.dev/en/2026-08-27-guprsh