ERA OF MINDS

Gemini API CLI in Claude Code: how to use Gemini 4 Neon (and what's free)

Short answer

To use Gemini 4 Neon in Claude Code, install Google's open-source gemini-api CLI, set GEMINI_API_KEY, add the gemini-api-cli skill to Claude Code, and tell Claude to call gemini-api generate -m gemini-4-neon. Two catches. Neon is not on the free tier: it costs $3 per million input tokens and $15 per million output tokens. The CLI's default model, Gemini 4 Hydrogen, is free on the free tier. And the install-skill command in the README is not in the latest release yet (v0.5.0). We got unknown command on the box this morning, so use npx skills add instead (steps below).

Era of Minds cover: Gemini API CLI in Claude Code. Tag: how-to, tested. Facts: open-source gemini-api CLI v0.5.0; use -m gemini-4-neon; Neon is paid, $3 in and $15 out per 1M tokens; default Hydrogen model is free; 380K views on Logan Kilpatrick's X post. Terminal panel: gemini-api generate with -m gemini-4-neon --dry-run; install-skill returns unknown command on v0.5.0, npx skills add works. Free tier table: Hydrogen free, 3.8 Flash TTS free, Gemma 4 free; Neon, Nano Banana 2.1 image, Omni video and Lyria music not free.
Figure: what each gemini-api command costs on the free tier, and what our install test found on November 27, 2026.

Logan Kilpatrick from Google posted a PSA on X at 20:01 UTC on November 25 (00:01 Dubai time on November 26): Google wants to make it "super easy for your coding agent of choice to use Gemini Neon and all of our models via the Gemini API CLI." When we checked the X API at about 10:30 Dubai time on November 27, the post had 380,585 views, 3,565 likes and 2,130 bookmarks. That bookmark count is high for a short post. People are saving it to set up later.

So we set it up. This guide covers what the tool is, how to plug it into Claude Code, which models you can run for free, and three things we ran into that the README doesn't tell you.

What is the Gemini API CLI?

The Gemini API CLI is a single Go program called gemini-api that lets any agent with shell access call the Gemini API. The google-gemini/gemini-api-cli repo is Apache 2.0 licensed and had 3,963 stars and 286 forks on November 27. The latest release is v0.5.0, published November 20, 2026. Google calls it beta and says breaking changes can happen between releases. It doesn't accept outside pull requests.

Claude Code plans the work. When it needs something Claude can't do, like an image, a voiceover, a transcript or a second opinion from a Gemini model, it runs a shell command and gets back text or a file path. Each command runs on its own and the CLI keeps no conversation state.

CommandWhat it doesDefault model
generateText and multimodal promptsgemini-4-hydrogen
analyzeQuestions about PDFs, images, audio, video, CSVs, YouTube URLsgemini-4-hydrogen
imageGenerate or edit images, saves the filegemini-nano-banana-2.1
ttsText to speech, saves a WAVgemini-3.8-flash-tts
transcribeAudio or video to text or SRT captionsgemini-3.5-transcribe
music / videoSongs and short videoslyria-3.5 / gemini-omni-1.2-flash
agent runStarts a managed agent such as Deep Research in the backgroundyou pick the agent

Defaults are from the README and from gemini-api models on v0.5.0, which we ran on November 27.

Is the Gemini API CLI the same as Gemini CLI?

No, and the names make this easy to mix up. Gemini CLI (@google/gemini-cli) is Google's own interactive coding agent, a rival to Claude Code. The Gemini API CLI (gemini-api) is not an agent. It's a plain client that your existing agent calls. Google's own skill file spells it out: gemini-api is "distinct from the interactive @google/gemini-cli coding agent." Most "Gemini inside Claude Code" guides you'll find set up Gemini CLI as a second agent. This one keeps Claude Code in charge and gives it Gemini as a tool.

How do you use Gemini 4 Neon in Claude Code, step by step?

  1. Install the CLI. On macOS or Linux: curl -fsSL https://raw.githubusercontent.com/google-gemini/gemini-api-cli/main/scripts/install.sh | bash. On Windows, the README gives a PowerShell one-liner. You can also download a prebuilt archive from the releases page; the Linux x86_64 one was 6.7 MB and its checksum matched checksums.txt when we tried it.
  2. Get an API key. Create one in Google AI Studio. Then either export GEMINI_API_KEY="your-key" or run gemini-api configure --api-key "your-key" to keep it in your OS keychain.
  3. Check which key wins. Run gemini-api whoami. Google's skill file calls this "the #1 auth trap": an exported GEMINI_API_KEY beats the key in your keychain, so you can end up billing a different project than you think.
  4. Preview a Neon call for free. gemini-api generate "Review this function for bugs" -m gemini-4-neon --dry-run prints the exact request (a POST to the Interactions API with "model": "gemini-4-neon") without sending it.
  5. Give Claude Code the skill. In your project folder: npx skills add google-gemini/gemini-skills --skill gemini-api-cli -a claude-code -y. This writes .claude/skills/gemini-api-cli/SKILL.md, which teaches Claude the commands, flags and auth rules.
  6. Ask for Neon by name. In Claude Code, say something like: "Use gemini-api with -m gemini-4-neon to review src/auth.ts and list bugs. Show me Neon's answer before changing anything." Claude runs the command in its shell and reads the reply.

If your agent doesn't load skills, the README has a four-line block you can paste into CLAUDE.md or AGENTS.md instead.

Is Gemini 4 Neon free in the Gemini API?

No. Google's Gemini API pricing page says it plainly: "Gemini 4 Neon is not available on the Free tier." But the CLI's default text model is free, and so are a few others. Here is what we found on November 27, 2026:

Model (CLI command)Free tierPaid, per 1M tokens (input / output)
gemini-4-neon (generate -m)Not available$3.00 / $15.00 (batch $1.50 / $7.50)
gemini-4-hydrogen (default for generate, analyze)Free of charge$1.50 / $7.50
gemini-3.8-flashFree of charge$0.75 / $3.75 (through Dec 31, 2026)
gemini-3.8-flash-tts (default for tts)Free of charge$0.50 text in / $9.00 audio out
Gemma 4 modelsFree of chargeNot offered on paid tier
gemini-4-argon, gemini-4-carbonNot available$2.00 / $10.00 (through Nov 30, 2026)
gemini-nano-banana-2.1 (default for image)Not available$1.50 in; images $30 per 1M output tokens (about $0.034 per 1K image)
gemini-omni-1.2-flash (video), lyria-3.5 (music)Not availablePaid only ($0.08 per Lyria 3.5 song)

Two things to know before you lean on the free tier. Google's pricing table marks free-tier usage as "Used to improve our products: Yes", so don't send client code you can't share. And rate limits on the free tier are lower; check yours on the AI Studio rate limit page. Both Neon and Hydrogen have a 1M-token context window, per the same page.

So a fair free setup is: Hydrogen for second opinions and file analysis, 3.8 Flash TTS for voiceovers, and Neon only when you add billing. Our earlier post on Gemini 4 Neon in Antigravity covers the other way to get Neon, through Google's own agent app and its plan quotas.

What did we find when we installed it?

We installed v0.5.0 on our Linux box at about 10:25 Dubai time on November 27, with no API key set, and ran every step above that doesn't need a key. Three things are worth knowing.

  • install-skill isn't in the release yet. The README tells you to run gemini-api install-skill --agent claude-code. On v0.5.0 that returns Error (validation_error): unknown command "install-skill" with exit code 2. The repo history shows why: the command was added on November 26 at 08:19 Pacific time, six days after v0.5.0 shipped, and main was 5 commits ahead of the release when we checked. Until a new release lands, npx skills add works. It took under 2 seconds for us and copied a 12,710-byte SKILL.md into .claude/skills/.
  • --dry-run doesn't check model names. We typed -m gemini-4-neonn (two n's) and the dry run still printed a request and exited 0. A dry run checks flags and the payload shape, not whether the model exists. Run gemini-api models (offline, no key) to see the 19 Gemini model IDs v0.5.0 knows, including gemini-4-neon.
  • Without a key, it stops cleanly. A real call returned HTTP 403 PERMISSION_DENIED and exit code 3, and the error message tells AI agents to stop and ask the user to create a key rather than retry. That's good behavior for Claude Code: it won't loop on a missing key.

