Gemini CLI or Claude Code: comparing terminal coding agents

Gemini CLI and Claude Code compared by models, custom provider support, access from Russia and cost, plus how to run Gemini through a gateway.

6 min · · агенты · сравнение

Gemini CLI and Claude Code look alike: both run in the terminal, read a project, edit files and run commands. The differences lie deeper: which models they work with, whether you can plug in your own API gateway and what a session costs. Below is a comparison on these points and a working way to run a Gemini model inside Claude Code. Prices are as of October 18, 2026.

For Gemini CLI we rely on the project's README and documentation (github.com/google-gemini/gemini-cli and geminicli.com). For Claude Code we rely on our documentation on connecting it. Check current versions with the tools themselves: CLI agents are updated often.

What these tools are

Gemini CLI is an open-source AI agent from Google for the terminal. It installs via npm (npm install -g @google/gemini-cli), brew, or runs through npx @google/gemini-cli. It can work with a codebase, connect MCP servers and run without a dialogue: gemini -p "...".

Claude Code is Anthropic's terminal agent: it also works with a project, runs commands, connects MCP servers, and supports hooks and subagents. There is a non-interactive mode claude -p, a VS Code extension and configuration via ~/.claude/settings.json.

For both tools what matters is not only the shell but what stands behind it: which model answers and at what price.

Models and sign-in

Gemini CLI. Per the README there are three authentication methods: signing in with a Google account, a Gemini API key from AI Studio, and Vertex AI. The agent is built for Gemini models. Two important notes are in the README itself: the unpaid tier and Google One users were moved from Gemini CLI to Antigravity CLI (the README gives the date June 18, 2026), and Gemini CLI itself, according to its authors, is not optimized for the newest Gemini models. If you are choosing a tool for years, see how that status looks in the repository when you read this.

Claude Code. Works over the Anthropic format (/v1/messages). Out of the box it offers sign-in with an Anthropic account, and for your own provider environment variables are enough:

  • ANTHROPIC_BASE_URL=https://api.zukko.pro (no /v1, the client adds the path itself);
  • ANTHROPIC_AUTH_TOKEN=fetch_... (AUTH_TOKEN, not API_KEY);
  • ANTHROPIC_MODEL=... to choose the model.

Can you plug in your own provider

Gemini CLI. The configuration documentation has a GOOGLE_GEMINI_BASE_URL variable that changes the request address when authenticating with a Gemini API key; the address must be HTTPS (or localhost). It is important to understand that Gemini CLI speaks Google's native protocol. According to its documentation, the Zukko gateway serves the OpenAI format (/v1/chat/completions) and the Anthropic format (/v1/messages), so we do not claim that Gemini CLI connects to it directly. This option fits only a proxy that forwards the native Gemini API.

Claude Code. Connecting another provider is officially supported through environment variables, and it is the standard scenario for Zukko. The config:

bash
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.zukko.pro",
    "ANTHROPIC_AUTH_TOKEN": "fetch_your_key",
    "ANTHROPIC_MODEL": "claude-sonnet-5-5"
  }
}

The file lives at ~/.claude/settings.json; if it already exists, merge the env block in without overwriting the rest. Signing in with Anthropic is not required, and if Claude Code still asks you to sign in, it usually means the token is not visible (check the variable name).

How to run a Gemini model in an agent via the gateway

Any gateway model can be called in any format, so you can put Gemini into Claude Code too:

bash
export ANTHROPIC_BASE_URL="https://api.zukko.pro"
export ANTHROPIC_AUTH_TOKEN="fetch_your_key"
export ANTHROPIC_MODEL="gemini-3.8-flash"
claude

An honest caveat: Claude Code is designed around Claude models, and we do not claim how confidently Gemini handles its tools (file edits, running commands, long chains of steps). Test on a small task in a throwaway branch. A low-risk option is to keep a strong model in the main slot and set a cheap one for background tasks through a slot variable. Zukko's documentation describes the slots ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL and ANTHROPIC_DEFAULT_HAIKU_MODEL for this.

