Plan prices and BYOK rules checked against each vendor's pricing and docs pages; cost-per-task figures from the Terminal-Bench 4.1 leaderboard (tbench.ai, November 19, 2026); Oxyy prices from oxyy.ai model pages on this date.
Disclosure: This guide is published by the Oxyy.ai team. Oxyy is an API gateway that several of these agents can use as a model provider; it is not affiliated with any agent vendor.
The best AI coding agents in 2026 split into three groups. Vendor CLIs: Claude Code (highest pass rate, Claude only), Codex CLI (open source, cheapest per solved task), Gemini CLI and Antigravity (free tier, Gemini only). IDE products: Cursor and Windsurf (subscriptions with BYOK on higher plans), GitHub Copilot (BYOK with any OpenAI-compatible endpoint, no plan required since June 2026). Open-source BYOK agents: Cline, Kilo Code, OpenCode, Aider and Continue, which are free software that run on whatever API key you give them. On Terminal-Bench 4.1 the cost per solved task ranges from $1.72 (Codex / GPT-6.2 Sol) to $75.96 (Claude Code / Fable 5.2). If you pick a BYOK agent, one gateway key covers every model at 40% of list.
The 9 Agents at a Glance
Coding agents are now a crowded field, so we picked on four tests: the agent must be actively maintained in November 2026, run multi-step tasks (read, edit, execute, iterate) rather than autocomplete, have a documented way to pay (plan, API key or both), and either appear on a public benchmark or have a clear BYOK path we could verify. The table shows what each one runs on, what it costs to enter, and whether you can bring your own key, which decides whether a cheaper model provider helps you at all.
| # | Agent | Maker | Surface | Open source | Models it runs | Entry price | BYOK / custom endpoint |
|---|---|---|---|---|---|---|---|
| 1 | Claude Code | Anthropic | CLI, VS Code, JetBrains, desktop | No | Claude only | Pro $20/mo, Max $100+/mo, or API per token | Yes: ANTHROPIC_BASE_URL to any Messages-API gateway |
| 2 | Codex CLI | OpenAI | CLI, IDE extension, app | Yes (Apache 2.0) | GPT by default; any via model_providers | ChatGPT Plus $20/mo or API key | Yes: OpenAI-compatible base_url in config.toml |
| 3 | Gemini CLI / Antigravity | CLI | Yes (Apache 2.0) | Gemini | 1,000 requests/day free with a Google account | Gemini API key / Vertex; no third-party endpoint | |
| 4 | Cursor | Cursor | IDE | No | Cursor models + third-party | Plus $8, Premium $30, Super $100, Ultra $200/mo | Yes on Premium and up, chat models only; Teams pay $0.25/M token rate |
| 5 | GitHub Copilot | GitHub | IDE, CLI, app | No | Copilot models + BYOK | Plans from $10/mo; BYOK needs no plan | Yes: OpenAI, Anthropic, Ollama, any OpenAI-compatible endpoint |
| 6 | Cline | Cline | VS Code, JetBrains | Yes | Any (BYOK) | Free | Yes: "OpenAI Compatible" and Anthropic providers |
| 7 | Kilo Code | Kilo | VS Code, JetBrains, CLI | Yes (MIT) | Any (BYOK) or Kilo Gateway | Free | Yes: OpenAI-compatible endpoint + model ID + context size |
| 8 | OpenCode | SST | CLI, desktop | Yes | Any (BYOK) or Go / Zen plans | Free; Go and Zen plans optional | Yes: providers block in opencode.jsonc |
| 9 | Aider | Aider | CLI | Yes | Any (BYOK) | Free | Yes: --openai-api-base / OPENAI_API_BASE |
Sources: vendor pricing and documentation pages, checked November 29, 2026. Windsurf and Warp were considered and left out: both are solid IDE-side agents, but neither publishes a BYOK rule we could verify on the day of writing.
The column that decides your bill is the last one. Seven of the ten agents will send their requests to any OpenAI-compatible or Anthropic-compatible endpoint, which means the agent is free or cheap and the model is where the money goes. The three that lock you to a vendor's own models (Claude Code to Claude, Gemini CLI to Gemini, Cursor's own models) are also the three where a plan rather than per-token billing is usually the better deal.
1. Claude Code (Anthropic)
Anthropic's own agent and the quality benchmark everyone else measures against: Claude Opus 5.5 inside Claude Code tops Terminal-Bench 4.1 at 65.8%, and Sonnet 5.5 sits at 63.9%. It runs in the terminal, VS Code, JetBrains and a desktop app, reads CLAUDE.md for project rules, and ships subagents, hooks, MCP, plan mode and an Agent SDK for building your own tools on top.
The constraint is the model: Claude Code speaks only Anthropic's Messages API, so it runs Claude models and nothing else (the Kimi K3.1 entry on Terminal-Bench used Claude Code's harness through a router, which is a project of its own). You pay either with a Pro ($20) or Max ($100 / $200) plan with usage windows, or per token with an API key. Pointing ANTHROPIC_BASE_URL at a gateway keeps the agent unchanged and changes the per-token price; our Claude Code setup guide covers the two environment variables.
2. Codex CLI (OpenAI)
OpenAI's terminal agent is open source under Apache 2.0, ships with an OS-level sandbox (Seatbelt on macOS, Landlock on Linux, DACL on Windows) that's on by default with network off, and reads AGENTS.md for instructions. It's the value leader on Terminal-Bench: GPT-6.2 Sol in Codex solved 61.5% of tasks for a total run cost of $349, which is $1.72 per solved task, a tenth of Claude Code's figure at a similar pass rate band.
You can sign in with a ChatGPT Plus account or use an OpenAI API key, and config.toml accepts model_providers entries with a custom base_url, so Codex will drive Claude, Gemini or DeepSeek through a gateway. Two gotchas: since Codex 0.121 the OPENAI_BASE_URL environment variable is ignored (the provider must be declared in config.toml), and wire_api = "responses" is the only supported protocol, so the endpoint has to implement the Responses API, not just Chat Completions. Headless mode is codex exec, which makes it the easiest of the ten to put in CI.
3. Gemini CLI and Antigravity (Google)
Gemini CLI is open source, reads GEMINI.md, and gives personal Google accounts 1,000 requests a day free, which makes it the cheapest way to try an agent at all. Antigravity is Google's newer agent CLI; running Gemini 4 Carbon it reached 64.6% on Terminal-Bench at $6.37 per solved task, the best quality-per-dollar in the top cluster.
Two cautions. Gemini CLI has no sandbox by default, so it edits with your user's permissions; and both tools are Gemini-only with no third-party endpoint, so a cheaper provider doesn't apply. Note the price change coming: Gemini 4 Argon and Carbon double to $4 / $20 per 1M tokens on December 1, 2026 at Google's list.
4. Cursor
The most popular AI IDE, sold as part of The X Subscription: Plus at $8 (Cursor's own Grok and Composer models only), Premium at $30, Super at $100 and Ultra at $200, with third-party models at API list price from prepaid credit on Premium and above. BYOK is allowed from Premium up, for chat and agent only (Tab, Auto, Cloud Agents and the CLI stay on Cursor's models), and on Teams and Enterprise plans BYOK requests still carry the $0.25 per 1M token Cursor Token Rate.
Cursor doesn't publish Terminal-Bench results, and its agent quality depends on which third-party model you select. It's the right choice when the IDE experience is the product you're buying; it's the wrong choice if your goal is the lowest cost per task, because every model request is either Cursor-priced or list-priced.
5. GitHub Copilot (BYOK)
The biggest change of 2026: since June 23 the Copilot app supports bring-your-own-key with OpenAI, Azure OpenAI, Anthropic, Ollama, LM Studio and any OpenAI-compatible endpoint, and you don't need a Copilot plan to use it. Keys live in the OS keychain, provider models appear in the picker next to Copilot's own, and the enterprise BYOK path added Responses API support and a configurable context window in January.
Copilot's own "Fusion" router leads Terminal-Bench 4.1 at 71.2%, but that run is priced as a Copilot plan rather than per token, so it can't be compared on cost per task. With BYOK you get the Copilot surface (IDE, CLI, app, agent sessions) on top of whatever provider and price you choose.
6. Cline
The reference open-source agent for VS Code and JetBrains: free, Plan/Act workflow, human approval on every edit and command, MCP support, and a provider list that includes "OpenAI Compatible" (any base_url + model ID) and Anthropic with a custom base URL. The step people skip is the Model Configuration block, where you declare context window, output limit and tool-calling support for a custom endpoint; get it wrong and the agent silently loses tools.
Cline has no benchmark entry because it isn't a model; its cost per task is the model's. Our Cline guide walks through connecting it to a gateway and the worked savings.
7. Kilo Code
Kilo started in 2025 as a fork of Roo Code (itself a Cline fork), and when Roo shut down on May 15, 2026 it became the landing spot for Roo's three million installs. It's no longer the same codebase: the current VS Code extension (v7, GA April 2, 2026) is rebuilt on the OpenCode server under an MIT licence, with code, plan, ask and debug agents, custom agents in Markdown, automatic subagents, an Agent Manager for parallel runs, and a CLI that is a fork of OpenCode. Roo users get a migration path for custom modes and MCP servers.
Like Cline it takes any OpenAI-compatible endpoint (base URL, key, model ID), with one quirk from its docs: always set the context size, because Kilo turns off automatic context management when it doesn't know the limit. Kilo also sells access to 500+ models through its own gateway, which is convenient but priced at or above list.
8. OpenCode
An open-source terminal agent (with a desktop app) whose opencode.jsonc lets you define any provider with a baseURL, a model list and headers, and even override a built-in provider's endpoint to route it through a proxy. It sells optional Go and Zen plans for bundled model access, but the free build on your own key is the common setup, and opencode vs claude code is now one of the most searched agent comparisons. Quality is the model's; the harness is lean and fast.
9. Aider
The original pair-programming CLI: git-native (every change is a commit), repo-map context, and a model prefix system that works with any OpenAI-compatible endpoint via --openai-api-base or OPENAI_API_BASE. Aider is token-hungry on large repos because of the repo map, which makes the per-token price and cache behaviour matter more than in most agents. Still the best choice for people who want the agent to stay out of the way.
Cost per Task: What the Benchmarks Say
The only honest way to compare agents on cost is the same tasks, the same day, with the spend published. Terminal-Bench 4.1 does that for the vendor CLIs; the BYOK agents don't appear because they aren't models, and their cost per task is the model's cost at whatever price you pay for it. The right-hand column shows what the same runs would cost through a gateway at 40% of list, assuming identical token usage.
| Agent / model (effort) | Pass rate | Run cost (330 tasks) | Cost per solved task | At 40% of list |
|---|---|---|---|---|
| Codex CLI / GPT-6.2 Sol (max) | 61.5% | $349 | $1.72 | not listed yet |
| Codex CLI / GPT-6.1 Sol (max) | 60.9% | $634 | $3.15 | $1.26 |
| Antigravity / Gemini 4 Hydrogen (high) | 56.4% | $784 | $4.21 | not listed yet |
| Claude Code / Kimi K3.1 Pro (max, via router) | 59.7% | $1,087 | $5.52 | not listed yet |
| Antigravity / Gemini 4 Argon (high) | 55.5% | $1,109 | $6.06 | $2.42 |
| Antigravity / Gemini 4 Carbon (high) | 64.6% | $1,358 | $6.37 | $2.55 |
| Codex CLI / GPT-6.2 Astra (max) | 62.1% | $1,409 | $6.88 | not listed yet |
| GitHub Copilot / Fusion (max) | 71.2% | $1,987 | $8.46 (plan-priced) | — |
| Claude Code / Haiku 5.5 (max) | 40.0% | $1,000 | $7.58 | $3.03 |
| Claude Code / Opus 5.5 (max) | 65.8% | $4,719 | $21.73 | $8.69 |
| Claude Code / Sonnet 5.5 (max) | 63.9% | $7,334 | $34.78 | $13.91 |
| Claude Code / Fable 5.2 (max) | 65.8% | $16,493 | $75.96 | $30.38 |
Source: tbench.ai Terminal-Bench 4.1, November 19, 2026. Cost per solved task = run cost ÷ (330 × pass rate), our calculation. All Claude Code and Codex runs were at maximum effort, the most expensive setting; real sessions at medium effort cost a fraction of these figures.
Two lessons carry over to the BYOK agents:
- Harness matters as much as model. Sonnet 5.5 cost more per task than Opus 5.5 in Claude Code at max effort because it retried more; run any agent at the effort you'd actually ship before you compare.
- The cheapest finished work in the frontier band isn't the flagship. Sol-class models and Gemini 4 Carbon finish tasks for $1–6; a Cline or OpenCode user on GPT-6.1 Sol or Carbon through a gateway is paying $1–3 per task for top-cluster quality.
Bringing Your Own Key: One Config for Seven Agents
Every BYOK agent in the table takes the same three values: a base URL, a key and a model ID. With a gateway, those three stay constant across agents and you switch models by changing the ID. Here they are for the agents that take a config file, using Oxyy as the endpoint:
// Cline / Kilo Code (Settings -> API Provider: "OpenAI Compatible")
// Base URL: https://api.oxyy.ai/v1 API Key: <OXYY_API_KEY> Model ID: claude-sonnet-5-5
// Model Configuration: context 1,000,000 · max output 128,000 · supports tool calls: on
// OpenCode (~/.config/opencode/opencode.jsonc)
{
"providers": {
"oxyy": {
"name": "Oxyy",
"env": ["OXYY_API_KEY"],
"package": "@opencode/ai/providers/openai-compatible",
"settings": { "baseURL": "https://api.oxyy.ai/v1" },
"models": { "gpt-6.1-sol": {}, "claude-sonnet-5-5": {}, "gemini-4-carbon": {}, "deepseek-v4-pro": {} }
}
}
}
# Codex CLI (~/.codex/config.toml)
model = "gpt-6.1-sol"
model_provider = "oxyy"
[model_providers.oxyy]
name = "Oxyy"
base_url = "https://api.oxyy.ai/v1"
env_key = "OXYY_API_KEY"
wire_api = "responses" # required: Codex speaks the Responses API only (since Feb 2026)
# Aider export OPENAI_API_BASE="https://api.oxyy.ai/v1" export OPENAI_API_KEY="$OXYY_API_KEY" aider --model openai/gpt-6.1-sol # Claude Code (Anthropic Messages endpoint, no /v1) export ANTHROPIC_BASE_URL="https://api.oxyy.ai" export ANTHROPIC_AUTH_TOKEN="$OXYY_API_KEY"
For Continue, the same values go into config.yaml as provider: openai, apiBase: https://api.oxyy.ai/v1. For Copilot, Settings → Model providers → Add provider → "OpenAI-compatible", then the base URL and key. Claude Code is the exception in two ways: it needs the Anthropic-format endpoint without /v1, and it will only accept Claude model IDs there.
How to Choose
Which agent you pick should follow from how you want to pay and how much you trust the defaults, not from the leaderboard order. In rough priority:
- Decide plan vs per-token first. If you'll use an agent all day, Claude Max, ChatGPT Plus or Cursor Premium can beat per-token billing. If usage is bursty or you want several models, per-token through a BYOK agent wins.
- If per-token, choose the harness you like, then the model. Cline and Kilo for VS Code with approvals; OpenCode or Aider for the terminal; Continue for configurable roles; Copilot BYOK if your team already lives in it. The model (and its price) is a separate decision.
- Run at medium effort, measure cost per task on 30 of your own issues, and only then raise effort where the pass rate drops. The benchmark figures above are all at max.
- Put the cheap model on the cheap work. Haiku 5.5, GLM-5.3-Flash or DeepSeek Flash on subagents, autocomplete and commit messages; Sol, Sonnet or Carbon on the main loop.
- Lower the base rate last. A gateway at 40% of list takes 60% off every line above without changing the agent.
Where Oxyy Fits
Oxyy.ai is a unified AI API gateway: one key, an OpenAI-compatible endpoint at https://api.oxyy.ai/v1 and an Anthropic-format endpoint at https://api.oxyy.ai, 170+ models from OpenAI, Anthropic, Google, xAI, DeepSeek and Z.ai at 40% of each vendor's list price with no platform fee. That makes it a drop-in provider for seven of the ten agents above (Codex CLI, Copilot BYOK, Cline, Kilo Code, OpenCode, Aider, Continue) and the model backend for Claude Code via ANTHROPIC_BASE_URL. Prices on the models that matter for agents: GPT-6.1 Sol and Claude Sonnet 5.5 at $0.80 / $4.00, Gemini 4 Carbon at $0.80 / $4.00, Claude Opus 5.5 at $1.60 / $8.00, DeepSeek V4 Pro at $0.264 / $0.792, Haiku 5.5 at $0.04 / $0.20. Two limits worth knowing: the newest models on the leaderboard (GPT-6.2, Gemini 4 Hydrogen, Kimi K3.1) weren't listed at the time of writing, and Gemini CLI and Cursor's own models can't be routed through any third-party endpoint.
If you want the highest pass rate and you'll pay for it, Claude Code on Opus 5.5. If you want the cheapest finished work, Codex CLI on a Sol model. If you want a free agent and total control of the model, Cline, OpenCode or Aider on your own key. And if you already pay for Copilot or Cursor, both now let you bring a key, which is the quiet reason BYOK won 2026: the agent is becoming a commodity and the model price is the bill. Whichever harness you choose, run it through one key at 40% of list and the ranking stays the same while every number in it shrinks.
Get a free Oxyy key and plug it into your coding agent →
Related: Claude Code with a cheaper API · Cline vs Roo Code · Chat Completions · Responses API · Anthropic SDK endpoint · Compare models · Pricing
Frequently Asked Questions
What is the best AI coding agent in 2026?
For raw pass rate, Claude Code with Claude Opus 5.5 (65.8% on Terminal-Bench 4.1). For cost per solved task, Codex CLI with GPT-6.2 or 6.1 Sol ($1.72–3.15). For a free, model-agnostic agent, Cline (VS Code) or OpenCode (terminal) on your own key.
Which AI coding agents are open source?
Codex CLI, Gemini CLI, Cline, Kilo Code, OpenCode, Aider and Continue are open source. Claude Code, Cursor and GitHub Copilot are proprietary (Claude Code's source is available under Anthropic's terms but not open-source licensed).
What does BYOK mean for a coding agent?
Bring Your Own Key: the agent sends requests to a model provider using your API key, so the provider bills you per token and the agent is free or plan-only. Agents with a custom base URL field can point that key at any OpenAI-compatible or Anthropic-compatible endpoint, including gateways.
Can I use Claude Code with GPT or Gemini?
Not directly. Claude Code only speaks the Anthropic Messages API and only accepts Claude model IDs. Routing it to other models requires a translating proxy ("Claude Code Router"); the Kimi K3.1 Terminal-Bench entry used that approach.
Does GitHub Copilot support bring your own key?
Yes. Since June 23, 2026 the Copilot app accepts OpenAI, Azure OpenAI, Anthropic, Ollama, LM Studio and any OpenAI-compatible endpoint, and you don't need a Copilot plan to use BYOK. Enterprise BYOK also supports the Responses API.
Does Cursor allow your own API key?
On Premium ($30), Super and Ultra plans, for chat and agent models only; Tab, Auto, Cloud Agents and the CLI use Cursor's models. Plus ($8) doesn't allow BYOK. Teams and Enterprise plans add a $0.25 per 1M token Cursor Token Rate even on your own key.
How much does an AI coding agent cost per task?
On Terminal-Bench 4.1 at max effort: $1.72 (Codex / GPT-6.2 Sol) to $75.96 (Claude Code / Fable 5.2) per solved task; Claude Code / Opus 5.5 is $21.73 and Antigravity / Gemini 4 Carbon $6.37. At medium effort and through a gateway at 40% of list, real figures are far lower.
Is Cline better than Cursor?
They're different products. Cline is a free open-source agent that runs on your own key with approvals on every action; Cursor is a paid IDE with its own models and a smoother experience. For lowest cost per task with model freedom, Cline; for an integrated IDE, Cursor.
What is the cheapest way to run a coding agent?
A free BYOK agent (Cline, OpenCode, Aider, Continue or Copilot BYOK) on a Sol-class or Gemini 4 Carbon model through a discounted gateway, at medium effort, with a cheap model on subagents. Gemini CLI's 1,000 free requests a day is the cheapest way to try one.
Do these agents work with one API key for every model?
The seven BYOK agents do: set the base URL to a gateway, paste the key, and switch models by ID. Claude Code works with the gateway's Anthropic endpoint for Claude models. Gemini CLI and Cursor's own models can't use a third-party endpoint.

