Back to guides
Compare·September 21, 2026·9 min read

Nanocoder vs OpenCode: workflow, models and total cost

OpenCode is the default and Nanocoder a deliberate minority choice; this compares what each one can reach, what each one restricts, and what the tokens underneath cost.

Last reviewed on .

OpenCode is the default answer and Nanocoder is the deliberate minority one: on September 19, 2026 OpenCode carried 208,444 GitHub stars to Nanocoder's 2,487, and its npm package was downloaded 9,436,914 times in the 30 days to September 16 against Nanocoder's 6,614. Both are free, MIT-licensed terminal coding agents that let you point at a custom API endpoint. Choosing between them is not a quality ranking — it is a choice between the widest surface with two first-party products competing for your token spend, and a narrower surface run by a collective that sells nothing.

Treat those download figures as orders of magnitude rather than user counts. OpenCode also installs through a curl script and Homebrew, and CI runners inflate any npm number, while Nanocoder ships through Homebrew and Nix outside npm as well. The ratio is directionally solid; the absolute counts are not.

First, make sure you are comparing the right two projects

Three name collisions sit directly in the search results for this comparison, and two of them will break a setup rather than merely confuse you.

Name you may have foundWhat it actually isIs it in this comparison?
anomalyco/opencodeThe TypeScript OpenCode at opencode.ai. Not archived, MIT, default branch devYes — this is the OpenCode meant here
opencode-ai/opencodeThe original Go CLI. Archived, 13,752 stars, last push September 18, 2025; its README sends readers to CrushNo. See the directory entry
OpenCoderAn open code large language model family, not a CLI. No config file, no provider setting, no BYOK storyNo. Its benchmark scores say nothing about the agent
Nano-Collective/nanocoderNanocoder, npm @nanocollective/nanocoder, docs at docs.nanocollective.orgYes — this is the Nanocoder meant here
nanocode-project/nanocodeA separate near-dormant Python project, created April 1, 2026, pushed once more the next dayNo. See the directory entry

One more change worth knowing before you follow an older tutorial. The repository many guides still call sst/opencode now 301-redirects to anomalyco/opencode, and the sst GitHub organization is empty with a description reading that it has moved to anomalyco (GitHub API, September 19, 2026). OpenCode's own docs corroborate it in the install commands — brew install anomalyco/tap/opencode, ghcr.io/anomalyco/opencode — and every docs page is footered as copyright Anomaly. The product name did not change, only the organization. A rename date circulates on social media; it could not be verified here, so none is published on this page.

Who should pick which

Start from your default model, not from the feature list. If your day already runs on a hosted frontier model and local inference is an occasional experiment, OpenCode's posture matches yours. If your day runs on Ollama, llama.cpp, LM Studio, vLLM or MLX and a hosted API is the exception, Nanocoder's does — though this is a difference of default, not of capability, because OpenCode documents Ollama, LM Studio and llama.cpp base URLs too.

If this is true of youPickBecause
You want the agent in a TUI, a desktop app and an IDE extension, plus a server and pluginsOpenCodeNanocoder ships a terminal TUI with --vscode and an ACP server for Zed; that is the whole surface
You need declarative, reviewable permissions per tool and per agentOpenCodeRules are data: allow/ask/deny per tool with bash wildcards, checked into the repo
You want shell commands confined by the operating system, not by a promptNanocodernanocoder.sandbox wraps execute_bash in sandbox-exec or bwrap; OpenCode has no equivalent flag in its permissions docs
Your gateway serves /v1/responses and you want that wire formatOpenCodeNanocoder's provider union has no generic Responses option
You want your agent's maintainer to have no stake in which tokens you buyNanocoderThere is no Nanocoder account, tier or gateway. OpenCode ships two
You are standardising a team and need SSO and org-wide enforced configOpenCodeThat is exactly what OpenCode Enterprise gates, per-seat at an unpublished price
You want one extension model instead of several subsystemsNanocoderSkills are the single umbrella for commands, subagents, tools and triggers
You want the larger pool of issues, examples and third-party integrationsOpenCodeThe adoption gap above is the whole argument, and it is a real one

