Ask whether Claude Code works with non-Anthropic models and you get two confident answers. The first says no: it is Anthropic's tool, end of story. The second says sure, set three environment variables and walk away. Both are half right, and neither tells you the part that actually matters for agent workflows: what the subagents run on.
So we tested it. Claude Code 2.1.300, Kimi K3 behind Wallaby Token's Anthropic-compatible endpoint, and a small logging proxy between them recording the model field of every request that hit the wire. We trusted nothing the client said about itself, only what it sent. Disclosure: Wallaby Token sells API access to kimi-k3, and the examples below use our endpoint.
Setup: three variables, plus one for the background jobs
export ANTHROPIC_BASE_URL="https://api.wallabytoken.com"
export ANTHROPIC_AUTH_TOKEN="sk-your-wallaby-key"
export ANTHROPIC_MODEL="kimi-k3"
export ANTHROPIC_SMALL_FAST_MODEL="kimi-k3"
The base URL has no /v1 suffix; Claude Code appends /v1/messages itself. One gateway, two protocols: this Anthropic-compatible endpoint and the OpenAI-compatible /v1/chat/completions from our other guides are the same service, and Claude Code speaks the former. The fourth variable covers the small auxiliary calls Claude Code makes in the background; leave it unset and those calls reach for a model name your gateway may not carry. The full first-contact walkthrough is in our Claude Code setup guide.
Verdict one: yes, everything runs on K3
We gave the agent a throwaway task with a known answer (count the files in a test directory; there were six) and told it to delegate the counting to an Explore subagent via the Task tool:
claude -p "Use the Task tool exactly once with subagent_type 'Explore'
(prompt: 'count the files in the current directory, just reply with the
number'). Then tell me the number." --max-turns 8
The subagent answered six, which matched ls | wc -l. More important than the answer: the proxy log. Seven requests, and every single one — main loop, subagent spawn, background auxiliary calls — carried model: "kimi-k3". Nothing silently fell back to an Anthropic model. The "locked ecosystem" camp is simply wrong on current versions.
Verdict two: the subagent model knob is not where the internet says
Here is where it gets interesting. Community threads point at environment variables like CLAUDE_CODE_SUBAGENT_MODEL or CLAUDE_CODE_WORKFLOW_SUBAGENT_MODEL to pin subagents to a specific model. Both strings genuinely exist in the 2.1.300 binary — we ran a strings pass over the installed CLI bundle and they are right there. So we set one of them to a model name that does not exist, kimi-k3-bogus, and reran the Task delegation.
Ten requests. All ten still kimi-k3. The variable changed nothing on the wire. The second variable, same result.
The knob that actually works lives in the agent definition file:
---
name: cheapscout
description: Fast scouting agent for file surveys.
model: kimi-k3
---
Survey the files you are given and report counts only.
Save that as .claude/agents/cheapscout.md and the model: frontmatter line goes straight onto the wire. We proved it from the other direction too: an agent definition pinned to kimi-k3-bogus produced exactly one request carrying the bogus name, the gateway rejected it with a 403, and the main agent shrugged, counted the files itself, and still answered. From the proxy log of that run (fields trimmed for readability):
{"ts": "00:16:04", "path": "/v1/messages?beta=true", "req_model": "kimi-k3-bogus", "status": 403}
{"ts": "00:16:04", "path": "/v1/messages?beta=true", "req_model": "kimi-k3", "resp_model": "moonshotai/kimi-k3", "status": 200}
{"ts": "00:16:08", "path": "/v1/messages?beta=true", "req_model": "kimi-k3", "resp_model": "moonshotai/kimi-k3", "status": 200}
One 403 for the bogus name, then the main loop carries on with kimi-k3 and finishes the job. The wire, not the client's self-report, is the whole argument.
If you remember one thing: env vars steer the whole client, frontmatter steers one subagent. Test any claim about either with a bogus name; the wire never lies, and a fake model is the cheapest probe there is.
Smaller things worth knowing
- Claude Code does not recognize the string
kimi-k3, prints a warning, and assumes a 200k context window. Harmless here, since K3's window is 1M tokens, but the warning will follow you around. - In print mode (
claude -p), Task subagents now run in the background by default in 2.1.300; the main loop says "the agent is running in the background" and picks the result up on a later turn. - 2.1.300 also prints a notice about its new auto-mode classifier billing. The short version: the new billing terms come from Anthropic's side, so they do not reach requests that go through your own gateway. Nothing breaks; the classifier calls simply keep consuming your own gateway tokens, exactly as they did before the notice existed.
What this buys you
Claude Code's subagent architecture on an open-weight model, at a price that makes delegation cheap enough to use casually. Kimi K3 on Wallaby runs at 10% off the official list — $2.70 per million input tokens, $13.50 per million output, $0.27 on cache hits — with per-token metering and itemized statements. New accounts get $0.50 in free credit, no card required: create a key, set four variables, and your next -p run can be the probe from this post.
Every request lands on your invoice as an itemized line with token counts — no content logs, no training on your data, no usage reports built from your traffic. We host open-weight models only, keep a public status page, and run our own work through the same gateway we sell.