Add free live web search and page fetch to OpenCode or Crush using TinyFish MCP. Step-by-step setup guide — config file, API key, and prompt examples included.
A new AI model just picked up serious buzz among developers, and you do not need a GPU, an install, or a credit card to try it. GLM-5.2 is the model. Cloudflare Workers AI is the easiest place to test it for free.
Open a browser, pick the model, and start typing. That is the whole barrier to entry.
GLM-5.2 is not a guaranteed replacement for Claude or ChatGPT, and free access on Cloudflare does not mean unlimited access. This guide stays practical: what GLM-5.2 actually is, how to test it for free, and how to connect it to a real coding workflow through OpenCode.
This walkthrough focuses on the Cloudflare access path specifically. Z.ai also offers GLM-5.2 directly through its own coding plan, but Cloudflare's Playground and free daily Neuron allowance are the simplest way to test the model without creating a second account somewhere else.
⚡ Direct answerThe fastest way to use GLM-5.2 for free is Cloudflare's Workers AI Playground. Open playground.ai.cloudflare.com, search the model picker for @cf/zai-org/glm-5.2, and start chatting. No account or sign-in is required for Playground testing.
For real coding work, create a free Cloudflare account, generate a Workers AI API token, and connect it inside OpenCode with the /connect command. OpenCode may label the field as an API key, but the value you paste is the Cloudflare API token. Cloudflare includes 10,000 free Neurons a day, which covers light testing but is not an unlimited allowance.
GLM-5.2 is Z.ai's flagship model, built for coding, long codebases, and agentic workflows rather than casual chat. It uses a mixture-of-experts design, and the public model card lists 753 billion parameters. The practical point is simple: this is not a laptop-friendly model, so Cloudflare's hosted path removes the hardware problem for normal testing.
Three things explain the attention. The benchmark scores are genuinely strong: Z.ai reports GLM-5.2 scoring 62.1 on SWE-bench Pro and 81.0 on Terminal-Bench 2.1. That puts it ahead of GPT-5.5 on SWE-bench Pro in Z.ai's table, while Terminal-Bench comparisons are closer and depend on the harness. On FrontierSWE, a benchmark built around long, open-ended engineering projects, GLM-5.2 reportedly landed within about a point of Claude Opus 4.8.
Context is the second reason. It jumped from roughly 200,000 tokens in the previous generation to a native 1,048,576 tokens, enough to load a mid-sized codebase in one sitting. Cloudflare hosts a smaller slice of that limit, which the next section covers in detail.
The third reason is access. The weights are open, published on Hugging Face under an MIT license, so nothing here requires a paid key just to inspect the model. Self-hosting is possible, but the hardware requirement is the real catch.
Independent rankings back up the benchmark claims to some degree. Arena.ai's leaderboard lists glm-5.2 (max) among public testing models, and its frontend/design results look especially strong right now. Treat those rankings as moving signals, not permanent proof. Crowd-vote leaderboards can change quickly as more models and votes arrive.
Cloudflare is already hosting it. That is the practical reason you can test GLM-5.2 in a browser without waiting for another third-party access route.
Reality check GLM-5.2's coding results are strong, but the GPT-5.5 comparison is mixed by benchmark and harness. It also trails Claude Opus 4.8 on several long-horizon tasks. Treat it as a strong, low-cost model worth testing, not an automatic upgrade over whatever you already use.The gap is wider on the hardest long-horizon tests. On SWE-Marathon, which covers multi-hour work like building compilers or optimizing kernels, Z.ai's own published numbers put GLM-5.2 roughly 13 percentage points behind Claude Opus 4.8. That matters far more for autonomous, multi-hour agent runs than for the single-session debugging most beginners try first.
Cloudflare's Workers AI Playground is the lowest-friction way to try GLM-5.2. It runs in your browser, needs no sign-in, and gives you the exact model Cloudflare is hosting.
1 ~2 minutesGo to playground.ai.cloudflare.com. Open the model dropdown and search for "glm" or "zai" until @cf/zai-org/glm-5.2 appears, then select it. You will know it worked when that model name shows above the chat box.
Test GLM-5.2 on something you understand well: a function you wrote, a real error message, or a small feature you could build yourself. If you cannot tell whether the answer is good, the test will not tell you anything useful.
Act as a senior software engineer. Debug this issue and suggest the smallest safe fix. Context: [describe your project in one line] Expected behavior: [what should happen] Actual behavior: [what happens instead] Code: [paste the relevant code] Rules: do not rewrite unrelated code, explain the likely root cause first, show the minimal patch, and ask one question if information is missing.A structured prompt like that gives GLM-5.2 a real job to do. A strong model with a vague prompt still produces vague work, so the prompt matters as much as the model name.
Good first tests to try Keep your first few prompts concrete: explain this function, find the bug in this error message, or compare two ways to solve the same small problem. Avoid a vague request like "fix my code" with no other context, since that tells the model nothing about what you actually need.The playground is good for testing. Using GLM-5.2 inside your own coding tools needs a Cloudflare account and an API token instead.
3 ~3 minutesSign up for a free Cloudflare account, open the dashboard, and go to Workers AI. Select "Use REST API" to find your Account ID, then create an API token from the same screen.
Copy both somewhere safe. The token only displays once. In OpenCode, the prompt may say "API key," but paste the Cloudflare API token there.
Treat your token like a password Do not paste your API token into a public chat, a screenshot, or a GitHub commit. If it ever leaks, rotate it immediately from the same Workers AI dashboard screen where you created it. 4 ~1 minuteCloudflare gives every account 10,000 free Neurons per day, resetting at 00:00 UTC, according to Cloudflare's Workers AI pricing documentation. Usage beyond that is billed at $0.011 per 1,000 Neurons on the Workers Paid plan. A large reasoning model like GLM-5.2 can use more compute per useful reply than a small model, so heavy daily agent use will not stay inside the free tier indefinitely. Check the dashboard before you build a workflow around it.
Know where your code goes Z.ai is a Chinese AI lab. Running GLM-5.2 through Cloudflare's hosted endpoint is a different data path than sending requests directly to Z.ai's own API. Check each provider's data handling documentation before piping proprietary or sensitive code through either one.OpenCode is an open-source, terminal-based coding agent that connects to more than seventy model providers, including Cloudflare Workers AI. Once it is wired up, it can read your files, propose changes, and run commands inside your own project instead of just answering questions in a chat window.
5 ~4 minutesInstall OpenCode, then run the /connect command inside it and search for "Cloudflare Workers AI," per OpenCode's provider documentation. Enter your Account ID when prompted, then paste your Cloudflare API token when OpenCode asks for the API key.
Run /models afterward and select @cf/zai-org/glm-5.2. You will know it worked when that model name appears as your active model in the OpenCode status line.
That turns GLM-5.2 from a browser chat model into a coding assistant that can read files, suggest changes, and use tools inside your own project.
Inspect before it edits Start with a small test project, not your main repository. Ask OpenCode to inspect the issue and propose a plan before changing anything, then approve only the smallest safe fix. Inspect this project and find the likely cause of this bug: [describe the bug]. Do not edit any files yet. Return: 1. The files you checked 2. The likely root cause 3. A fix plan 4. The test I should run afterward Wait for my approval before making changes.Four technical details explain why GLM-5.2 is positioned as a coding-agent model rather than a general chat model. Together, they are what let it act less like a chatbot and more like a junior engineer who can read the whole file before answering.
| Capability | Type | Best For | Watch Out For |
|---|---|---|---|
| Context window | 262K hosted | Large codebases, long documents, multi-file debugging | The native model supports 1M tokens. Cloudflare's GLM-5.2 model page lists a 262,144-token hosted context window. |
| Function calling | Built-in | Coding agents and tool-using workflows like OpenCode | Reliability still depends on how your agent framework wires the tool calls together. |
| Reasoning | Built-in | Debugging, architecture planning, refactors | Adds latency and output tokens. Skip it for trivial, one-line tasks. |
| Effort levels | Provider-dependent | Use heavier reasoning only when your provider exposes that control | Z.ai's own API documents effort controls, but Cloudflare may expose a different parameter set. Check the current model page before assuming the same knob exists. |
Benchmark leaderboards put GLM-5.2 near the frontier on several coding tests, with a clear win over GPT-5.5 on SWE-bench Pro in Z.ai's published table and closer results elsewhere. But "scores well on a benchmark" and "beats your current tool on your actual codebase" are two different claims.
A benchmark tells you how a model performs on someone else's test. Your codebase is the only benchmark that actually matters.
Claude may still hold the edge for long-form writing, nuanced instruction-following, and certain production debugging workflows. ChatGPT may still be the stronger general assistant for multimodal and voice work. GLM-5.2 earns its keep specifically in coding-agent workflows, long-context analysis, and tool use, especially where cost is a real constraint.
Cost is where GLM-5.2 becomes interesting even when the benchmark gap is small. Cloudflare lists GLM-5.2 at $1.40 per million input tokens and $4.40 per million output tokens, which makes it easier to test before committing to a more expensive daily coding workflow.
The only reliable test is your own task. Run the same prompt through GLM-5.2 and whatever you use today, then compare the resulting code, not the marketing.
If you only have fifteen minutes, this is a fast way to decide whether GLM-5.2 deserves more of your time.
That is enough signal for a first decision. Save the deeper OpenCode setup for after you already like what you see in the browser.
Matching the model to the job matters more than chasing whichever one currently leads a leaderboard.
| Use Case | Good Fit |
|---|---|
| Coding and debugging assistance | Yes |
| Long-context codebase analysis | Yes |
| Agentic, tool-using workflows | Yes |
| Lower-cost frontier-adjacent testing | Yes |
| Image generation | No |
| Casual daily chat | No |
| Polished long-form writing | No |
| Voice or multimodal assistants | No |
If you write code often and want a strong, lower-cost model with long context, GLM-5.2 deserves a real test. If you mostly need a writing or multimodal assistant, it is not built for that job, and forcing it there will just leave you unimpressed for the wrong reason. See the Best AI Research Tools guide for tools better suited to research and writing workflows.
These are the patterns that trip up most people testing a new model for the first time, based on how this kind of rollout usually plays out.
If you already lean on Claude Code for daily development work, GLM-5.2 through OpenCode is worth running as a side-by-side comparison rather than a full replacement. The Claude MCP setup guide covers a similar tool-connection pattern if you want to wire either agent into your own services. For prompt structures that hold up across different coding models, the AI coding agent prompts guide goes deeper than the two examples above.
GLM-5.2 is worth testing if you write code regularly and want a strong, lower-cost model with real long-context support. The Cloudflare Playground gets you there in minutes with zero setup.
Be careful with two specific things: the free Neuron allowance is real but finite, and a benchmark win over GPT-5.5 is not the same as a win over your current tool on your actual codebase. Test it on a task you understand before trusting it on one you don't.
The safest next step is the playground, not the API. Open it, paste one real function or bug, and judge the answer yourself before connecting anything to a live project.
@cf/zai-org/glm-5.2./connect, your Cloudflare Account ID, and an API token, then select the model with /models.Skip the hype and the setup overhead. Paste a function you actually understand, see what GLM-5.2 does with it, and decide from there.
AI App Studio shares AI tools, app reviews, and practical insights — discover what to use, how it works, and what's new in AI.