OpenCode: Install It Free, Zen vs Go Pricing, Free Models, and Ollama or AWS Bedrock Setup (2026)

Logeshwaran
—

OpenCode is a free, open-source AI coding agent: it reads your project, edits files and runs commands from your terminal, a desktop app or your code editor. It is MIT-licensed, has more than 211,000 stars on GitHub, and works with almost any AI model, so the program costs nothing and you choose how to pay for the AI. There are four ways: OpenCode Zen (pay per use, with a handful of free models), OpenCode Go ($10 or $40 a month for open coding models), your own provider such as Amazon Bedrock, or free local models through Ollama. The surprise comes before any of that: out of the box, OpenCode lets the AI edit your files and run shell commands without asking. Most of its permissions default to "allow." One short setting makes it ask first, and it is the first thing we change on any new install. Below: how to install OpenCode on Windows, Mac and Linux, Zen versus Go pricing, which models are free, the safe settings, and the exact setup for Ollama and AWS Bedrock.

Jake's shop has a small website, a folder of pages and photos that his nephew built years ago. Ethan suggested OpenCode for the jobs nobody had time for, and on Sunday evening Jake installed it, picked one of the free models, and typed: "Tidy up the website folder. Remove the old photos we don't use." The agent worked fast. It listed files, decided which photos looked unused, and deleted them, then started renaming pages to "cleaner" names, before Jake had finished reading what it was doing. The home page lost half its pictures. Ethan restored the folder from its Git history in two minutes, then changed one line in OpenCode's settings. "It did what you asked," he said. "It just didn't check with you first. Now it will."

Update, October 20, 2026: OpenCode Console security breach. On the night of October 16, an intruder reached a legacy system behind OpenCode Console, the optional hosted dashboard. AI provider API keys that workspaces had saved in Console (OpenAI, Anthropic and Google keys) may have been exposed, and about 1.4% of Console users got a notice by email on October 17. Some of them report charges they did not make. The notice covers Console only: the free CLI and desktop apps keep keys you add with opencode auth login on your own machine.

If you ever saved a provider key in Console: revoke it in that provider's own dashboard (deleting it in Console does not revoke it), create a new key, update every tool and script that used the old one, check usage and billing back to October 16, and set a monthly spend limit or alert. One key per tool makes the next leak much easier to contain.

⚡ Quick Answer

• Install → curl -fsSL https://opencode.ai/install | bash on Mac and Linux; npm install -g opencode-ai works everywhere. Every method.

• Is OpenCode free? → the app, yes. The AI costs money unless you use a free model or Ollama. Zen vs Go vs your own key.

• Make it ask before acting → set "bash": "ask" and "edit": "ask" in opencode.json. The safe settings.

• Ollama not working? → raise Ollama's context to 64K; it defaults to 4K on most PCs. Local setup.

Company on AWS? Connect OpenCode to Amazon Bedrock with your existing credentials.

🧭 NEW HERE? READ THESE FIRST

New to AI coding tools or local models? These five pages cover the basics this one builds on:

📌 Bookmark this; the permission setting is the one to copy before your first session.

What OpenCode is, in plain English

A coding agent is an AI that does more than chat about code. You describe a job in plain words, and it reads the files in your project, writes changes, runs commands in a terminal to test them, reads the results, and keeps going until the job is done or it gets stuck. It is the difference between asking a friend for directions and handing them the car keys.

OpenCode is one of the most popular coding agents, and it stands out in three ways:

  • It is open source. The code is on GitHub under the MIT license, in the anomalyco/opencode repository, with more than 211,000 stars. Anyone can read exactly what it does with your files.
  • It is not tied to one AI company. It works with dozens of providers, from OpenAI and Google models to open models such as Kimi K3, GLM-5.3, DeepSeek and Qwen, Amazon Bedrock, and models running on your own PC.
  • It runs where you work: as a terminal app (its main form), a desktop app, or an extension inside your code editor.

On data, OpenCode itself does not store your code or conversations on its servers. Your prompts go straight from your machine to whichever AI provider you picked. The one exception is the optional /share command, covered below.

"So it's like a very fast apprentice," Jake said.

"A very fast apprentice with your house keys," Ethan said. "Brilliant, tireless, and occasionally confident about the wrong thing. You'd still want it to ask before knocking down a wall."

Which OpenCode? The old project with the same name

