OpenCode (Open Code): the open source AI coding agent
How OpenCode works in your terminal, how to install it with your own API keys or local Ollama models for $0, and how OpenCode Go compares to Claude Code.
Short answer
Free, MIT, any model.
OpenCode (opencode.ai, github.com/anomalyco/opencode) is an open-source terminal coding agent that reads repositories, edits files, runs tests and connects to almost any LLM provider. The CLI and TUI client are completely free under the MIT license: bring your own API key (Claude, GPT, Gemini, DeepSeek, OpenRouter), run local models via Ollama or LM Studio for $0, or subscribe to OpenCode Go ($10/month) or Zen pay-as-you-go.
$0MIT open source
Any model / BYOKSet up OpenCode with your preferred backend
Pick how you want to pay for (or avoid paying for) model calls. Each path shows the install flow, provider setup and cost trade-off.
- 01Install OpenCode via Homebrew, curl script, npm or Go binary from opencode.ai.
- 02Run
opencodeinside your project folder and run/connectto pick Anthropic, OpenAI, Google, DeepSeek, xAI or OpenRouter. - 03Paste your provider API key (or set
ANTHROPIC_API_KEY/OPENAI_API_KEYin your shell) and pay only standard per-token rates with zero OpenCode markup.
- 01Start Ollama, LM Studio or vLLM on your Mac, Linux or Windows machine with an open-weight coding model loaded.
- 02Launch
opencodeinside your repo. OpenCode automatically detects local OpenAI-compatible endpoints without sending source code to the cloud. - 03Need hardware guidance? Check our best local LLM by RAM guide to pick a model that fits 16 to 64 GB.
- 01Want one bill without managing five API keys? OpenCode offers OpenCode Go at $10/month (flat allowance across curated open-weight and fast models) and Go Plus at $40/month.
- 02Prefer pure pay-as-you-go across frontier and open models? Fund OpenCode Zen with prepaid credits and automatic fallback when Go caps run out.
- 03Authenticate directly inside the TUI with
/connectso billing stays centralized in one dashboard.
- 01Already pay for GitHub Copilot or a ChatGPT Plus/Pro plan? OpenCode supports account-based provider plugins where allowed by your subscription terms.
- 02Run
/connectinside OpenCode to inspect active auth connectors for your current version. - 03Keep a low-cost API key (such as DeepSeek or Haiku 5.5) configured as a backup if subscription rate limits kick in mid-sprint.
How OpenCode works as an open source AI coding agent

OpenCode (often searched as “open code” and maintained at github.com/ and opencode.ai) is an open source AI coding agent built in the open for developers who like the speed of Claude Code or Codex CLI without lock-in to a single model vendor. Running straight in your terminal on macOS, Linux or Windows (and also available as a native Desktop app), this open source coding agent edits files, runs shell tests, reads compiler errors, follows project AGENTS.md rules and loops until the build passes.
Three practical choices explain why OpenCode surged past 165,000 US monthly searches in late 2026:
- True model freedom and parallel work: Switch mid-session from Claude Opus 5.5 for hard architecture to Claude Haiku 5.5, DeepSeek or Gemini Flash for test generation, run multiple agents in parallel across sessions, or drop to local Ollama on a flight with no Wi-Fi.
- Built-in LSP, MCP and Desktop app options: OpenCode hooks into Language Server Protocols for real type errors, supports Model Context Protocol (MCP) servers for databases and docs, and offers a clean Desktop app alongside the terminal TUI.
- MIT license and clear data handling: Because the code is built in the open on GitHub, you can audit data handling yourself, bring your own API keys for $0 to OpenCode, or choose optional flat-rate OpenCode Go ($10) or Zen credit plans.
OpenCode Go, Zen, BYOK and Desktop app pricing
Because the CLI and Desktop app are free to download, you only pay for inference. To install OpenCode on macOS via Homebrew, run brew install anomalyco/; on Node.js systems you can also run npm install -g opencode-ai or use the official installer script below. Checked December 1, 2026 against OpenCode’s docs and plan pages:
| Option | Price | Best for |
|---|---|---|
| BYOK / Local | $0 to OpenCode (provider API rates) | Developers who already have Claude, OpenAI, DeepSeek or Ollama set up |
| OpenCode Zen | Pay-as-you-go prepaid credits | Using frontier and open-weight models under one balance with auto-reload |
| OpenCode Go | $10/month | Solo builders wanting a low flat monthly cap on curated open-weight models |
| OpenCode Go Plus | $40/month | Daily coders needing higher flat caps across curated model families |
| Enterprise | Custom per seat | Teams needing central billing, zero-data policies and org controls |
OpenCode vs Claude Code and Codex CLI
If you are deciding between OpenCode, Anthropic’s Claude Code and OpenAI’s Codex, the split comes down to subscription economics versus vendor flexibility:
- Pick OpenCode if you mix models (for example Opus 5.5 for design and DeepSeek or local Qwen for tests), want open-source auditable code, or need $10/month Go pricing.
- Pick Claude Code if you live inside Claude Opus 5.5 all day and want Anthropic’s flat $20 Pro / $100 Max subscription pool instead of paying per-token API rates.
- Pick Cursor if you prefer a full GUI IDE with inline Tab autocomplete rather than working primarily in a terminal.
curl -fsSL https://opencode.ai/install | bash && cd your-repo && opencode FAQ
Is OpenCode free?
Yes. The OpenCode CLI and TUI client are free and open source under the MIT license. You pay nothing to OpenCode if you connect your own API keys or run local models through Ollama or LM Studio.
How much does OpenCode Go cost?
OpenCode Go costs $10/month and Go Plus costs $40/month for flat-rate caps across curated models, with OpenCode Zen available for pay-as-you-go credits across frontier models.
Does OpenCode work with Claude Opus 5.5 and GPT-6?
Yes. OpenCode supports Anthropic, OpenAI, Google Gemini, DeepSeek, xAI, OpenRouter and local OpenAI-compatible servers, so you can route to Opus 5.5, Fable 5.2, GPT-6 or open-weight models in the same workspace.
Is OpenCode better than Claude Code?
OpenCode wins on openness, local offline coding and mixing cheap + frontier models. Claude Code often costs less if you run Opus 5.5 heavily every day inside a flat $20 Pro or $100 Max Claude subscription.
Sources
- OpenCode official website (opencode.ai) and GitHub repository (github.com/anomalyco/opencode), MIT license, install and provider docs, checked December 1, 2026
- OpenCode Go, Go Plus and Zen pricing documentation and ecosystem trackers, checked December 1, 2026
- Anthropic Claude Code and OpenAI Codex pricing pages for comparison, checked November and December 1, 2026
Spotted a mistake? Write to support@gptx.io and we will check it.