One small context tip: gemini-api --usage dumps the whole command tree, which came to 49,032 bytes on v0.5.0. Let Claude use --help on one command at a time instead. Google's skill file gives the same advice.

What can Claude Code do with Gemini that it can't do alone?

  • Get a second opinion from another model. gemini-api generate "Review this diff for race conditions" -i changes.diff -m gemini-4-neon. Different models miss different things.
  • Read long media. gemini-api transcribe --input interview.mp4 --format srt --out interview.srt, or analyze a PDF or a YouTube URL. Files over about 14 MB go through files upload --wait first, and uploaded files are kept for 48 hours.
  • Make assets while building. image, tts and music write files straight into your project and print only the path, so Claude can drop them into the page it's building. Image, music and video need a paid key.
  • Hand off long research. gemini-api agent run "..." --agent deep-research-preview-04-2026 --background returns an interaction ID. Claude keeps working and checks back with agent status.

If you're new to skills, our guide on using Claude plugins free explains how skills and plugins load in Claude Code, and Anatomy is a good example of a single-purpose skill. For a reminder of why you still read a model's output before trusting it, see the Gemini 4 Argon "I MUST NOT DO THAT" quote, explained.

Should you set this up?

If you already pay for the Gemini API, yes. It's the quickest way we've seen to give Claude Code access to Neon, Gemini's media models and Deep Research without leaving the terminal. If you're on the free tier, it's still worth it for Hydrogen second opinions, PDF and video analysis and voiceovers. Just know that typing -m gemini-4-neon on a free key won't work, and that free-tier prompts can be used by Google. Pin a release version in scripts, since the tool is beta and the README already runs ahead of the latest release.