Search for OpenCode on GitHub and you will find two. The one this page covers, and the one everyone means today, is anomalyco/opencode, with its website at opencode.ai. There is also an older project, opencode-ai/opencode, a terminal agent written in Go that was archived. The project continues under a new name, Crush, from its original author and the Charm team. If a tutorial shows a different install command, a different config file, or talks about OpenCode being "written in Go," it is probably about the old project.

How to install OpenCode on Windows, Mac and Linux

OpenCode runs on macOS, Linux and Windows. The latest version at the time of writing is v1.18.34, released September 30, 2026; it updates often, so check with opencode --version after installing.

Mac and Linux, including Kali and Ubuntu

The quickest route is the official install script:

curl -fsSL https://opencode.ai/install | bash

Or use a package manager you already have:

  • npm (any system with Node.js): npm install -g opencode-ai. Bun, pnpm and Yarn work too, with the same package name.
  • Homebrew on macOS and Linux: brew install anomalyco/tap/opencode. OpenCode recommends its own tap; the plain brew install opencode formula is maintained by Homebrew and updates less often.
  • Arch Linux: sudo pacman -S opencode for the stable version, or paru -S opencode-bin from the AUR for the latest.

OpenCode looks best in a modern terminal such as WezTerm, Alacritty, Ghostty or Kitty. The default terminal on most Linux desktops works fine for getting started.

Windows 11 and 10

OpenCode runs on Windows directly, but WSL (Windows Subsystem for Linux) is the recommended route for better file performance and full compatibility. Our WSL guide covers the setup. Inside WSL, use the same install script as Linux, and reach your Windows files through paths such as /mnt/c/Users/YourName/project.

If you prefer to stay in plain Windows, any of these work:

  • npm: npm install -g opencode-ai
  • Chocolatey: choco install opencode
  • Scoop: scoop install opencode
  • Mise: mise use -g github:anomalyco/opencode
  • Docker: docker run -it --rm ghcr.io/anomalyco/opencode
  • A ready-made binary from the project's GitHub Releases page. Installing with Bun on Windows is not supported yet.

There is also an OpenCode Desktop app. If you like it but want the agent to run in WSL, start the server inside WSL with opencode serve --hostname 0.0.0.0 --port 4096, set the OPENCODE_SERVER_PASSWORD environment variable first so nobody else on your network can use it, and point the desktop app at http://localhost:4096.

First run: connect a model, then /init

  1. Open your project folder in the terminal and start OpenCode:
    cd /path/to/your/project
    opencode
  2. Connect a model provider by typing /connect. Pick OpenCode Zen, OpenCode Go, a provider you already pay for, or skip ahead to the Ollama section for a free local model. Paste the API key when asked.
  3. Pick a model with /models.
  4. Run /init. OpenCode studies your project and writes an AGENTS.md file describing its structure and conventions. Commit that file to Git; it helps every future session start smarter.
  5. Use Plan mode for anything big. Press Tab to switch to Plan mode, where the agent cannot change anything and only explains how it would do the job. Read the plan, adjust it, then press Tab again to let it build.

Two small habits help from day one. Type @ to search for a file and attach it to your question. And if a change goes wrong, /undo removes your last message, the replies after it and any file changes they made, with /redo to bring them back. Undo uses Git under the hood, so your project needs to be a Git repository; run git init first if it is not.

The safe settings: make OpenCode ask before it acts

Here is the setting that would have saved Jake's photos. OpenCode decides what the AI may do through a permission setting, and each action resolves to one of three answers: allow (do it), ask (check with you), or deny (never). If you have not configured anything, the defaults are permissive:

  • Most permissions default to allow, including editing files and running shell commands.
  • Only two default to ask: external_directory (touching files outside your project) and doom_loop (the agent repeating the same failing action over and over).
  • Reading files is allowed, except .env files, which are blocked by default because they usually hold passwords and API keys.

That is a sensible default for experienced developers who work in Git and review every change. For anyone else, it is too trusting. Create or open opencode.json in your project (or the global one, below) and add:

{
  "$schema": "https://opencode.ai/config.json",
  "permission": {
    "bash": "ask",
    "edit": "ask"
  }
}

Now OpenCode stops and shows you each command and each file change before it happens. It is slower, and that is the point while you learn how a model behaves. Once you trust a setup, you can relax specific rules; for example, OpenCode accepts patterns such as "git status *": "allow" for safe commands.

Where the config files live:

  • Per project: opencode.json in the project folder.
  • Global, Mac and Linux: ~/.config/opencode/opencode.json (or .jsonc).
  • Global, Windows: press Win+R and paste %USERPROFILE%\.config\opencode\opencode.jsonc.