There are alternatives among terminal agents that work with other providers. OpenCode connects to Zukko through the Anthropic provider with the address https://api.zukko.pro/v1 (with /v1, otherwise requests go to the wrong path), and in that configuration Claude models work. The comparison Claude Code, opencode, Aider, Cline covers the differences between approaches. Another option is Qwen Code: it connects to the gateway as an OpenAI-compatible provider with the address https://api.zukko.pro/v1.

Access from Russia and payment

For Gemini CLI, signing in with a Google account and a Gemini API key depends on whether Google services are available in your region. Per the Available regions page, Russia is not on the list for the Gemini API and Google AI Studio (the page was updated in April 2026), so an AI Studio key usually cannot be obtained from there. We do not suggest workarounds.

For Claude Code and the Gemini models in it, access from Russia goes through the gateway: payment by SBP (the payment page adds 8.5% on top), MasterCard cards or cryptocurrency, a dollar balance, no subscription. Top-ups start at $1.

What it costs

An agent sends the model the whole accumulated context at every step, so spend is driven by the price per million tokens. Take a hypothetical session: 3M fresh input tokens and 0.15M output tokens, ignoring cache.

ModelPrice in / out, $ per 1MCalculationTotal
gemini-3.8-flash0.125 / 0.63 × 0.125 + 0.15 × 0.6$0.465
claude-sonnet-5-50.4 / 23 × 0.4 + 0.15 × 2$1.50
claude-opus-5-50.8 / 43 × 0.8 + 0.15 × 4$3.00

This is an estimate without cache: in real sessions part of the input may be read from cache, which is billed separately (for claude-sonnet-5-5 a cache read costs $0.05 per 1M and a write $0.5). The cache discount for Claude comes with the Anthropic format, that is, with Claude Code. We calculate this in detail in How much a Claude Code agent costs.

Strength index (Artificial Analysis) as of October 18, 2026: gemini-3.8-flash 41, claude-sonnet-5-5 48, claude-opus-5-5 58. The index does not answer how a model will behave in your repository, so compare on real tasks.

Summary: what to choose

CriterionGemini CLIClaude Code
ModelsGeminiClaude; others via the gateway
Own providerGOOGLE_GEMINI_BASE_URL for a Gemini-compatible proxyANTHROPIC_* variables, Zukko gateway
Sign-inGoogle account, Gemini key, Vertex AIgateway key or Anthropic account
Access from Russiadepends on Google servicesvia gateway, SBP, MasterCard, crypto

If you specifically want native Gemini and have access to Google services, look at Gemini CLI and its status in the README. If you need an agent with a configurable provider, hooks and subagents and access from Russia, Claude Code on a gateway is more practical. Try the second option: create a key in the dashboard, set the three variables and run claude on a small task.

FAQ

Can I use Gemini CLI with a Zukko key?

We do not claim that: Gemini CLI uses Google's native protocol, and Zukko serves the OpenAI and Anthropic formats. If you want a Gemini model in a terminal agent, run it in Claude Code through ANTHROPIC_MODEL.

Which is better for code: Gemini 3.8 Flash or Claude Sonnet 5.5?

We do not claim that one model is better. On price gemini-3.8-flash is cheaper; on strength index claude-sonnet-5-5 is higher (48 vs 41). Test both on your own tasks.

Does Claude Code work without an Anthropic subscription?

Yes, when connected with a gateway API key through ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN. No subscription is needed, you pay for tokens.

How does Claude Code differ from opencode?

OpenCode is another terminal agent with a wider choice of providers. In Zukko it connects through the Anthropic provider with the address https://api.zukko.pro/v1. The differences are described in the harness comparison.

zukko

Pay 25×
less

for Claude Code & ChatGPT

One fetch_* key and base URL api.zukko.pro — for Cursor, Claude Code, Codex, and any SDK.

Get API keyDocumentation

api.zukko.pro · fetch_*

Gemini CLI vs Claude Code: terminal agents · Zukko