Skip to content
DApks-cliopencodeglm-5.2scalewayai-codingpricing

I put GLM 5.2 behind pks-cli. Two minutes later it had spent $5

From a new pks opencode command to a finished LinkedIn carousel and tool documentation — plus a sharp reminder that API usage is not part of an AI subscription.

I only meant to test the hype around GLM 5.2.

Scaleway offers the model through its serverless API, and I already had credentials from earlier GPU work. So the question was not whether the model could answer. It was how little friction it would take before it felt like a natural part of my existing tool stack.

The answer ended up being one command:

pks opencode --model glm-5.2

Soon afterwards, GLM 5.2 had made a LinkedIn carousel about its own setup and written the new page in my pks-cli tool documentation.

The carousel cost roughly $2. While I was writing that on LinkedIn, usage had already reached $5.

It worked. Perhaps a little too well.

First, OpenCode had to become part of pks-cli

I already use pks claude and pks codex as entry points to different agent and model setups. Extending pks-cli therefore made more sense than creating another shell alias surrounded by API keys and config files.

The new command does three things:

  1. Reads the existing Scaleway key from pks scaleway init.
  2. Gives OpenCode a process-local provider configuration through OPENCODE_CONFIG_CONTENT.
  3. Starts OpenCode with the model scaleway/glm-5.2.

OpenCode talks directly to Scaleway's OpenAI-compatible endpoint. There is no translation proxy, unlike the setup required when Claude Code talks to a non-Anthropic model.

The key is not copied into opencode.json or placed on the command line either. OpenCode receives it as an environment variable in the launched process; the original credential remains managed by pks-cli.

Three tests cover the config shape, native arguments, and the most important security property: the secret must not appear in the argument list.

Most of the setup was already done

OpenCode needs to be installed once:

npm install -g opencode-ai

Then pks-cli can run directly from NuGet or npm without a permanent install — or be installed as a global .NET tool. Pick the route that fits your machine:

dotnet dnx pks-cli --yes -- scaleway init
dotnet dnx pks-cli --yes -- opencode --model glm-5.2
Runs directly from NuGet · requires .NET 10

But I had already used Scaleway for GPU work, so pks scaleway init was done. Once OpenCode was installed, the next session could start directly through dotnet dnx, npx, or the permanent pks command.

That is exactly the friction I want pks-cli to remove: authenticate once, expose one documented command, and keep the same entry point regardless of which model or provider sits behind the tool.

The documentation is part of the tool

The command received its own page in the tool registry with installation, examples, its security model, and troubleshooting. It is not a separate hand-maintained guide; it lives with the tool and can be published to agentics.dk/tools.

The pks opencode tool documentation with examples, prerequisites, and an explanation of the Scaleway provider setup.

Open the complete pks opencode documentation.

GLM 5.2 made the carousel itself

After the setup, I asked the model to create a LinkedIn carousel about what we had just built. This is the result:

Slide 1: GLM 5.2 joined my stack with one command.Slide 2: The pks opencode model glm-5.2 command.
Slide 3: OpenCode talks directly to Scaleway and reuses pks credentials.Slide 4: Provider configuration is passed through environment variables.
Slide 5: The complete setup takes two commands.Slide 6: The command was built test-first.
Slide 7: Try pks opencode at agentics.dk.

I like OpenCode's interface compared with both Codex and Claude Code. It feels like a genuine third option in the stack, not merely another way to send the same prompt.

And GLM 5.2 did what I asked: it read the repository, produced a visual artifact, and documented the command it had itself been launched through.

The missing feature is a lock

The interesting problem appeared afterwards.

Claude Max makes it easy to forget what an agent session actually costs. You experience a subscription, not every tool call. Scaleway serverless is different: usage lands on the credit card as API traffic.

My first observation on LinkedIn was: “$2 for a LinkedIn PDF.” Two minutes later I added a comment: “while I was posting this, it had spent $5.”

That is not a scientific benchmark. It is a better warning: an agent can read a lot of files, iterate on a design, render images, and write documentation while you are busy composing a social post.

The next natural pks-cli feature is therefore a lock: an explicit budget, warning, or session limit around metered providers. The command now makes switching models easy. It should also make forgetting how the model is billed difficult.

Until then, the rule is simple: pks opencode makes GLM 5.2 easy to start. Keep Scaleway's usage dashboard open too.