agent skills

Gemini API in Agent Platform (google/skills)

Google-published Agent Skill for the Gemini API on Agent Platform (formerly Vertex AI). Drives the Gen AI SDK across Python, JS/TS, Go, Java, and C# — picks the right model, picks ADC vs API-key auth, refuses legacy SDKs. Not a generic 'use Gemini' prompt.
by Google (Cloud AI / Agent Platform team) updated Sep 10, 2026 other
install via your agent of choice
❯ npx skills add google/skills (selects skills interactively, including `gemini-api`). For hosts that only watch a local `SKILL.md`, clone https://github.com/google/skills and copy `skills/cloud/gemini-api/` (plus `references/*.md` for code samples) into the host's skills directory. The repo README also documents per-harness plugin install: `claude plugin marketplace add google/skills` then `claude plugin install <plugin>@google-plugins` (Claude Code), `codex plugin marketplace add google/skills` (Codex), `agy plugin install https://github.com/google/skills/<plugin-path>` (Antigravity CLI).

## 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:

  1. 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.
  2. Pick the auth mode — Application Default Credentials via GOOGLE_CLOUD_PROJECT + GOOGLE_CLOUD_LOCATION + GOOGLE_GENAI_USE_ENTERPRISE=true, or Express mode via GOOGLE_API_KEY + GOOGLE_GENAI_USE_ENTERPRISE=true. The skill says explicitly: prefer env vars, but genai.Client() can be initialized without arguments to read them.
  3. 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 a Your knowledge is outdated note.
  4. Write the call — one copy-pasteable snippet per language, all using the same models.generate_content(model=..., contents=...) shape.
  5. 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>.md and 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-aiplatform family was deprecated in favor of google-genai.
  • That gemini-3.1-pro-preview is the current reasoning tier, not gemini-1.5-pro or gemini-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, and google-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 a vertex-ai URL 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-coding us-central1 or europe-west4 works but loses global routing. The skill calls this out — do not override GOOGLE_CLOUD_LOCATION unless 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 ignores See [references/...] will hallucinate API shapes.
  • Per-language package names differ. Python google-genai ≠ JS @google/genai ≠ Go google.golang.org/genai ≠ Java com.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 a plugin.json manifest. The README is the index for which is which.
  • sandbox_test.verdict: untested — we read SKILL.md and 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

claude-code ✓
cursor ✓
cline
aider
codex-cli ✓
copilot-cli ✓
gemini-cli ✓
opencode ✓
kimi-code ✓

## embed this badge

cache ✓ in cache.directory
![cached](https://cache.directory/badge/google-gemini-api.svg)