sync-gemini-api

sync-gemini-api is a command for Claude Code from enricoros/big-AGI. It costs 9 tokens per session (559 once invoked), scanned A, original, MIT.

A workflow for synchronizing a codebase’s Google Gemini integration with current API documentation. Gemini is Google’s family of AI models, and an API is the interface software uses to send requests and receive responses.

In plain words
What is it for?
Use it to inspect and update Gemini wire types, request adapters, and response parsers. It consults Google’s API documentation, caching information, changelog, and JavaScript SDK.
Why use it?
It helps detect changes in request formats, response parsing, streaming, caching, and model-based image generation while keeping the scope limited to the generateContent API.

Command for Claude Code

About the project

Big-AGI is an open-source workspace for using multiple AI models through chat and other AI functions. It is intended for engineers, founders, researchers, and other users who want to work with AI personas, model comparisons, image generation, voice, documents, and code-related features. The catalogue entries provide commands, instructions, and a skill for working with Big-AGI.

enricoros/big-AGI · 7,109 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/enricoros/big-agi/sync-gemini-api
Clone the repo
git clone --depth 1 https://github.com/enricoros/big-AGI

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sync-gemini-api

README.md
[![agentmods](https://agentmods.dev/badge/commands/enricoros/big-agi/sync-gemini-api.svg)](https://agentmods.dev/commands/enricoros/big-agi/sync-gemini-api)
Your own site
<a href="https://agentmods.dev/commands/enricoros/big-agi/sync-gemini-api"><img src="https://agentmods.dev/badge/commands/enricoros/big-agi/sync-gemini-api.svg" alt="Measured on agentmods" height="20"></a>
Per session 9 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 559 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00009 $0.00559
Opus 5 $0.00005 $0.00280
Sonnet 5 $0.00002 $0.00112
Haiku 4.5 $0.00001 $0.00056

Measured 4d ago against content hash 094ac816626b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

sync-gemini-api scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/aix/sync-gemini-api.md · 32 lines

What it actually says

Please take a look at my API code for Google Gemini: message wire types src/modules/aix/server/dispatch/wiretypes/gemini.wiretypes.ts, assembly of the request messages (adapters) src/modules/aix/server/dispatch/chatGenerate/adapters/gemini.generateContent.ts, and parsing of the response in streaming or not src/modules/aix/server/dispatch/chatGenerate/parsers/gemini.parser.ts.

IMPORTANT: we only support the generateContent API, not other Gemini APIs such as embeddings, etc. Caching is only supported when implicit, we do not explicitly manage Gemini Caches. Same for file uploads and other systems. Image generation happens through models, i.e. 'Gemini 2.5 Flash - Nano Banana' generates images using AIX from generateContent (chat input).

Then take a look at the newest API information available. Try these sources, and be creative if some are blocked:

Primary Sources:

Alternative Sources if primary blocked:

  • Google AI JavaScript SDK: https://github.com/googleapis/js-genai (check latest commits, README, type definitions) Recent news and announcements: Web Search for "gemini api changelog" or "nwe gemini api updates" or "new gemini api pricing"

If all blocked: Explain what you attempted and ask user to provide documentation manually.

Live endpoint (extra signal): If .env.api-keys has GEMINI_API_KEY, fire a real streaming generateContent request and inspect the raw SSE - ground-truth for new fields, event types, response shapes, and error formats that docs lag: POST https://generativelanguage.googleapis.com/v1beta/models/{model}:streamGenerateContent?alt=sse&key=$GEMINI_API_KEY. Never commit or echo the key.

$ARGUMENTS Check carefully and look if there are any discrepancies in the protocols, the available API surface, the structure of the messages, functionality, logic, etc. Make sure you look deep in the fields of the requests and responses, especially required fields, streaming event types, and any new response shapes.

Please point out all of the differences in the API whether it's in the final parsing and reassembly of the streaming message, or the protocol changed, etc. Prioritize breaking changes and new capabilities that would improve the user experience.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 32 lines · 9 tokens per session scan A 094ac816626b

Subscribe to this mod's changes

sync-gemini-api is a command published in the GitHub repository enricoros/big-AGI (7,109 stars, last pushed today), licensed MIT. It adds 9 tokens to every session and 559 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.