MiniMax M4, GLM-5.4, and Qwen4 are in AI Gateway, from $0.06 per 1M tokens
Shipped by Nijiko Yonskai and Brenden Ehlers
Four models went live in AI Gateway this week: MiniMax M4, Z.ai’s GLM-5.4, Qwen4-Max, and Qwen4-35B-A3B, an open-weight model that uses about 3B of its 35B parameters per token. Each has a 1M-token context window. Pay with ngrok credits, or attach your own provider key.
MiniMax M4, GLM-5.4, and Qwen4-Max read images and video. Qwen4-Max and Qwen4-35B-A3B on QwenCloud can also cache a long prompt for an hour: mark the content block with "cache_control": { "type": "ephemeral", "ttl": "1h" }. On Qwen4-Max, that write costs $3.00 per 1M tokens, and each read costs $0.075. QwenCloud’s cache guide has the rest.
We gave all four models the cache bug below, five times each. Every run found both bugs. Qwen4-35B-A3B did it for $0.00017 to $0.00028 an answer. GLM-5.4 charged about 15 times as much for the same answer. Start small.
Get started
Get an access key
Sign in or create an account, then create an access key that allows these models. Use credits, or attach your own provider key.
Set up the project
In an ES module project (
"type": "module"inpackage.json), install the OpenAI SDK and save your key in.env.local:Ask about the bug
Save this as
index.ts:Run it
The answer is 8, not 3. All six concurrent calls miss the empty cache, and a cached
nullreads as a miss. Wording varies between runs.Check Activity
Open Activity to see the request’s provider, tokens, and cost. Swap
modelforminimax/minimax-m4,z-ai/glm-5.4, orqwen/qwen4-maxto compare.