Two more switches worth knowing. Starting OpenCode with --auto approves every request that is not explicitly denied; it is handy in a throwaway sandbox and risky anywhere else. And always work inside a Git repository, so any change, good or bad, can be undone in seconds. That is what saved Jake's website.

What /share does with your conversation

The /share command creates a public link to your session at opncd.ai/s/... and copies your conversation to OpenCode's servers so the link works. Anyone with the link can read it. Sharing is manual by default, so nothing is shared unless you type the command, but a config setting of "share": "auto" would share every new session. For work projects, OpenCode itself recommends turning it off entirely with "share": "disabled".

Is OpenCode free? Zen vs Go vs your own key vs local

The OpenCode app is free and always will be under its MIT license. What costs money is the AI model doing the thinking, and you have four ways to supply one:

OptionHow you payBest for
OpenCode ZenPay per use from prepaid credit; a few models are free for a limited timeTrying many models, including top closed ones, without separate accounts
OpenCode Go$10 or $40 a monthHeavy daily use of open coding models at a predictable price
Your own providerThat provider's prices or subscriptionTeams already on Amazon Bedrock, or people with ChatGPT Plus, GitHub Copilot or GitLab Duo
Local modelsFree; you pay in hardware and electricityPrivacy and offline work on a capable PC

OpenCode Zen: pay per use, at cost

Zen is OpenCode's own gateway to a curated list of models that its team has tested with the agent. You sign in at opencode.ai, add billing details and credit, copy an API key, and paste it into /connect. The list is long: OpenAI's GPT 6 family, Anthropic's Claude models, Google's Gemini Flash models, Grok, Qwen, DeepSeek, GLM, Kimi, MiniMax and more, each with an ID such as opencode/gpt-5.5 for your config.

Zen sells tokens at the providers' prices, and OpenCode says the only markup is its card processing cost, passed on at 4.4% plus $0.30 per transaction. A sample of Zen's prices per million tokens on October 6, 2026:

Model on ZenInputOutput
DeepSeek V4 Flash$0.14$0.28
GLM 5.3 Flash$0.15$0.50
GPT 6 Luna$0.10$0.50
GLM 5.3$1.40$4.40
Qwen3.8 Max$2.00$6.00
Claude Sonnet 5$2.00$10.00
Kimi K3$3.00$15.00
Claude Opus 5.5$4.00$20.00
GPT 6 Astra (up to 272K tokens)$10.00$50.00

A coding agent reads a lot. Every step resends your files and the conversation so far, so input tokens pile up much faster than in a chat. That is why the cheap models matter: the same afternoon of work can cost cents on DeepSeek V4 Flash and dollars on a top closed model. Start cheap, and move up only for the tasks that need it.

The auto-reload trap

Zen has a feature worth checking on day one. When your balance drops below $5, Zen automatically reloads $20. You can change the amount or turn auto-reload off. Zen also lets you set a monthly usage limit, but read the fine print: with auto-reload on, Zen says it may still charge you more than your limit when the balance falls below $5. If you want a hard ceiling, set a monthly limit and switch auto-reload off. Also expect small charges for cheap models such as Haiku, Nano or Flash in your usage history; OpenCode uses them to write session titles.

OpenCode Go: $10 or $40 a month

OpenCode Go is a subscription for open coding models, designed with reliable access for international users in mind. There are two plans:

  • Go, $10 a month
  • Go Plus, $40 a month, with higher limits on the same models

The model list includes Kimi K3 and Kimi K2.7 Code, GLM-5.3 and GLM-5.3-Flash, Qwen3.8 Max and Flash, DeepSeek V4.1 Flash and V4 Pro, MiMo-V2.6 Flash and Pro, MiniMax M3, Grok 4.7, GPT 6 Luna and more. Limits work in dollars of usage per model, with three windows: in any five hours you can use up to 20% of a model's monthly allowance, in any week 50%, and in a month 100%.

OpenCode publishes estimated request counts for the $10 plan, which give a feel for what that buys:

Model on Go ($10 plan)Monthly allowanceEstimated requests a month
GLM-5.3-Flash$60 of usageabout 31,580
Kimi K2.7 Code$60about 6,750
GLM-5.2$60about 4,300
GLM-5.3$15about 1,080
Qwen3.8 Max$15about 810
Kimi K3$15about 490

