OpenCode
Open-source terminal coding agent that works with any provider.
Overview
OpenCode is a terminal-based AI coding agent with a polished TUI, LSP integration and support for dozens of providers via your own keys. It can also run as a client-server setup and integrates with editors.
- Polished TUI
- LSP integration
- Multi-session
- Custom agents
- Share sessions
Our verdict
What we like
- Provider-agnostic
- Fast-growing community
Watch out for
- Terminal-only
Works with these providers
Keys from these providers work in this app. Usage is billed by the provider at its list price.
BYOK Key Safety Score
Key handling in OpenCode
Grade A
Your key is stored on your device and requests go directly to the provider.
- Key storage40/40
Key stays on your device; requests go direct to the provider.
- Auditable code25/25
Open source: anyone can verify how keys are handled.
- Self-hosting8/15
Runs as a local app, but not as a self-hosted service.
- Offline option10/10
Supports local models, so no key is needed at all for private work.
- Provider choice10/10
14 provider options, which lets you pick the provider whose data terms you trust.
Whatever the score, give each app its own key, set a monthly spend limit with your provider, and revoke keys you no longer use. Read the key-safety checklist.
OpenCode FAQ
- Does OpenCode support bring your own key?
- Yes. OpenCode accepts your own API key from OpenAI, Anthropic, Google Gemini, OpenRouter, Mistral, Groq, DeepSeek, xAI, Ollama, LM Studio, Azure OpenAI, AWS Bedrock, Together AI and OpenAI-compatible. Usage is billed by the provider at its API rates.
- Where does OpenCode store my API key?
- On your device. Requests go directly from OpenCode to the provider. Its BYOK Tools Key Safety Score is 93/100.
- Is OpenCode free?
- Open source: Free & open source. API usage is billed separately by your model provider.
- Is OpenCode open source?
- Yes. The source code is at https://github.com/sst/opencode.
- Can OpenCode run local models?
- Yes. It can connect to local runtimes such as Ollama or LM Studio, so no API key is needed for private or offline use.
- Which platforms does OpenCode support?
- CLI, macOS, Windows, Linux.
Community reviews
No reviews yet.
Alternatives to OpenCode
All coding agents & ides →Aider
Coding Agents & IDEs
AI pair programming in your terminal with git-aware edits.
Crush
Coding Agents & IDEs
Glamorous terminal coding agent from Charm.
Goose
Coding Agents & IDEs
Extensible open-source AI agent from Block for coding and beyond.
Zed
Coding Agents & IDEs
High-performance collaborative editor with a BYOK agent panel.
Void
Coding Agents & IDEs
Open-source Cursor alternative that connects directly to your models.
gptel
Coding Agents & IDEs
Simple, provider-agnostic LLM client for Emacs.