Migration cost is symmetric and small at the provider layer, and asymmetric above it. A custom endpoint is one JSON block in either client, so moving a gateway across takes minutes. What does not port is what you built on top: Nanocoder Skills bundles under .nanocoder/skills/ and its lifecycle hooks — where a pre-tool-use hook exiting non-zero denies the call and tells the model why — have no OpenCode equivalent to paste into, and OpenCode's per-agent permission blocks, plugins and LSP configuration have no Nanocoder equivalent. Count that work before you count the config lines.

How the two clients actually differ

DimensionNanocoderOpenCode
Repository and licenceNano-Collective/nanocoder, MIT per package.json, and the MIT text sits in LICENSE.md. GitHub's own detector still reports NOASSERTION for the repositoryanomalyco/opencode, MIT per the GitHub API
Current releasev1.30.0, August 26, 2026; npm @nanocollective/nanocoder 1.30.0 same dayv1.18.31, September 14, 2026; npm opencode-ai 1.18.31 same day
RuntimeNode >= 22 per package.jsonInstalls via curl script, npm, Homebrew, mise or Docker, per the install docs
SurfacesTerminal TUI, --vscode, --acp for ZedTerminal TUI, desktop app, IDE extension, plus CLI, web, server, SDK and plugins
Config fileagents.config.json — project dir, or per-OS config dir; NANOCODER_CONFIG_DIR skips all other lookupsopencode.json or ~/.config/opencode/opencode.json, JSON or JSONC, with {env:VAR} and {file:path} interpolation
Config precedenceResolved block by block: the highest-precedence file defining a block supplies the whole block, and omitted fields fall back to built-in defaults rather than to a lower fileEight layers merged, not replaced — later configs override earlier ones only for conflicting keys
Execution controlFour global modes toggled with Shift+Tab: Normal, Auto-Accept (bash and destructive git still prompt), Yolo, PlanDeclarative per-tool rules across read, edit, bash, webfetch, task, skill, lsp and more, each allow/ask/deny, with wildcards and per-agent overrides
OS-level sandboxnanocoder.sandbox, off by default: sandbox-exec on macOS, bwrap on Linux, unsupported on Windows. The docs call it explicitly not a secrets boundary — reads are not blockedNot offered as a flag in the permissions documentation; doom_loop and external_directory default to ask and .env reads are denied
Headlessnanocoder run "..." auto-accepts and exits; --plain --json emits one JSON object with the answer, the tool log and modified files. The turn cap nanocoder.maxTurns defaults to 200, and NANOCODER_MAX_TURNS overrides itopencode run "..." is the documented non-interactive equivalent, with --format json for machine-readable output — raw JSON events rather than one summary object. Server, SDK, GitHub and GitLab surfaces are documented alongside it
ExtensionsSkills as one umbrella for commands, subagents, tools and triggers, plus lifecycle hooks and MCPSeparate subsystems: plugins, agent skills, LSP servers, MCP servers, ACP
First-party paid productsNone. No account, no tier, no gatewayZen (pay-as-you-go), Go ($10 a month), Enterprise (per seat, unpublished)

Sources for this table, all read September 19, 2026 unless noted: the GitHub API, the npm registry, Nanocoder's configuration and features docs, and OpenCode's config, permissions and CLI pages.

Pointing either one at your own API endpoint

Both document a custom endpoint, so a gateway is a supported configuration in either. The difference is how many wire formats you can reach.

OpenCode names an npm package in the provider block and that choice selects the protocol: @ai-sdk/openai-compatible speaks /v1/chat/completions, and @ai-sdk/openai speaks /v1/responses. Kunavo serves both, so this is a real choice rather than a formality.

opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "kunavo": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Kunavo",
      "options": {
        "baseURL": "https://api.kunavo.com/v1",
        "apiKey": "{env:KUNAVO_API_KEY}"
      },
      "models": {
        "claude-sonnet-4-6": {
          "name": "Claude Sonnet 4.6",
          "limit": { "context": 200000, "output": 64000 }
        }
      }
    }
  }
}

Two details the providers page is explicit about and that matter for any endpoint it does not already know. First, register the key with /connect, scroll to Other and use the same provider id you used in the file; credentials land in ~/.local/share/opencode/auth.json. Second, the limit block is worth setting here — the docs say standard providers pull context and output limits from models.dev automatically, and Kunavo is not one of them. The values in the block above are the docs' own example figures, not this model's published limits; set them from the model's own page before you rely on the context meter.