In other words, on the $10 plan the allowance for many open models is worth several times the subscription price at pay-as-you-go rates, while the biggest models get smaller allowances. Go Plus raises them; for example, GLM-5.3-Flash goes from $60 to $180 of usage a month, and Kimi K3 from $15 to $60. Two rules: only one member per workspace can subscribe, and Go is meant for coding-agent traffic, which OpenCode monitors for abuse. Go also works with other agents, including Codex, Pi and Hermes, as long as they send a session header.

Is OpenCode Go worth $10? A worked example

Go's value depends entirely on which models you use and how much. Take two cases on the $10 plan.

  • You mostly use GLM-5.3-Flash. Its monthly allowance is $60 of usage at Zen's prices ($0.15 per million input tokens, $0.50 output). Used fully, that is six times what the subscription costs. The windows cap you at 20% in any five hours ($12 of usage, about 6,320 requests by OpenCode's estimate) and 50% in any week, so the allowance suits steady daily work rather than one giant weekend.
  • You mostly use Kimi K3. Its allowance is $15 of usage, about 490 requests a month, or roughly 16 a day, with about 110 in any five-hour window. That is still more than the $10 you pay, but an agent can burn through 110 requests in one busy afternoon. Heavy Kimi K3 users are who Go Plus is for: $40 for a $60 allowance on that model.

The rule of thumb: Go is excellent value if you work daily with the fast, cheap open models and dip into the big ones occasionally. If you want top closed models such as GPT 6 or Claude, they are not part of Go; use Zen, your own key, or a subscription you already have.

Using a subscription you already have

If you already pay for ChatGPT Plus or Pro, GitHub Copilot or GitLab Duo, OpenCode can use that subscription with no extra setup: run /connect, choose the provider, and sign in through your browser. Anthropic is different. You can use Claude models in OpenCode with an Anthropic API key or through Zen or Bedrock, but OpenCode's documentation notes that Anthropic explicitly prohibits using Claude Pro or Max subscriptions through third-party plugins, and OpenCode stopped bundling those plugins in version 1.3.0. If a tutorial tells you to log in with your Claude Pro plan, it is out of date.

Which OpenCode models are free?

On October 6, 2026, Zen listed these models at $0 for a limited time: Big Pickle, Space Bunny Free, LongCat 2.5 Preview Free, Fledge Alpha Free, MiMo-V2.6-Flash Free, MiMo-V2.5 Free, Ling 3.1 Flash Free, Ling 3.0 Flash Fin Free, Nemotron 3 Ultra Free, Nemotron 3.5 Lightning Free and Muse Spark 1.3 Contributor Free, plus a free version of the Jev decision model. You still need a Zen account to use them.

Free has conditions, and they are worth reading before you paste in client code:

  • For most free models, OpenCode says data collected during the free period may be used to improve the model.
  • The two Nemotron free models run on NVIDIA's trial endpoints: do not submit personal or confidential data, and use is logged.
  • Muse Spark 1.3 Contributor Free is discounted in exchange for permission to use your prompts and completions to train future Meta models.
  • Space Bunny Free and LongCat 2.5 Preview Free are the exceptions: their providers follow a zero-retention policy and do not train on your data.
  • All of them are limited-time. When one disappears or stops answering, that is usually why. Run /models to see what is available today.

Zen's paid models are hosted in the US, and their providers follow zero-retention policies, with two notable exceptions: OpenAI and Anthropic APIs keep requests for 30 days under their own data policies.

So which free model is best for coding? It changes week to week as models come and go. For anything you would not post publicly, the honest answer is a cheap paid model with zero retention, such as DeepSeek V4 Flash at $0.14 per million input tokens, or a local model through Ollama.

How to use OpenCode with Ollama (free local models)

If you want OpenCode completely free and private, run the model on your own computer with Ollama. Since the integration landed, it takes one command:

ollama launch opencode

That starts OpenCode configured for the Ollama model you choose, without overwriting your own OpenCode settings. To write the configuration without starting a session, use ollama launch opencode --config.

Prefer to set it up by hand? Add an Ollama provider to opencode.json, listing the models you have pulled:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "ollama": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Ollama (local)",
      "options": { "baseURL": "http://localhost:11434/v1" },
      "models": {
        "qwen3.5": { "name": "qwen3.5" }
      }
    }
  }
}

One caution from Ollama's side: models you define only in opencode.json do not appear in the ollama launch model picker, and vice versa, so pick one method and stick with it.

The 4K context trap: why OpenCode "doesn't work" with Ollama

