跪拜 Guibai
← All articles
Backend · Developer · Artificial Intelligence

gemini-api-cli: Plug Gemini's Full Multimodal Stack Into Claude Code or Codex

By cxuanAI ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Claude Code and Codex can now call Gemini's full multimodal stack without switching windows or spinning up MCP servers. Monthly API credits bundled with Google AI Pro and Ultra subscriptions keep the extra cost near zero for many teams.

Summary

Google has released gemini-api-cli, a pure-Go single-file binary that brings Gemini's entire multimodal stack to whatever coding agent you already use. Instead of switching to Google's own interactive terminal agent (gemini-cli) or relying on a T3 Code front-end, you add gemini-api to PATH, mention it in your project's AGENTS.md, and your existing Claude Code, Codex, or other agent can shell out to Gemini for image generation, PDF analysis, video transcription, speech synthesis, music, or background Deep Research. The tool stays silent unless called, exposing self-describing schemas and a --dry-run mode so the host agent can validate HTTP requests before sending them.

Google DeepMind's Philipp released the project on October 26. It authenticates with a developer API key (GEMINI_API_KEY) rather than the OAuth flow used by gemini-cli, so it does not consume the quota in your Google AI Pro/Ultra subscription. However, Google now lets Pro and Ultra subscribers claim monthly API credits through Google AI Studio. Pro gets $10 per month, Ultra 5x gets $40, and Ultra 20x gets $100 (no credits for the $4.99 AI Plus plan; only the subscription's primary account earns them). Unused credits roll over for 12 months. The setup workflow covers installation, key configuration, a prompt block for AGENTS.md, and a Codex test that built a landing page with generated images, voiceover, and a background Deep Research task.

Takeaways
— gemini-api-cli is a zero-dependency, stateless, single-file Go binary released by Google DeepMind's Philipp on October 26.
— It authenticates with GEMINI_API_KEY only, using the developer API quota rather than the subscription quota.
— Google AI Pro subscribers can claim $10 per month in API credits; Ultra 5x gets $40; Ultra 20x ($199.99/month) gets $100. The $4.99 AI Plus plan gets none, and only the primary subscription account qualifies.
— Unused credits roll over for up to 12 months.
— After placing gemini-api in PATH, add a few lines to AGENTS.md or CLAUDE.md telling the host agent to use it; invoke with --usage, --schema, and --dry-run for discovery and pre-flight validation.
— Media commands return a local file path on stdout; agent/generate returns an interaction ID for chaining multi-step Deep Research tasks.
— Installation is via curl script, PowerShell one-liner, or go install; supports macOS, Linux, and Windows.
Conclusions

Google is treating its agent as a utility component rather than a competitor to Claude Code and Codex, acknowledging that developers won't switch their primary agent just to access Gemini models.

The self-describing --schema and --dry-run approach avoids the context-window bloat of MCP servers, making it a cleaner fit for long-lived agent sessions where system-prompt space is precious.

Monthly API credits attached to Pro and Ultra subscriptions turn a would-be paid API integration into a no-cost add-on for many developers, but only if they remember to claim the credits in Google AI Studio.

Concepts & terms
AGENTS.md
A markdown file placed in a repository to instruct coding agents (Claude Code, Codex, etc.) how to behave. The article recommends adding gemini-api usage rules there so any agent can discover and call it.
MCP (Model Context Protocol)
A protocol that connects AI agents to tools by embedding tool schemas in the system prompt. The article contrasts gemini-api-cli's on-demand schema lookup with MCP's approach of pre-loading many schemas, which can bloat context.
Deep Research
A Google managed agent available through the Gemini API that can perform long-running, internet-grounded research tasks in the background, returning results via an interaction ID.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