Nanocoder's equivalent lives under nanocoder.providers. Note the lowercase baseUrl, which differs from OpenCode's baseURL, and the ${VAR} substitution applied recursively to string fields.

agents.config.json
{
  "nanocoder": {
    "providers": [
      {
        "name": "Kunavo",
        "sdkProvider": "openai-compatible",
        "baseUrl": "https://api.kunavo.com/v1",
        "apiKey": "${KUNAVO_API_KEY}",
        "models": ["claude-sonnet-4-6"],
        "contextWindow": 200000
      }
    ]
  }
}

Three Nanocoder-specific traps are worth reading before you paste that in. The sdkProvider union is closed at five values in source/types/config.tsopenai-compatible, google, anthropic, chatgpt-codex and github-copilot — and the fourth is wired to a browser login against ChatGPT's own Codex endpoint rather than an arbitrary base URL, so there is no generic Responses option to declare. If you instead point sdkProvider: "anthropic" at an Anthropic-compatible endpoint, Nanocoder's own provider docs warn that @ai-sdk/anthropic derives the output ceiling from the model id and falls back to 4096 tokens for anything it does not recognise as a Claude model, truncating long replies mid-sentence with no error; the fix is an explicit maxOutputTokens on the provider entry. And because settings resolve block by block, a project-level file that defines nanocoder.providers supplies that whole block — sibling entries in your global config are not merged in. nanocoder config diff is the documented way to see what actually resolved.

Neither snippet has been runtime-tested against Kunavo's endpoint. Kunavo publishes a setup guide for OpenCode, which is a configuration reference rather than a compatibility test, and publishes none for Nanocoder. Treat both blocks as starting points, run one bounded task, and read what your account actually recorded.

One shared gap: neither client knows your gateway's model metadata

Both clients lean on models.dev for context limits, output ceilings and per-token cost. That file listed 222 providers when checked on September 19, 2026, and Kunavo is not among them — the reason for the absence is not something this page can establish. The consequence differs slightly by client but applies equally to both, so it is not a reason to prefer one.

In OpenCode, declare limit.context and limit.output per model or the remaining-context indicator budgets against a default that is not your model's. In Nanocoder, set contextWindow or per-model contextWindows; its per-response footer prints a token count and an estimated cost priced from models.dev, and its documentation is careful to say the cost segment is omitted when no pricing is available, so a missing number means unknown rather than zero. Either way, the client's figure is its own arithmetic over reported tokens — reconcile against your provider's ledger, not against the footer.

What each one costs you

Both clients are free. The asymmetry is what sits behind them.

Nanocoder has no account, no tier, no hosted service and nothing to upgrade to — its README states there are no paid tiers gating the useful parts, and the project describes itself as funded by sponsors rather than by users. One disclosure belongs here: Atlas Cloud is a listed sponsor, and it also appears in Nanocoder's own supported-provider list and sells a coding plan. That is a non-neutral incentive in an otherwise vendor-free project, and you should know about it rather than not.

OpenCode is free too, but the same vendor sells two products that compete for exactly the spend a gateway wants. Neither is required: the docs describe both as optional, and Zen's goals page commits to letting you use any other provider with OpenCode.

ProductPublished priceWhat you should actually budget
Nanocoder$0, MITModel tokens at whatever provider you configure, or hardware and power for local models
OpenCode$0, MITSame — the client itself bills nothing
OpenCode Go$10 a monthThe fixed shelf the docs call open coding models, which is not open-weight only — Grok 4.6 and GPT 5.6 Luna are listed on it. Each model carries a monthly cap of $15 to $60, with 5-hour at 20% of that cap and weekly at 50%. Only one member per workspace can subscribe
OpenCode ZenPay as you go, per 1M tokensClaude Opus 5 at $5.00 in / $25.00 out; Claude Sonnet 5 at $2.00 / $10.00; Claude Haiku 4.5 at $1.00 / $5.00. Auto-reload adds $20 whenever the balance drops below $5
OpenCode EnterprisePer seat, no figure publishedSSO, org-wide config and forcing traffic through one internal gateway. The page states that if you have your own gateway, tokens are not charged