This is the fix behind most "OpenCode not working with Ollama" complaints. A coding agent needs a large context window, the amount of text a model can keep in mind at once, because it carries its instructions, your files and the whole conversation. Coding tools need at least 64,000 tokens. But Ollama picks its default by the graphics memory you have:

  • under 24 GiB of VRAM: 4K tokens
  • 24 to 48 GiB: 32K tokens
  • 48 GiB or more: 256K tokens

Most laptops and gaming PCs fall in the first group, so the model silently forgets most of what OpenCode sends it. The symptoms look like a broken install: tool calls fail, the agent ignores files it just read, or it loops. The fix is to raise Ollama's context length:

  • In the Ollama app: open Settings and move the context length slider to 64K.
  • On the command line: start the server with OLLAMA_CONTEXT_LENGTH=64000 ollama serve.

Then check with ollama ps, which shows the context actually allocated and whether the model sits on your GPU or spilled onto the CPU. A bigger context needs more memory, so a model that fit before may now be partly on the CPU and slower; our guide to Ollama memory errors covers what to do if it no longer loads at all.

Pick models that support tool calling (Ollama's model library has a "tools" filter), and be realistic about size. A small local model can rename variables and write tests; it will not match a frontier model on a large refactor. Ollama also offers cloud models that run on its servers at their full context; you pull a small reference file such as gpt-oss:20b-cloud, add your Ollama API key with /connect, and they appear in /models.

LM Studio and llama.cpp

LM Studio works the same way through its local server: set the provider's baseURL to http://127.0.0.1:1234/v1 and list the model IDs you have loaded. The same context advice applies; set a large context when you load the model in LM Studio. llama.cpp's server is also supported through the same OpenAI-compatible provider pattern.

How to use OpenCode with Amazon Bedrock

For companies on AWS, Amazon Bedrock is often the easiest approved route: the AI runs inside your AWS account's billing and security controls, and many providers' models are available in one place. OpenCode supports Bedrock natively.

  1. Check model access. In the Amazon Bedrock console, open the model catalog and make sure your account can use the model you want, in the Region you plan to use. If you get an access error later, our guide to Bedrock AccessDeniedException walks through the usual causes.
  2. Give OpenCode credentials. Any one of these works:
    • a named AWS profile: AWS_PROFILE=my-profile opencode (set up with aws configure --profile my-profile or aws sso login);
    • a Bedrock API key from the Bedrock console: AWS_BEARER_TOKEN_BEDROCK=... opencode;
    • access keys, or on AWS itself, an IAM role. On EC2 or EKS, the instance or service-account role works automatically, so no keys sit on disk.
  3. Pin the Region and profile in opencode.json so every session uses the same setup:
    {
      "$schema": "https://opencode.ai/config.json",
      "provider": {
        "amazon-bedrock": {
          "options": {
            "region": "us-east-1",
            "profile": "my-aws-profile"
          }
        }
      }
    }
  4. Choose a model with /models.

A few details that trip people up. Settings in the config file override environment variables. A Bedrock API key, once set, takes priority over every other credential, including your profile, which surprises people who switch accounts. If your company routes Bedrock through a VPC endpoint, add its URL as "endpoint" in the same options block. And for custom application inference profiles, set the model's id to the profile's ARN so caching works correctly.

Billing is ordinary Bedrock token pricing, charged to your AWS account; our Bedrock pricing guide explains how to estimate it. Because agents read so much, set an AWS budget alert before a team starts, and give developers an IAM policy limited to invoking the models you approve.

OpenCode vs Claude Code, Codex, Cursor and other coding agents

People rarely pick a coding agent in isolation, so here is how OpenCode differs from the tools it is most often compared with, on the things that decide the choice.

ToolOpen source?Which modelsWhere it runs
OpenCodeYes, MITAlmost any: Zen, Go, OpenAI, Google, Anthropic API, Bedrock, open models, localTerminal, desktop app, editor extension
Claude CodeNoAnthropic's Claude modelsTerminal, desktop, editors, web
CodexThe command-line tool isMainly OpenAI's modelsTerminal, editor, cloud
CursorNoSeveral providers, through its own subscriptionIts own code editor
ClineYesBring your own providerVS Code extension
Mirror CLI, Kimi Code and other vendor agentsVariesTuned for their maker's modelsTerminal

The short version:

  • OpenCode vs Claude Code: Claude Code is built by Anthropic for its own models and is polished around them; many developers use it with a Claude subscription. OpenCode is open source and model-agnostic, so you can switch to a cheaper or newer model in seconds, but a Claude Pro or Max subscription cannot be used inside it. Pick Claude Code if you live on Claude models and their subscription; pick OpenCode if you want choice, open models, or local AI.
  • OpenCode vs Codex: a similar story with OpenAI. If you already have ChatGPT Plus, OpenCode can use that subscription directly, so you can compare both on your own project at no extra cost.
  • OpenCode vs Cursor: Cursor is a full code editor with AI built in; OpenCode is an agent you run next to whatever editor you already use. Many people use both.
  • New open models arrive in OpenCode fast. When Reflection AI announced its Beam model on October 5, OpenCode was one of the agents its documentation showed how to connect. Our Beam guide includes the config.

Getting good results: agents, AGENTS.md and long sessions

OpenCode works best when you treat it like a capable new teammate: give it context, agree on a plan, and review its work. A few features make that easier.

  • Two built-in modes. Build makes changes; Plan only proposes them. Tab switches between them. For any change that touches more than one file, plan first.
  • AGENTS.md is your house rules. The file /init creates is read at the start of every session. Add the things a new developer would need to know: how to run the tests, which folders never to touch, your naming conventions. Short and specific beats long and vague.
  • Attach files with @ instead of describing where things are. The agent wastes fewer steps searching.
  • Keep sessions focused. Long conversations get expensive and slower, because everything is resent each step. Start a fresh session with /new for a new task, or use /compact to have the agent summarize the session so far and continue from the summary.
  • Talk to it like a junior developer. OpenCode's own advice, and it works: describe what you want, why, and an example of what good looks like.
  • Review every diff. The agent is fast and usually right. "Usually" is the reason you read before you commit.

Jake's second attempt went differently. He switched to Plan mode and asked the same question. The agent listed eleven photos it believed were unused and the pages it wanted to rename. Jake spotted two photos that were used on a page the agent had not read, removed them from the list, skipped the renaming entirely, and let it delete the other nine. Ten minutes, nothing broken.

Skills, MCP servers and the GitHub integration

Once the basics work, three features turn OpenCode from a chat in your terminal into part of your workflow.

Agent skills, including your Claude skills

A skill is a reusable set of instructions the agent loads only when it needs it: how your team writes release notes, how to deploy, how to run a database migration safely. Each skill is a folder containing a SKILL.md file that starts with a short header giving its name (lowercase letters, numbers and single hyphens, matching the folder name) and a description. OpenCode looks for skills in .opencode/skills/ in your project and ~/.config/opencode/skills/ globally.

If you searched "can OpenCode use Claude skills," the answer is yes: OpenCode also reads the Claude-compatible locations .claude/skills/ and ~/.claude/skills/, plus the generic .agents/skills/, so skills you wrote for another agent usually work without changes. Header fields OpenCode does not recognize are simply ignored.

MCP servers: connecting outside tools

The Model Context Protocol (MCP) is a standard way to give an AI agent extra tools, such as access to a ticket system, a database or a documentation search. OpenCode supports local and remote MCP servers, configured under an mcp section in opencode.json, each with an enabled switch. OpenCode's own warning is worth repeating: every MCP server adds its tool descriptions to the context, and some, such as the GitHub MCP server, add so many that they can push a session past the model's limit. Enable only the ones you use, and remember this doubles the importance of a large context window on local models.

OpenCode in GitHub issues and pull requests

OpenCode can also work inside GitHub. Run opencode github install in a repository and it walks you through installing the OpenCode GitHub app, adding a workflow and setting up secrets. After that, anyone with access can mention /opencode or /oc in an issue or pull-request comment, and OpenCode runs the task in your own GitHub Actions runner: explaining an issue, or fixing it on a new branch and opening a pull request with the changes. Your API key lives in the repository's secrets, so the same cost controls apply.

OpenCode troubleshooting: the common problems and fixes

ProblemLikely causeFix
Free model stopped working or vanishedFree models are limited-timeRun /models and pick a current one
With Ollama, tool calls fail or the agent forgets filesOllama's 4K default contextSet context to 64K in Ollama settings or with OLLAMA_CONTEXT_LENGTH=64000
"Could not connect" to the local modelOllama is not running, or the base URL is wrongStart Ollama; use http://localhost:11434/v1 (see our Ollama connection guide)
Claude Pro or Max login does not workAnthropic prohibits subscription use in third-party toolsUse an Anthropic API key, Zen or Bedrock
Slow, expensive sessionsLong conversation resent every step, or a big model/compact or /new; try a faster model
Slow or odd behavior on WindowsNative Windows file and terminal quirksRun OpenCode inside WSL
Desktop app opens blank on WindowsMissing Microsoft Edge WebView2 RuntimeInstall or update WebView2
Desktop app blank or crashing on Linux WaylandWayland supportLaunch with OC_ALLOW_WAYLAND=1
Desktop app cannot reach its serverA server setting or OPENCODE_PORT variableRemove the setting or unset the variable, then restart
Bedrock uses the wrong accountA Bedrock API key overrides profilesUnset AWS_BEARER_TOKEN_BEDROCK or reconnect
Agent will not read your .envBlocked by default, on purposeLeave it blocked; describe the variables instead
/undo does nothingProject is not a Git repositoryRun git init and commit
Strange errors after an updateA plugin or a stale cacheDisable plugins; clear ~/.cache/opencode; run opencode upgrade

When something fails silently, look at the logs. They live in ~/.local/share/opencode/log/ on Mac and Linux, and at %USERPROFILE%\.local\share\opencode\log on Windows; OpenCode keeps the ten most recent. Start with opencode --log-level DEBUG for more detail.

For IT admins: rolling OpenCode out to a team

  • Data handling: OpenCode does not store your code or context; prompts go directly to the provider you configure. Choose the provider your policies already approve, such as Amazon Bedrock or an internal AI gateway.
  • Disable sharing with "share": "disabled" in a managed config. It is the one feature that sends conversations to OpenCode's servers.
  • Set permissions centrally: ask for bash and edit by default, deny for anything your environment should never do. Explicit deny rules hold even in auto mode.
  • Protect local secrets. API keys and tokens added through /connect are saved in auth.json under ~/.local/share/opencode/. Prefer role-based credentials on AWS and short-lived SSO sessions over long-lived keys.
  • Zen for teams: workspaces with Admin and Member roles, monthly spending limits per member, the ability to switch off models that collect data, and bring-your-own OpenAI or Anthropic keys. Workspace management was free during the beta.
  • OpenCode Enterprise adds a centralized config that integrates with your single sign-on and internal AI gateway, priced per seat; OpenCode does not charge for tokens when you use your own gateway.
  • Code ownership: OpenCode states that you own all code it produces, with no licensing claims.

OpenCode: frequently asked questions

What is OpenCode?

OpenCode is a free, open-source AI coding agent under the MIT license. It reads your project, edits files and runs commands, and it works with almost any AI model, from paid APIs to free local models through Ollama.

Is OpenCode free?

The app is free. The AI models cost money unless you use one of Zen's limited-time free models or run a model locally with Ollama or LM Studio. Paid options are Zen pay-as-you-go, the OpenCode Go subscription, or your own provider.

How do I install OpenCode?

On Mac and Linux, run curl -fsSL https://opencode.ai/install | bash. On any system with Node.js, npm install -g opencode-ai works. On Windows, the docs recommend WSL, and Chocolatey, Scoop, npm and Docker also work.

What is OpenCode Go?

OpenCode Go is a subscription for open coding models such as Kimi K3, GLM-5.3, Qwen3.8 and DeepSeek V4.1 Flash. It costs $10 a month, or $40 a month for Go Plus with higher limits.

What is OpenCode Zen?

Zen is OpenCode's pay-as-you-go gateway to a curated list of tested models, sold at the providers' prices plus card processing fees. You add credit, copy an API key and connect it with /connect.

What is the difference between OpenCode Zen and Go?

Zen charges per token from prepaid credit and includes top closed models. Go is a flat $10 or $40 monthly subscription for open models, with usage allowances in five-hour, weekly and monthly windows.

Which OpenCode models are free?

On October 6, 2026, Zen's free models included Big Pickle, Space Bunny Free, LongCat 2.5 Preview Free, MiMo-V2.6-Flash Free, Ling 3.1 Flash Free and two Nemotron models. All are limited-time, and most may use your data to improve the model.

Why are my OpenCode free models not working?

Free models are offered for a limited time and can be removed or changed. Run /models to see what is currently available, and make sure you are signed in to Zen.

Can OpenCode use Ollama?

Yes. Run ollama launch opencode, or add an Ollama provider with the base URL http://localhost:11434/v1 to opencode.json. Set Ollama's context length to at least 64K for coding.

Why is OpenCode not working with Ollama?

Usually the context window. Ollama defaults to 4K tokens on machines with under 24 GiB of graphics memory, and coding agents need at least 64K. Raise it in Ollama's settings or with OLLAMA_CONTEXT_LENGTH=64000.

Can I use OpenCode with Amazon Bedrock?

Yes. Make sure your account can use the model in Bedrock, provide an AWS profile, access keys, IAM role or Bedrock API key, set the Region in opencode.json, and pick the model with /models.

Can I use my Claude Pro subscription in OpenCode?

No. OpenCode's documentation says Anthropic explicitly prohibits it, and OpenCode removed the plugins in version 1.3.0. Claude models still work with an Anthropic API key, through Zen, or through Amazon Bedrock.

Can I use ChatGPT Plus with OpenCode?

Yes. ChatGPT Plus and Pro, GitHub Copilot and GitLab Duo subscriptions work with no extra setup: choose the provider in /connect and sign in through your browser.

Is OpenCode safe to use?

It is open source and does not store your code, but by default it can edit files and run commands without asking. Set bash and edit to ask in opencode.json, work in a Git repository, and keep /share disabled for private projects.

Does OpenCode work on Windows?

Yes, natively or inside WSL. OpenCode recommends WSL for better performance and compatibility. The desktop app needs the Microsoft Edge WebView2 Runtime.

Is there an OpenCode desktop app?

Yes. OpenCode Desktop runs a local OpenCode server in the background. On Windows it can also connect to a server running in WSL, protected with the OPENCODE_SERVER_PASSWORD variable.

Where is the OpenCode GitHub repository?

The current project is anomalyco/opencode on GitHub, MIT-licensed, with more than 211,000 stars. The older opencode-ai/opencode repository is archived and continues as Crush.

OpenCode vs Claude Code: which is better?

Claude Code is tuned for Anthropic's models and subscriptions. OpenCode is open source and works with almost any model, including cheap open models and local ones. The better choice depends on which models you want to use.

Can OpenCode use Claude skills?

Yes. OpenCode reads SKILL.md skills from its own folders and from the Claude-compatible .claude/skills folders in your project and home directory, so most existing skills work unchanged.

Is OpenCode Go worth it?

For daily use of fast open models such as GLM-5.3-Flash, yes: the $10 plan includes up to $60 of that model's usage a month. For heavy use of the biggest models such as Kimi K3, the allowance runs out quickly, and Go Plus at $40 fits better.

How do I update OpenCode?

Run opencode upgrade for the latest version, or opencode upgrade followed by a version number for a specific one. Package-manager installs can also update through npm, Homebrew, Scoop or Chocolatey.

For readers preparing for an AWS certification

We have been covering AWS certifications alongside our fixes, so here is a short extra for readers studying for one. If you only came for the fix, you already have it; feel free to skip this part.

Exams that test this topic: AI Practitioner (AIF-C01) • Developer – Associate (DVA-C03 from December 1, 2026).

Here are the exam-style questions this topic tends to raise, with the reasoning you need to answer them:

1. How can a coding assistant use models through AWS instead of a third-party API key?

Point it at Amazon Bedrock with AWS credentials from an SSO profile.

2. What should never be committed to a repository with an AI tool?

API keys and AWS credentials; use environment variables, profiles or a secrets manager.

3. How do you compare cost between a subscription tool and pay-per-token APIs?

Estimate monthly tokens from your usage and multiply by per-token prices.

4. How do you keep source code private when using hosted models?

Check the provider's data use terms; Bedrock does not train on your prompts.

5. Which local runtime lets coding tools use models offline?

A local runner such as Ollama, at the cost of speed and model size.

6. How do you review code written by an AI assistant safely?

Treat it like any contribution: review, test and scan it before merging.

Exam codes and dates change often. Our AWS certification changes page keeps track of what is current.

Jake still uses OpenCode for the jobs nobody has time for: fixing broken links, resizing photos, writing the odd new page. It asks before every command now, and he reads every plan before he says yes. If an agent ever surprised you the way it surprised him, it wasn't you being careless. The tool was simply trusting you more than you had asked it to, and now you know the one line that changes that.

📌 If you keep one line from this page

Let the agent plan freely, but make it ask before it acts.

"bash": "ask" and "edit": "ask" are the two settings that matter most.

Revision note. Written October 6, 2026, with OpenCode at version 1.18. If your first session went sideways, you are in good company; every developer who uses these tools has a story like Jake's.

Related