BotSherpa

Tools / Coding

Gemini API CLI

Google's experimental open-source (Apache-2.0) gemini-api command that lets coding agents call Gemini models, media generation and managed agents from the shell.

Free tierFree, open source (Apache-2.0); calls use your Gemini API key and Gemini API pricingCoding

Visit Gemini API CLI →

Short answer: Gemini API CLI (gemini-api) is Google's open-source (Apache-2.0) command-line tool that lets any coding agent with shell access, such as Claude Code, Codex or Antigravity, call the Gemini API: text and reasoning models, file analysis, image, speech, music and video generation, and Gemini managed agents like Deep Research. It is a single Go binary for macOS, Linux and Windows. The repo calls it experimental and the README says it is in beta, so breaking changes may happen between releases (checked Nov 26, 2026).

Not the same as Gemini CLI. Gemini CLI is Google's interactive coding agent for the terminal. Gemini API CLI is not an agent: it is a stateless tool that the agent you already use runs to reach Gemini models and media generation. Your agent plans the work; gemini-api just makes the API calls.

Updated 2026-11-26. Facts checked on official sites.

Gemini API CLI at a glance

CategoryCoding
PricingFree, open source (Apache-2.0); calls use your Gemini API key and Gemini API pricing
Free tierYes
Pricing checked2026-11-26
Official sitegithub.com/google-gemini/gemini-api-cli

Good for

Key facts (official repo, checked 2026-11-26)

Details
MakerGoogle (google-gemini on GitHub; copyright Google LLC)
LicenceApache-2.0 for software (LICENSE file); other materials CC BY 4.0
StatusExperimental / beta; latest release v0.5.0 (Nov 20, 2026); first release v0.1.0 (May 19, 2026); 12 releases; commits this week
PriceThe CLI is free; calls use your Gemini API key, so Gemini API pricing applies
PlatformsmacOS, Linux, Windows (arm64 and x86_64 builds)
RequirementsA Gemini API key from Google AI Studio; Go 1.26.10+ only if you build the development version
ContributionsIssues welcome; external pull requests are not accepted

What it can do

CommandWhat it does (default model per README)
generateText and multimodal generation (gemini-4-hydrogen)
imageGenerate or edit images (gemini-nano-banana-2.1)
tts, music, videoSpeech, music and video generation
analyze, transcribeAsk about PDFs, images, audio, video or YouTube URLs; transcribe to Markdown, text, JSON or SRT
agentRun, check, cancel and manage managed-agent interactions, such as a background Deep Research run
files, models, voicesFiles API uploads (48-hour retention), model catalog, custom voices

It is built for agents: --usage prints the whole command tree in machine-readable form, --schema prints JSON Schemas for request bodies, --dry-run previews the HTTP request without a network call or credentials, --agent-mode gives structured errors, and exit codes separate API, usage and auth failures. Media commands write files to disk and print just the path, so the agent can keep building.

How to start

  1. Install: curl -fsSL https://raw.githubusercontent.com/google-gemini/gemini-api-cli/main/scripts/install.sh | bash on macOS or Linux, the PowerShell script on Windows, go install github.com/google-gemini/gemini-api-cli/cmd/gemini-api@latest, or a prebuilt binary from GitHub Releases.
  2. Create an API key in Google AI Studio and set GEMINI_API_KEY, or store it with gemini-api configure --api-key.
  3. Test with gemini-api generate "Hello from my agent" --dry-run, then without --dry-run.
  4. Paste the README's instruction block into your agent's AGENTS.md or CLAUDE.md so it knows the tool exists.

Who it's for, and the limits

Alternatives

OptionChoose it when
Gemini CLIYou want Google's own coding agent in the terminal
OpenRouterYou want one API key for models from many providers
Claude CodeYou need the agent that does the work; it can run gemini-api from its shell

Related: test how agents use your API

Building tools for coding agents? Hurdle by Together AI (MIT, free npm library) runs Claude Code and Codex on tasks against your API, docs, skills or MCP servers and shows the pass rates (checked 2026-11-30).

Alternatives to Gemini API CLI

Conductor

Mac app to run Claude Code, Codex, Cursor and OpenCode agents in parallel. Joining Meta; no new sign-ups or downloads as of Nov 4, 2026.

PaidNo new sign-ups or downloads (from Nov 4, 2026). Existing users free; Conductor Cloud read-only Nov 13, shuts Nov 20. Local updates until early 2027.Coding

Expo Simulators

Cloud iOS Simulators and Android Emulators from Expo that coding agents like Claude Code, Codex and Cursor can start, install a build on, drive and record, so they can verify their own mobile app changes.

PaidPaid Expo plans (Starter $19/mo and up); $0.10 per simulator minute, 60 min/month included until 2027Coding

Hurdle

Together AI's open-source (MIT) npm library that runs Claude Code and Codex on tasks against your API, docs, skills or MCP servers, scores each run, and shows pass rates by model and condition.

Free tierFree, open source (MIT); you pay for the agent's model usage, and Together credits for optional sandboxed runsCoding

T3 Code

Free, open-source app to run and manage several coding agents at once.

Free tierFree and open source (MIT); you pay your own AI providerCoding

Cursor

AI-first code editor with agentic coding.

Free tierFree (limited); Plus $8/mo (Grok models only); Premium $30/mo; Super $100/mo; Ultra $200/mo; Teams from $30/user/moCoding

GitHub Copilot

AI pair programmer inside your editor and GitHub.

Free tierFree; Pro $10/mo; Pro+ $39/mo; Max $100/mo; Business and Enterprise plans for organizationsCoding

More Coding task guides

Gemini API CLI FAQ

Is Gemini API CLI the same as Gemini CLI?

No. Gemini CLI is Google's interactive coding agent. Gemini API CLI (the gemini-api command) is a stateless tool that other agents and scripts run to call Gemini models, media generation and managed agents.

Is Gemini API CLI free?

The CLI is open source under Apache-2.0 and free to install. The calls it makes use your Gemini API key, so Gemini API pricing applies.

Is Gemini API CLI stable?

Not yet. The repository calls it experimental and the README says it is in beta with possible breaking changes, so Google recommends pinning a release version in CI.

Which agents can use it?

Any agent with shell access. The README names Codex, Claude Code, Antigravity, OpenClaw and Hermes.

Can I contribute code?

Google accepts bug reports and feedback through GitHub Issues but does not accept external pull requests.

Sources checked 2026-11-26: github.com/google-gemini/gemini-api-cli, github.com/google-gemini/gemini-api-cli/blob/main/LICENSE, github.com/google-gemini/gemini-api-cli/releases.

Pricing changes often; confirm on the official site before buying.

Get the 5 best new AI tools every week. Free.

BotSherpa Weekly: five hand-picked AI tools, one email, every week. Unsubscribe anytime.