Running Qwen3 Coder 30B as a cheap subagent for Claude Code, Codex and opencode A developer demonstrated running Qwen3 Coder 30B, a 30B mixture-of-experts coding model with tool calling, as a low-cost subagent behind Claude Code, Codex CLI and opencode via an OpenAI-compatible endpoint on Synap. In a Codex test, fixing a one-character bug in is_even() consumed 49,245 input tokens and 722 output tokens, costing roughly $0.0035 per task at $0.0675 per 1M input and $0.27 per 1M output, with the developer noting that agent system prompts and tool definitions dominate token use. The writeup also documents a Claude Code run that fixed a bug in six turns and 11.3 seconds, and a free tier of 100,000 tokens and 50 requests per day. Big frontier models are great at planning a change across a codebase. They are expensive overkill for "add type hints to this file", "fix the off-by-one in is even " or "write two doctests". This post shows how to hand that second kind of work to Qwen3 Coder 30B a 30B mixture-of-experts coding model with tool calling through an OpenAI-compatible endpoint. It covers three agents, Claude Code, Codex CLI and opencode, plus a 40-line Python "subagent" you can call from any of them. Everything below was run on 2026-11-11 against https://synap402.com/v1 Synap https://synap402.com , the API we build . The token counts and prices are copied from those runs. From curl -s https://synap402.com/v1/models today: | model | input / 1M tokens | output / 1M tokens | batch 24h in / out | context | |---|---|---|---|---| | qwen3-coder-30b | $0.0675 | $0.27 | $0.03375 / $0.135 | 98,304 | It supports tools , tool choice auto , required , response format with json schema , and streaming. There is also a free tier on this model: 100,000 tokens and 50 requests a day per account Google sign-in, no card . It allows 10 requests a minute per key and 4,096 output tokens per answer. As you'll see below, one coding-agent task can use half of that, so it's for trying things out, not daily work. Claude Code speaks Anthropic's Messages API, and the endpoint serves /v1/messages too. Five environment variables: export ANTHROPIC BASE URL=https://synap402.com no /v1, Claude Code appends /v1/messages export ANTHROPIC AUTH TOKEN=$SYNAP API KEY export ANTHROPIC MODEL=qwen3-coder-30b export ANTHROPIC DEFAULT HAIKU MODEL=qwen3-coder-30b its own background tasks export CLAUDE CODE MAX CONTEXT TOKENS=98304 otherwise it warns about an unknown model I gave it a file with a deliberate bug: python mathx.py def add a, b : return a - b claude -p "mathx.py has a bug in add . Fix it, then reply with one line saying what you changed." \ --allowedTools "Read,Edit" --output-format json Result on Claude Code 2.1.322: 6 turns, 11.3 seconds, "is error": false , and the file now says return a + b . The model read the file, called Claude Code's own Edit tool and reported back. Claude Code also prints a costUSD estimate for a model it doesn't know. Ignore it and use the usage the API reports instead. Codex talks to the Responses API /v1/responses . Add one provider block to ~/.codex/config.toml : model provider = "synap" model = "qwen3-coder-30b" model providers.synap name = "Synap" base url = "https://synap402.com/v1" env key = "SYNAP API KEY" wire api = "responses" Then: python printf 'def is even n :\n return n %% 2 == 1\n' evens.py codex exec --json --skip-git-repo-check -s workspace-write \ "evens.py has a bug in is even . Fix it."