FAQ: Gemini API CLI in Claude Code

What is the Gemini API CLI?

It is Google's open-source command-line client for the Gemini API, a single Go program called gemini-api. Coding agents like Claude Code, Codex or Antigravity run it in their shell to call Gemini models, generate images, speech, music and video, analyze files, transcribe recordings or start managed agents like Deep Research. The latest release on November 27, 2026 is v0.5.0, and Google calls it beta.

How do I use Gemini 4 Neon in Claude Code?

Install gemini-api, set GEMINI_API_KEY (or run gemini-api configure), add the skill with npx skills add google-gemini/gemini-skills --skill gemini-api-cli -a claude-code -y, then ask Claude Code to run gemini-api generate with -m gemini-4-neon. Your key needs billing turned on, because Neon is not on the free tier.

Is Gemini 4 Neon free in the Gemini API?

No. Google's pricing page says Gemini 4 Neon is not available on the free tier. On the paid tier it costs $3.00 per million input tokens and $15.00 per million output tokens, or $1.50 and $7.50 in batch mode, as of November 27, 2026.

Which Gemini models are free with the gemini-api CLI?

On the free tier, Gemini 4 Hydrogen (the CLI's default for generate and analyze), Gemini 3.8 Flash, Gemini 3.5 Flash-Lite, Gemini 3.8 Flash TTS and the Gemma 4 models are free of charge. Neon, Argon, Carbon, Nano Banana 2.1 images, Omni video and Lyria music need a paid key. Free-tier usage can be used by Google to improve its products.

Why does gemini-api install-skill say unknown command?

Because install-skill was added to the repo on November 26, 2026, after the v0.5.0 release on November 20. The README already documents it, but the release binary doesn't have it yet. Use npx skills add google-gemini/gemini-skills --skill gemini-api-cli -a claude-code -y until a newer release ships.

Is the Gemini API CLI the same as Gemini CLI?

No. Gemini CLI (@google/gemini-cli) is Google's interactive coding agent. The Gemini API CLI (gemini-api) is a stateless client that another agent, like Claude Code, calls from the shell. Google's skill file describes gemini-api as distinct from the Gemini CLI coding agent.

Does gemini-api --dry-run cost anything?

No. A dry run validates the flags and request and prints the HTTP request with credentials hidden, without a network call. It also works with no API key. It does not check that the model name exists, so a typo like gemini-4-neonn still passes.

Can Claude Code generate images with the Gemini API CLI for free?

No. The image command uses gemini-nano-banana-2.1 by default, which is not on the free tier. Paid image output costs $30 per million tokens, which Google lists as about $0.034 per 1K image. Text with Hydrogen and speech with 3.8 Flash TTS are free on the free tier.

Sources

FREE WEEKLY AI BRIEF

Free. Unsubscribe anytime. Free gift: 50 AI prompts that actually work, sent the moment you join. More about Decoded