Read September 19, 2026. Two things this table is careful about. Zen's goals page states an intention to pass on price drops by selling at cost, with markup only to cover processing fees. The three Claude rates it publishes do line up with Anthropic's own published rates for those models — Opus 5 at $5 / $25, Sonnet 5 at $2 / $10, Haiku 4.5 at $1 / $5 — so on those three, a comparison against Zen is a comparison against the model vendor's rate card. That check was made only for those three models, on September 19, 2026, and says nothing about the rest of Zen's shelf. And Zen's free models carry data-use strings printed on the same page, ranging from data being used to improve the model during a free period to trial-only endpoints that tell you not to submit confidential data. A free tier with training rights attached is a different product from a free tier without them.

A worked estimate for the token bill underneath either client

This is illustrative token arithmetic, not a measured task cost and not a bill ceiling. Assume one session that sends 200,000 uncached input tokens and receives 15,000 output tokens. Rates come from the live Kunavo catalog per million tokens; your real sessions will differ with repository size, tool output and how often the agent re-reads files.

ModelInput / output per 1MEstimated cost, one sessionSessions modelled per $10 of credit
Claude Haiku 4.5$0.40 / $2.00$0.11090
Gemini 3.8 Flash$0.525 / $2.625$0.14469
GPT-5.6 Terra$0.70 / $4.20$0.20349
Claude Sonnet 4.6$1.20 / $6.00$0.33030
Claude Opus 5$2.00 / $10.00$0.55018

The comparison people actually want here is against OpenCode Go's $10 a month, and it is not like for like. Go serves a fixed shelf under per-model monthly caps of $15 to $60: its own usage-limits table lists no Claude model and no Gemini model, its one GPT entry is GPT 5.6 Luna, and Grok 4.6 sits on it too — so the docs' phrase "open coding models" does not mean open weights only (checked September 19, 2026). The models above are a different shelf entirely. On these assumptions, $10 of prepaid Kunavo credit models roughly 90 sessions of that shape on Claude Haiku 4.5 at $0.110 each, and about 18 on Claude Opus 5. That sizes a budget; it does not tell you which produces better work on your repository, and cheapest listed rate is not the same question as lowest cost to finish the task — a cheaper model that needs three attempts can cost more than one that needs one.

The like-for-like line is Zen's pay-as-you-go shelf, where the same model appears on both sides. Zen publishes Claude Opus 5 at $5.00 per million input tokens and $25.00 per million output; Kunavo's catalog currently reads $2.00 and $10.00 for the same model. That is the comparison worth making, and it is worth reading carefully: Zen's $5.00 / $25.00 is Anthropic's own published rate for this model, so this is two catalogs pricing the same model differently rather than a padded reseller being undercut. Confirm both in checkout before you move a budget, because either catalog can reprice.

Kunavo's catalog amount is a billing floor rather than a cap: when the upstream reports its charge, the bill is the greater of catalog cost and upstream cost times the applicable markup. Cache charges and external tools sit outside this example. The minimum top-up is $10 in prepaid credit, which is a funding minimum rather than a task fee or a subscription.

Setting up the one you picked

If you landed on OpenCode, the configuration block above is the whole integration and the OpenCode integration guide covers both wire formats in detail; create a Kunavo account when you are ready to fund a key. If you landed on Nanocoder, use the same base URL through its openai-compatible provider and keep a working route available while you try it — no Nanocoder-to-Kunavo runtime test has been performed here.

Still deciding? OpenCode alternatives widens the field beyond these two, the best API for OpenCode compares provider routes for that client specifically, OpenCode pricing goes deeper on Zen and Go, and the agent API directory records how every client in this space handles a custom base URL. If a provider block is already failing, OpenCode provider not found covers the usual cause, and OpenAI-compatible API explains what that phrase does and does not guarantee.

FAQ

Is Nanocoder or OpenCode better?

