Skip to content

Guide · Agent skill

How to use the Gemini API on Agent Platform agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The gemini-api skill gives an AI coding agent the instructions and reference notes it needs to call Google's Gemini models through Agent Platform, the enterprise name for what was previously called Vertex AI. It is aimed at developers and enterprise teams who already work with Google Cloud. By the end of this guide you will know what the skill does, how to install it, how to set up the credentials it expects, and how to ask your agent for Gemini code that uses the current Gen AI SDKs.

Gemini API on Agent Platformgoogle/skills · Apache-2.0

Quick start

  1. 1Download and unzip the skill. Download the gemini-api ZIP from this page and unzip it so you have a gemini-api folder containing SKILL.md and a references folder.
  2. 2Place the folder or upload it. Copy the folder into ~/.claude/skills/ for personal use or .claude/skills/ inside a project. In the Claude apps, upload the ZIP under Settings → Capabilities → Skills.
  3. 3Prepare Google Cloud access. Create or choose a Google Cloud project, enable the Agent Platform API, and set up Application Default Credentials or an Express Mode API key.
  4. 4Set environment variables. Export GOOGLE_CLOUD_PROJECT, GOOGLE_CLOUD_LOCATION and GOOGLE_GENAI_USE_ENTERPRISE, or GOOGLE_API_KEY for Express Mode, before running your code.
  5. 5Ask your agent for Gemini code. Describe the task and the language you want, naming Vertex AI, Google Cloud or Agent Platform so the skill activates. Review the code before running it.

What the gemini-api skill makes your agent do

Once installed, the skill tells the agent how to use the Gemini API in Agent Platform with the Google Gen AI SDK. It steers the agent toward the current SDKs for Python, JavaScript/TypeScript, Go, Java and C#, and away from the deprecated google-cloud-aiplatform, @google-cloud/vertexai and google-generativeai libraries.

  • Text generation, multimodal input (images, audio, video and documents), function calling and structured output
  • Context caching, embeddings, media generation and batch prediction
  • Live Realtime API for low-latency voice and video interactions
  • Explaining how to set up Google Cloud credentials or an Express Mode API key, and suggesting recent model names

Install the gemini-api skill

Download the ZIP for the skill from this page and unzip it. Then place the resulting gemini-api folder in one of these locations, depending on how you want to use it.

For a personal setup available across your projects, put it in ~/.claude/skills/. For a single project, put it in that project's .claude/skills/ folder. If you use the Claude apps instead, upload the ZIP under Settings → Capabilities → Skills.

  • Personal: ~/.claude/skills/
  • Project only: .claude/skills/ inside your project folder
  • Claude apps: Settings → Capabilities → Skills, then upload the ZIP

Set up Google Cloud credentials

The skill requires an active Google Cloud project with the Agent Platform API enabled, plus either Application Default Credentials or an Express Mode API key. The skill recommends environment variables over hard-coded values, so the client can be created without parameters.

For standard Google Cloud authentication, set your project, location and enterprise flag. The skill uses the global location by default, which routes requests to regions with available capacity. Name a specific region only if you need one.

For Express Mode, set an API key instead. Install the SDK for your language. For Python the source gives pip install google-genai.

  • Requires: Google Cloud project with the Agent Platform API enabled
  • Requires: Application Default Credentials or an Express Mode API key
  • Requires: the Gen AI SDK package for your language (for example google-genai for Python)
  • The gcloud CLI is needed only if the agent runs gcloud commands
export GOOGLE_CLOUD_PROJECT='your-project-id' export GOOGLE_CLOUD_LOCATION='global' export GOOGLE_GENAI_USE_ENTERPRISE=true pip install google-genai

Trigger the skill with natural requests

You do not need a special command. The skill is meant to activate when you ask about using Gemini in an enterprise environment or mention Vertex AI, Google Cloud or Agent Platform. Be specific about your language and the task, because the skill covers several SDKs and many capabilities.

