OpenCode logo

OpenCode

An open-source, terminal-based coding agent that works with many AI models. Bring your own API key, pick your model per session, and keep full control.

Type
Coding agent
Interface
Terminal / CLI
Open source
Yes (MIT-style)
Model choice
Any — BYOK
Pricing
Free
Official site

What is OpenCode?

OpenCode is the hacker's choice: a terminal agent you can read, fork, and extend. Because it's model-agnostic, you're never locked into one provider — use a frontier model for hard tasks and a cheaper one for routine edits.

It does the full agent loop: explore the codebase, plan, edit files, run commands, and iterate on failures. The open-source community moves fast, so features land quickly.

Key features

01

Model-agnostic

Plug in API keys from major providers and switch models per task.

02

Open source

Inspect, fork, and customize the agent itself.

03

Terminal-native

Lives where developers already work: shell, git, scripts.

04

Cost control

Route simple tasks to cheap models, hard ones to frontier models.

Pros and cons

Pros

  • Free and open — no vendor lock-in
  • Use any model, optimize for cost or quality
  • Active community, fast iteration

Cons

  • You manage API keys and billing yourself
  • Less hand-holding than commercial products
  • Quality depends heavily on the model you choose

Who is it for?

Developers who want maximum control: pick your models, control costs, and aren't afraid of a terminal or an API key.

FAQ

Is OpenCode really free?
The software is free and open source. You pay only for the model API usage from whichever provider you connect.
Which models work with OpenCode?
It's designed to work with many providers via API keys — check the official docs for the current list.
How does it compare to Claude Code?
Similar terminal-agent experience, but open source and model-agnostic, whereas Claude Code is tied to Anthropic's models.

Try OpenCode

Pricing and features change fast — check the official site for the latest.

Visit official site →

Last updated: October 2026 · Compare all agents