Gemini API CLI
Updated
TL;DR: Gemini API CLI (by Google; category: Model API). A free, open-source command-line tool (gemini-api) that lets a coding agent you already use, such as Claude Code, Codex, Cursor or Antigravity, call Gemini models from the shell. One command can generate an image, voiceover or video into your project folder, analyze a file, transcribe audio, or start a Gemini managed agent such as Deep Research in the background and fetch the result later. It ships as a single Go binary for macOS, Linux and Windows, with a bundled agent skill that teaches your agent when and how to use it. It is a stateless API client, not a coding agent like Google's separate Gemini CLI. Pricing: The CLI is free under Apache 2.0. Every call it makes is billed at normal Gemini API rates for the model or managed agent used, on your own API key; see Google's Gemini API pricing page, which also says free-tier inputs may be used to improve Google's products (checked Nov 26, 2026).. Best for: Builders using Claude Code, Codex or Cursor who want Gemini media models.
BuildersModel APIGoogle
A free, open-source command-line tool (gemini-api) that lets a coding agent you already use, such as Claude Code, Codex, Cursor or Antigravity, call Gemini models from the shell. One command can generate an image, voiceover or video into your project folder, analyze a file, transcribe audio, or start a Gemini managed agent such as Deep Research in the background and fetch the result later. It ships as a single Go binary for macOS, Linux and Windows, with a bundled agent skill that teaches your agent when and how to use it. It is a stateless API client, not a coding agent like Google's separate Gemini CLI.
Features and pricing are based on Google's official site and docs (vendor claims), not our own testing. Our take is labeled separately below.
- Audience: people building software and AI agents
- Pricing (vendor's published price): The CLI is free under Apache 2.0. Every call it makes is billed at normal Gemini API rates for the model or managed agent used, on your own API key; see Google's Gemini API pricing page, which also says free-tier inputs may be used to improve Google's products (checked Nov 26, 2026).. Prices change, so verify on the official site.
- Official site: https://aistudio.google.com/docs/cli
- Source / changelog: https://github.com/google-gemini/gemini-api-cli
The Builder Brief Take
Who it's for
- Builders using Claude Code, Codex or Cursor who want Gemini media models
- Scripts and CI jobs that need Gemini without SDK code
- Anyone trying Gemini Deep Research from a terminal
Who should skip it
- People who want an interactive coding agent (use Gemini CLI)
- Teams on a single non-Google model provider
- Non-technical users
Where it works
- Product images: Have your agent generate or edit images straight into the project folder.
- Transcripts: Transcribe a recorded call or video from the shell.
- Background research: Start a Deep Research run and collect it later.
Pros and cons
Pros
- Free, Apache 2.0
- One binary for macOS, Linux and Windows
- Dry-run and self-describing commands for agents
- Works with agents from other vendors
Cons
- Beta, breaking changes possible
- Usage billed at Gemini API rates
- Free-tier inputs may be used by Google
- We have not tested it
The move: getting started with Gemini API CLI
- Use a billed key for client files
- Install and pin a release
- Run install-skill for your agent
- Try one media or transcript job
- Watch the bill for a week
How it helps
Who: A builder who already works with Claude Code, Codex or another shell agent and wants Gemini's image, video, audio or research models available inside the same session without writing SDK code.
- Create a Gemini API key in a billed Google AI Studio project if the files involve client work, since free-tier inputs may be used by Google.
- Install the binary from the official GitHub releases and pin the version in anything automated.
- Run gemini-api install-skill for your agent so it knows when to call the tool.
- Have the agent try one job you'd otherwise do by hand, such as generating product images or transcribing a recorded call, and check the output file.
- Use --dry-run first on anything that would run a long managed agent, and watch the API bill for the first week.
Result: Gemini's media and research models on call from the agent you already trust, with outputs landing as files in your project.
Why it matters
Editorial assessment: this is a small tool with a clear idea behind it. Agents work best with simple shell commands that describe themselves, and this gives them one for a whole model family instead of throwaway scripts. It's most useful if you want Gemini's media generation or Deep Research alongside a non-Google coding agent. If you only use one model provider, you probably don't need it. It's beta, so expect changes.
Gemini API CLI alternatives
- OpenRouter: One OpenAI-compatible API for 600+ models from 80+ providers, with automatic fallback, spend controls, Zero Data Retention routing, and an Auto Router (openrouter/auto) that picks a model per request within a cost tier you set.
- GroqCloud: Fast inference API for open models on Groq LPUs.
- Together AI: Cloud for open-source models: serverless inference for chat, vision, image, video, audio and embeddings models (GLM-5.3, Kimi K3, DeepSeek V4.1 Flash, Muse Spark Open, gpt-oss and more), provisioned throughput, dedicated endpoints, GPU clusters, code sandboxes, and fine-tuning.
- Mercury 3: Diffusion-based LLM from Inception built for speed: Inception reports 1,068 tokens per second on NVIDIA GPUs with a 1M-token context. OpenAI API compatible, available on the Inception API Platform, OpenRouter, Baseten and Vercel, plus Mercury Chat. Aimed at latency-sensitive work such as browser agents, voice and chat support, and real-time search.
- Mistral Large 4: Mistral's flagship model, released with open weights: a natively multimodal mixture-of-experts model (about 1 trillion parameters, roughly 52 billion active) with Low, Medium and High reasoning modes. Use it through the Mistral API, OpenRouter, Microsoft Foundry or NVIDIA NIM, or download the weights from Hugging Face and serve them with vLLM or SGLang. Trained in Europe.
- GLM-5.3: Z.ai's open-weights coding and agent model (753B parameters on Hugging Face), with a smaller GLM-5.3-Flash and FlashX for cheaper routine work. Use it through Z.ai's OpenAI-compatible API, through routers like OpenRouter and Ollama's cloud, or self-host the weights with vLLM or SGLang.
Recent changes
- 2026-11-20: v0.5.0 released (beta). Google introduced the CLI as an experimental preview on Oct 19, 2026, and says breaking changes can happen between minor versions, so pin a release in scripts and CI. Commands include --dry-run to check a request without sending it and --usage and --schema so agents can read the command surface offline. Vendor-documented; not tested by us. Source
Putting it to work? Get a starter stack for your job in about a minute with the Stack Picker, or see how done-with-you setup works if you want help.
Get changes in your inbox
New AI tools, honest reviews and playbooks. One email a week.
Almost done. Confirm your email in the beehiiv tab we just opened.
That email does not look right. Try again.
Free. Unsubscribe anytime.Make an AI tool? List your tool on Builder Brief. Free listings get the same editorial review as paid ones.