# Claude Code and opencode on Open-Weight Models: GLM, Kimi and DeepSeek on Morpheus

> Run Claude Code or opencode on GLM, Kimi and DeepSeek via claude-code-router, the vendors' APIs or Morpheus. Five runs tested by us, plus one trap to avoid.

- Published: 2026-10-03
- Canonical: https://ownyourmind.ai/use/claude-code-opencode-open-weight-models/
- Cite as: Own Your Mind (ownyourmind.ai), licence CC BY 4.0. Link the canonical URL.

Charts and interactive widgets are omitted here; project data is at https://ownyourmind.ai/api/scores.json.

---

## What this guide covers

Claude Code and opencode are coding agents. You describe a change, and the agent reads your files, edits them and runs commands until the job is done. Every step is a question to an AI model, and every question carries pieces of your code.

The models in this guide are open-weight: their makers publish them, so anyone can run them. That's why there's a choice of route at all. You can rent GLM from Z.ai, or from an independent provider on [Morpheus](https://ownyourmind.ai/projects/morpheus/), and get the same model either way. For agents other than coding agents, our [agent-to-Morpheus hub](https://ownyourmind.ai/use/connect-your-agent-to-morpheus/) covers the set-up.

## Claude Code or opencode?

Both do the same job in your terminal. The differences that matter here are who owns the tool and what it sends home.

| | opencode | Claude Code |
| - | - | - |
| Licence | Open source (MIT), code on GitHub | Anthropic's: "All rights reserved", under its commercial terms |
| Built for | Many providers: 75+ by opencode's own count | Claude models; Anthropic won't support it on other models |
| Reaching Morpheus | Directly | Through a translator such as claude-code-router |
| What the tool itself sends home | Nothing unless you run `/share`, which uploads that session to opencode's servers as a public link | Usage metrics and error reports, which Anthropic says never include your code or prompts and which you can switch off. `/feedback` sends the conversation, code included |

Details are from each project's own repository and docs, read on 3 October 2026. If owning the whole stack is the point, opencode is the better fit. Claude Code makes sense if it's already the tool you know.

## Where your code goes on each route

| Route | Who reads your prompts and code | Works with | Tested by us |
| - | - | - | - |
| The vendor's own API (Z.ai, Moonshot, DeepSeek) | The company that made the model | Claude Code directly, opencode | No: set-up from each vendor's docs, read 3 Oct 2026 |
| [Venice](https://ownyourmind.ai/projects/venice/) | Venice, which says it keeps nothing from models it tags Private | opencode directly, Claude Code through claude-code-router | No: set-up from Venice's docs, read 3 Oct 2026 |
| Morpheus, through your own [Uplink gateway](https://ownyourmind.ai/use/morpheus-uplink-personal-gateway/) | The independent provider serving your session | opencode directly, Claude Code through claude-code-router | Yes, 3 Oct 2026 |
| A model on your own machine | Nobody else | Both, if your hardware can run the model | Not in this guide |

### How private is each route?

A coding agent sends your files to the model a piece at a time, so whoever runs the model can read your code. That includes any API keys, passwords or client work sitting in those files.

- **The vendor's API.** The vendor receives your code, and its own privacy policy decides what it keeps and for how long. Read that policy before you send anything you wouldn't post publicly.
- **Venice.** Venice runs the open-weight models itself and tags them Private, and says it never stores those conversations. We haven't been able to verify that independently. Our [Venice review](https://ownyourmind.ai/projects/venice/) covers its full privacy model.
- **Morpheus.** The provider serving your session can read your prompts, as any server can. It sees your wallet address, not your name or email, and no single company sees all your sessions. Some Morpheus providers run models inside a trusted execution environment, sealed hardware you can check the provider can't look into. Our [Morpheus review](https://ownyourmind.ai/projects/morpheus/) covers how that check works, and our [private AI inference](https://ownyourmind.ai/why-deai/private-ai-inference/) explainer covers the wider picture. We didn't use one of those models in these tests.
- **Your own machine.** Fully private, because your code never leaves it.

## What we tested

We gave each agent the same small job: a Python file with three broken functions and six failing tests, with orders to fix the file without touching the tests. Every run went through our own Uplink gateway to providers on the Morpheus network.

| Agent | Model on Morpheus | Result | Time |
| - | - | - | - |
| opencode | DeepSeek V4 Flash | All 6 tests pass | 49 s |
| opencode | GLM 5.2 | All 6 tests pass | 47 s |
| opencode | DeepSeek V4 Pro | All 6 tests pass | 59 s |
| opencode | Kimi K2.7 Code | All 6 tests pass | 45 s |
| Claude Code, through claude-code-router | DeepSeek V4 Flash | All 6 tests pass | 177 s |

Times include opening a Morpheus session where one wasn't already open, and no run edited the tests. We didn't dig into why Claude Code took longer. The job is small: it shows that each route works, and says little about which model codes best.

## Route 1: opencode on Morpheus

opencode is the easier of the two. It speaks the same format as OpenAI's API, and so does an [Uplink gateway](https://ownyourmind.ai/use/morpheus-uplink-personal-gateway/), so they connect with no translator in between. You add Morpheus as a custom provider in a small settings file, list the models you want, and pick one when you start.

Use the model's ID code, the long string starting with `0x`, rather than its name. Several Morpheus listings share a name, and Uplink can resolve a shared name to a far pricier listing. Your gateway's model list shows each ID.

## Route 2: Claude Code through claude-code-router

Claude Code sends Anthropic-format requests, and a Morpheus gateway only understands OpenAI's format. claude-code-router (CCR) sits on your machine and translates between the two. Claude Code talks to CCR, and CCR talks to Morpheus.

### Read this before you install CCR

CCR's setup wizard changed global settings on our machine without asking first. Moving from "Verify connection" to the "Connect agent" step, with the scope left on its default of "System default", applied its profiles at once:

- It added a block to `~/.claude/settings.json` that points every Claude Code session at CCR on your own machine.
- It created a Codex settings file, `~/.codex/config.toml`, that does the same for Codex.
- Restarting CCR applied both again.

Once CCR stopped, Claude Code and Codex on that machine could not reach any model. CCR does keep backups (`settings.json.ccr-original` next to the file it changed), and restoring from them fixed it.

### The safer set-up

The safer way is to stop the wizard after the provider is saved and launch Claude Code yourself, pointed at CCR for that one session. Nothing global changes.

Anthropic's own gateway documentation says Anthropic won't support routing Claude Code to models other than Claude. Our run worked, but expect rough edges after Claude Code updates. Claude Code warned at the start that it didn't know the model name, then did the job.

## Route 3: Claude Code straight to the vendor

Z.ai, Moonshot and DeepSeek each run an Anthropic-format address, so Claude Code can talk to them with no translator. We haven't tested these. The details below are from each vendor's own page, read on 3 October 2026.

| Vendor | Address for Claude Code | How the vendor sets it up |
| - | - | - |
| Z.ai (GLM) | `https://api.z.ai/api/anthropic` | A script that edits `~/.claude/settings.json` |
| Moonshot (Kimi) | `https://api.moonshot.ai/anthropic` | An `env` block in `~/.claude/settings.json`, plus a clean-up script for old settings |
| DeepSeek | `https://api.deepseek.com/anthropic` | `export` lines in your terminal |

Two of the three change your global Claude Code settings. If you also use Claude Code with your Anthropic plan, put the same values in front of the `claude` command for one session instead, as in Route 2. DeepSeek also says it maps Claude model names to its own: Opus names go to DeepSeek V4 Pro, and Sonnet and Haiku names to DeepSeek's Flash model.

## Route 4: Venice

Venice hosts GLM, Kimi and DeepSeek itself and speaks OpenAI's format, so opencode connects to it directly. opencode lists Venice as a built-in provider, and Venice publishes its own opencode and Claude Code guides. Its Claude Code guide uses claude-code-router too, so the warning in Route 2 applies.

We haven't tested Venice with these coding tools. The details below are from Venice's docs and its live model list, read on 3 October 2026.

## Not sure? Here's how we'd choose

- **Just want a cheaper coding agent?** opencode with the vendor's own API is the shortest path, if you're comfortable sending your code to that company.
- **Already settled on Claude Code?** The vendor's Anthropic address, set for one session at a time.
- **Don't want your code going to the model's maker?** opencode on Venice for the simplest set-up, or on Morpheus if you'd rather no single company served every request. Either is one settings file and no translator.
- **Want Claude Code on Morpheus?** It works through CCR. Skip its Connect agent step.
- **Want it fully private?** Run the model on your own machine. opencode and Claude Code both work with local model servers such as Ollama.

## What it costs

On the vendor routes and Venice you pay per token from an account with that company. On Morpheus you pay in MOR, at prices set by competing providers that change often.

Your gateway locks some MOR as collateral (a stake) for each session it opens, and can estimate that stake before it opens one. The stake comes back after the session closes, part at once and the rest the next day.

If you're weighing this against Anthropic's own plans, our [heavy AI habit costs](https://ownyourmind.ai/journal/what-a-heavy-ai-habit-costs/) piece has three months of our Claude Code usage priced out.

## Troubleshooting

**`opencode run` hangs with no output.** Run from a script, with no terminal attached, it waits for input that never comes. Add `< /dev/null` to the end of the command.

**Claude Code can't connect after you tried CCR.** Look in `~/.claude/settings.json` for an `env` block pointing at `127.0.0.1:3456`. Restore `settings.json.ccr-original` if it's there, or delete that block. Check `~/.codex/config.toml` for a block marked "CCR managed" as well.

**"Model not found" through Uplink.** Use the `0x` model ID, not the name.

**Slow first answer.** On Morpheus the first request to a model opens a session on-chain before any answer comes back. Later requests reuse that session.