Neither is better in the abstract, and they are not equally adopted. OpenCode is the mainstream choice: 208,444 GitHub stars and 9,436,914 npm downloads for opencode-ai in the 30 days to September 16, 2026, against 2,487 stars and 6,614 downloads for @nanocollective/nanocoder over the same window. Pick OpenCode when you want the wider surface — TUI, desktop, IDE extension, server, plugins, GitHub and GitLab integrations, and a config system built for org-wide control. Pick Nanocoder when local models are your default rather than a fallback, when you want an OS jail around shell commands, or when you would rather your agent's maintainer not also be selling you tokens. Download counts are inflated by CI and by parallel install channels, so read them as orders of magnitude and not as user counts.

Is Nanocoder the same project as nanocode?

No, and confusing them will break your setup. Nanocoder is Nano-Collective/nanocoder, published to npm as @nanocollective/nanocoder, documented at docs.nanocollective.org. nanocode is nanocode-project/nanocode, a separate near-dormant Python project created April 1, 2026 with its last push a day later. Their install commands, config files and base-URL settings are mutually incompatible, and nanocode's advertised OpenAI compatibility does not exist in its code — it wraps the Anthropic SDK, so a plain chat-completions endpoint will not work with it.

Which OpenCode is this — the Go one or the TypeScript one?

The TypeScript one. The repository that used to sit at sst/opencode now 301-redirects to anomalyco/opencode, and the sst GitHub organization is empty with a notice reading that it has moved to anomalyco. The product name is still OpenCode; the docs at opencode.ai use anomalyco install paths and are footered as copyright Anomaly. A different project, opencode-ai/opencode, is an archived Go CLI whose last push was September 18, 2025 and whose README directs users to Crush. Its config format and provider list do not apply to the current OpenCode.

Can Nanocoder and OpenCode both use a third-party API gateway?

Yes, both document a custom endpoint, but the reachable protocol surface differs. OpenCode picks the wire format by naming an npm package in the provider block: @ai-sdk/openai-compatible for /v1/chat/completions, @ai-sdk/openai for /v1/responses, per its providers documentation. Nanocoder's sdkProvider union is closed at five values in source/types/config.ts — openai-compatible, google, anthropic, chatgpt-codex and github-copilot — and chatgpt-codex is bound to a browser login against ChatGPT's own Codex endpoint rather than an arbitrary base URL, so there is no generic Responses option. A gateway that serves /v1/responses has to be reached through its chat-completions face in Nanocoder.

Does OpenCode force you to buy OpenCode Zen or OpenCode Go?

No. OpenCode's own documentation describes Zen and Go as optional, and Zen's goals page commits to letting you use any other provider with OpenCode. The commercial gate is OpenCode Enterprise, priced per seat with no published figure, and what it gates is central control — SSO, org-wide config, forcing traffic through one internal gateway — rather than the ability to configure a custom endpoint. Zen's goals page also states an intention to pass on price drops by selling at cost, with markup only to cover processing fees; the three Claude rates it publishes match Anthropic's own published rates for those models, checked September 19, 2026.

Why does my model show no cost or the wrong context limit in either client?

Because both clients read model metadata from models.dev, whose api.json listed 222 providers when checked on September 19, 2026 and does not include Kunavo. In OpenCode you declare models.<id>.limit.context and .limit.output by hand, because the docs state that only standard providers pull those from models.dev automatically; omit them and the client budgets remaining context against a default that is not your model's. In Nanocoder you set contextWindow or per-model contextWindows, and its per-response cost footer simply prints nothing when no pricing is available — its documentation is explicit that a missing number means unknown, never zero.

How much does it cost to switch from one to the other?

The provider block is the easy part; the agent instructions and extensions are not. Both take a JSON config with a base URL, a key and a model list, so re-declaring a gateway is a ten-minute job in either direction. What does not port is everything built on top: Nanocoder's Skills bundles under .nanocoder/skills/ and its lifecycle hooks have no OpenCode equivalent to copy into, and OpenCode's per-tool permission rules, agent definitions, plugins and LSP wiring have no Nanocoder equivalent either. Budget the migration by how much of that you have written, not by the provider block.

Repository, release and download figures read from the GitHub API and the npm registry on September 19, 2026; behaviour and price claims read from both projects' own documentation on the same date, and the models.dev provider list checked then too. Neither client was runtime-tested against Kunavo's endpoint, no performance or compatibility testing was performed, and every dollar figure for Kunavo on this page is illustrative token arithmetic from the live catalog rather than a measured task cost.