June 17, 2026
How to Run GLM-5.2 in the opencode Desktop App (via Sota)
opencode began as a terminal agent, and that's still where most people use it. But there's now a desktop app, a real GUI window with a chat pane, a file tree, and a diff viewer, for people who'd rather see their changes than watch them scroll past in a terminal. It's in beta, and unlike the terminal it can add a custom model provider entirely through a form. Connecting it to GLM-5.2 through Sota is a matter of filling in a few fields, with no config files to edit. Routing through Sota also means inference runs on Cloudflare's network instead of Z.ai's China endpoint, with flat monthly pricing instead of per-token.
This guide covers the desktop app. If you live in the terminal, the CLI setup is the one you want.
What you need
- The opencode desktop app installed (download it from opencode.ai)
- A Sota account (free, no card)
- A Sota API key
Step 1: Generate a Sota API key
Open the Sota dashboard, go to API Keys, and create one. Name it opencode-desktop so it's easy to spot in your key list. Copy the key; it begins with sk-sota-, and Sota only shows it once, so keep it handy for the next step.
Step 2: Open the custom provider form
In the desktop app, open Settings and go to Providers. In the provider list, find the Custom provider row, described as "Add an OpenAI-compatible provider by base URL," and click Connect. That opens the form where you'll enter Sota's details.
Step 3: Fill in the fields
The form has a handful of fields. Here's exactly what goes in each one:
- Provider ID:
sota. Lowercase, no spaces. This is opencode's internal name for the provider. - Display name:
Sota. This is the label you'll see in the model picker, so keep it readable. - Base URL:
https://trysota.xyspace.dev/v1. Keep the/v1; opencode adds the rest of the request path itself. - API key: paste your
sk-sota-…key. - Models: add one model row. Set its ID to
glm-5.2and its Name toGLM-5.2. The ID is what Sota expects on the wire; the Name is what shows up in the picker. - Headers: leave empty. Sota authenticates with the API key, so no custom headers are needed.
If you also want Kimi K2.7 Code available, add a second model row now: ID kimi-k2.7-code, Name Kimi K2.7 Code. More on when to use which below.
Submit the form. opencode saves the provider settings and your key together, and there's no config file to touch afterward.
Step 4: Select GLM-5.2
Find the model selector in the chat input area; it shows whatever model is current. Click it, open the Sota provider, and choose GLM-5.2. The selection sticks across conversations until you change it.
Now open a project folder and ask the agent something concrete about the code in front of you. Watch the file tree and diff viewer as it works; that visual feedback is the main reason to use the desktop app over the terminal. If it reads your files and proposes sensible edits, you're connected.
GLM-5.2 vs Kimi K2.7 Code on Sota
Sota serves two open coding models, and both handle long context and long agent runs well, so the choice between them is about capability versus speed rather than memory.
GLM-5.2 is the more capable of the two. On coding leaderboards like Design Arena it ranks above Kimi, and it's the one to reach for when you want the strongest output: tricky refactors, dense logic, the tasks where a weaker model returns something that almost works. It costs more to run, which is the trade for that capability.
Kimi K2.7 Code is the faster alternative. It's a strong long-context coder in its own right, and it gives up a little of GLM-5.2's top-end quality for quicker responses, which is often the better deal when you're iterating fast. If you added it as a second model row in Step 3, it's already in the picker next to GLM-5.2; if not, reopen the provider from Settings → Providers and add the model. We compare the two in GLM-5.2 vs Kimi K2.7 Code.
Working in the GUI vs the terminal
The model and the routing are identical between the desktop app and the CLI: same GLM-5.2, same Sota endpoint, same Cloudflare inference. What changes is the interaction. The desktop app shows proposed edits as diffs you approve before they're written, keeps the file tree visible so you can see what the agent is touching, and gives you a scrollback that's easier to navigate than terminal history. For larger changes where you want to review before committing, that review step is genuinely useful. For tight feedback loops and scripting, the CLI is still faster. Plenty of people use both.
Troubleshooting
There's no Custom provider row. The custom-provider form is a newer addition and the desktop app is in beta, so update to the latest version if you don't see it.
The provider saves but messages error out. Reopen the provider settings and check the Base URL is exactly https://trysota.xyspace.dev/v1 with no trailing slash, and that the API key pasted in full. Keys start with sk-sota-.
The model picker is empty under Sota. You saved the provider without a model row. Reopen it from Settings → Providers and add a model with ID glm-5.2.
Edits look truncated. Update opencode; the desktop app is in beta and changes often. Sota normalizes model output to the expected response shape, but an outdated client can mishandle it.
The reason to route through Sota
GLM-5.2's native endpoint runs inference in China. For a lot of teams that's a non-starter on its own, regardless of how good the model is. Sota serves GLM-5.2 from Cloudflare's network (US, UK, Germany, Japan, Australia), so your source code stays on infrastructure you can actually point to in a compliance review. On top of that, opencode's agent runs aren't cheap on per-token billing; Sota's flat plans ($25 Starter, $125 Pro) with per-user ceilings keep the cost flat whether you run it twice a day or all day.
Get started with Sota and run GLM-5.2 in the opencode desktop app today.