Gemini API in Agent Platform (google/skills)
## what it does
tl;dr: this is Google’s own procedure for calling Gemini on Agent Platform — the renamed Vertex AI. The skill picks the right model for the job, chooses between ADC and an API key, locks the agent to the new Gen AI SDK in five languages, and lists nine references/*.md files for code samples. The two lines that justify the page: Legacy SDKs: DO NOT use google-cloud-aiplatform, @google-cloud/vertexai, or google-generativeai. and Models like gemini-2.0-*, gemini-1.5-*, gemini-1.0-*, gemini-pro are legacy and deprecated. Your knowledge is outdated.
What it actually does
The SKILL.md (google/skills, fetched 2026-09-10, ~6.3 KB) starts with a naming note because the same product has had three names:
Agent Platform (full name Gemini Enterprise Agent Platform) was previously named “Vertex AI” and many web resources use the legacy branding.
So the agent has to read the skill first to know what to call it. After that the procedure is tight:
- Pick the SDK — one of five official Gen AI SDKs:
google-genai(Python),@google/genai(JS/TS),google.golang.org/genai(Go),com.google.genai:google-genai(Java),Google.GenAI(C#). The skill lists the install command for each. Anything else is rejected by the skill body. - Pick the auth mode — Application Default Credentials via
GOOGLE_CLOUD_PROJECT+GOOGLE_CLOUD_LOCATION+GOOGLE_GENAI_USE_ENTERPRISE=true, or Express mode viaGOOGLE_API_KEY+GOOGLE_GENAI_USE_ENTERPRISE=true. The skill says explicitly: prefer env vars, butgenai.Client()can be initialized without arguments to read them. - Pick the model — five primary models (
gemini-3.1-pro-preview,gemini-3.6-flash,gemini-3.5-flash-lite, the Nano Banana image family,gemini-live-2.5-flash-native-audio) and seven “only if explicitly requested” legacy models. Everything older (1.0/1.5/2.0,gemini-pro) is named deprecated with aYour knowledge is outdatednote. - Write the call — one copy-pasteable snippet per language, all using the same
models.generate_content(model=..., contents=...)shape. - Delegate to references — for the hard stuff (streaming, function calling, structured output, image gen, Live API, batch, tuning) the skill body says
See references/<topic>.mdand the agent is expected to fetch the right one.
The skill has a description that triggers specifically on enterprise / Vertex AI / Google Cloud / Agent Platform mentions. If the user is in AI Studio (consumer) it does not match — the repo has a separate agent-platform-migrate-from-ai-studio skill for that path.
Why it’s a skill, not a prompt
A model on its own knows about Gemini in the abstract. It does not know:
- That the
google-cloud-aiplatformfamily was deprecated in favor ofgoogle-genai. - That
gemini-3.1-pro-previewis the current reasoning tier, notgemini-1.5-proorgemini-2.0-pro. - That ADC needs
GOOGLE_GENAI_USE_ENTERPRISE=true(not just the project) to route to the renamed Agent Platform endpoint. - That the Live API needs
gemini-live-2.5-flash-native-audio, not the multimodal Flash.
Pasted into context, the SKILL.md changes those answers reliably — and that is the test config/skill-safety.md calls a useful skill. sandbox_test.verdict stays untested because we did not run the eval-vs-prompt protocol this session.
Install
The repo README is the install source of truth. Two common paths:
# Via skills.sh CLI (npx — same registry Vercel-labs/skills publishes)
npx skills add google/skills
# the CLI lets you pick which skills to install; `gemini-api` is in the AI/ML group
For hosts that only watch a local SKILL.md (Claude Code, Cursor, OpenCode, Kimi Code), clone and copy:
git clone https://github.com/google/skills
# place the skill folder where your host looks:
# ~/.claude/skills/gemini-api/SKILL.md (Claude Code)
# .claude/skills/gemini-api/SKILL.md (project-scoped)
# include references/ if you want the code-sample files
The README also documents per-harness plugin install (a heavier package that bundles the SKILL.md + an MCP config + a marketplace manifest). That install path is what the badge at the top of the README (skills.sh-install) is pointing at; the catalog page is for the SKILL.md only.
Gotchas
- Legacy-SDK refusal is the point. The skill body hard-rejects
google-cloud-aiplatform,@google-cloud/vertexai, andgoogle-generativeai. If an agent is still emitting those imports, the skill is not loaded. Don’t paste a hand-written Gemini example that uses them and expect the skill to “fix” it. - Three product names, one API. Vertex AI → Agent Platform → Gemini Enterprise Agent Platform. Docs URLs in the skill are
docs.cloud.google.com/gemini-enterprise-agent-platform/...; older blog posts still say Vertex AI. If the agent cites avertex-aiURL because a doc-search MCP server found it, the skill is the only thing that says “use the Agent Platform URL”. location="global"is the default. Hard-codingus-central1oreurope-west4works but loses global routing. The skill calls this out — do not overrideGOOGLE_CLOUD_LOCATIONunless the user names a region.- Reference files are not optional for advanced work. Text/multimodal, embeddings, structured output, media gen, Live API, batch, tuning, safety — each is a separate
references/<topic>.md. The skill body is the index; the actual code is in the references. The repo is structured so an agent that ignoresSee [references/...]will hallucinate API shapes. - Per-language package names differ. Python
google-genai≠ JS@google/genai≠ Gogoogle.golang.org/genai≠ Javacom.google.genai:google-genai≠ C#Google.GenAI. The skill lists all five. Don’t assume cross-pollination. - Plugin ≠ skill.
npx skills add google/skills(the catalog CLI) installs the SKILL.md.claude plugin install ...@google-plugins(Claude Code marketplace) installs the heavier plugin bundle that includes MCP servers and aplugin.jsonmanifest. The README is the index for which is which. sandbox_test.verdict: untested— we readSKILL.mdand the README; we did not run an eval-vs-prompt test this session.
Related: Anthropic Claude API skill — same job, different vendor: the Anthropic-published procedure for the Claude API and prompt-caching model picks; Microsoft Docs skill — same shelf, same shape: a vendor’s published “how to query our docs / SDK” skill rather than a community method; Writing Skills (obra/superpowers) — the meta-skill you reach for when this page’s “what it does” and “what it doesn’t” list isn’t enough and you need to author a new SKILL.md with a failing-test gate.
## compatibility
## embed this badge