The skill's own quick start is a short Python script that creates a client without arguments and calls generate_content. Your agent may adapt this pattern to your request.

  • 'Write a Python script that uses Gemini on Agent Platform to summarise the PDFs in this folder.'
  • 'Using the Google Gen AI SDK for JavaScript, add Gemini image understanding to my Express route.'
  • 'Show me how to get structured JSON from Gemini on Google Cloud with a Pydantic schema in Python.'
  • 'Migrate this google-generativeai code to the current SDK.'
from google import genai client = genai.Client() response = client.models.generate_content( model="gemini-3.8-flash", contents="Explain quantum computing", ) print(response.text)

Safety, network use and attribution

The skill does not run scripts. It supplies instructions and reference files, and the agent writes and runs whatever code or commands it decides are needed. The skill does use the network, because the code it helps produce calls Google Cloud APIs. Review commands and code before you run them, especially anything that touches billing, data buckets or production projects.

The skill includes an attribution rule. Before running any gcloud, REST API or MCP command, the agent should read the attribution reference, and for terminal gcloud commands it prefixes the command with a metrics environment variable that tags the skill and its version. The skill says not to use gcloud config set for this, so the tag does not persist beyond the task.

  • Scripts: none included in the skill
  • Network: yes, for calls to Google Cloud APIs
  • Use a non-production project while you test
  • Do not put API keys directly in code; the skill prefers environment variables
CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gemini-api)" \ gcloud <command> [flags]

Tips for better results

Name the SDK and language you want. Ask for a region only when you have a reason, since the skill defaults to the global endpoint. If you need a stable model for production, say so: the skill notes that its model list may change and that some models are in preview.

Models marked as legacy in the skill, such as gemini-2.0 and gemini-1.5 families, are deprecated. If the agent proposes one, ask it to use a current model from the skill's list. Some detailed topics such as live_api, media_generation, embeddings, safety and model tuning are in separate reference files that the agent reads when needed, so mention the feature by name.

  • Name the language: Python, JavaScript/TypeScript, Go, Java or C#
  • Ask for a specific feature by name, such as caching, embeddings or Live API
  • Check model names against your own project before deploying
  • Ask the agent to show the install step for the packages it uses

What people use it for

  • Building a Python service that summarises documents stored in Google Cloud Storage with Gemini
  • Adding image or video understanding to a JavaScript or TypeScript web app using the Gen AI SDK
  • Generating JSON that matches a schema for downstream processing in an enterprise data pipeline
  • Migrating older Vertex AI or google-generativeai code to the current Gen AI SDKs

Frequently asked questions

Is the gemini-api agent skill free?

The skill is published under the Apache-2.0 licence. Using Gemini through Agent Platform is billed through your Google Cloud project, so check Google Cloud's pricing for the models and features you use.

Do I need a Google Cloud account to use this skill?

Yes, in practice. The skill requires a Google Cloud project with the Agent Platform API enabled and either Application Default Credentials or an Express Mode API key. A consumer Gemini account alone is not enough.

How do I install the gemini-api skill?

Download the ZIP from this page, unzip it, and place the gemini-api folder in ~/.claude/skills/ or a project's .claude/skills/ folder. In the Claude apps, upload the ZIP under Settings → Capabilities → Skills.

Is this the same as Vertex AI?

Agent Platform is the full name of what was previously called Vertex AI. The skill covers the Gemini API on Agent Platform and uses the current Google Gen AI SDKs.

Why does the skill say not to use google-generativeai or google-cloud-aiplatform?

The skill lists those libraries as deprecated and tells the agent to use the new Gen AI SDKs instead, such as google-genai for Python and @google/genai for JavaScript/TypeScript.

Does the skill run code or check results for me?

No. It only gives the agent instructions and reference material. Your agent writes and runs any code, so you should test and review the output yourself.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use the gemini-api skill if you build on Google Cloud, work with Agent Platform or Vertex AI, and want your agent to write Gemini code against the current Gen AI SDKs. Pick something else if you only have a consumer Gemini account, need to pin model versions without review, or want an agent that verifies its own results.

Download the skill