Guide · Agent skill
How to use the Migrate Gemini API to Google Cloud agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
This guide explains the Migrate Gemini API to Google Cloud agent skill, which helps an AI agent walk you through moving an app that calls Gemini models from Google AI Studio to Google Cloud's Agent Platform (formerly Vertex AI). It is written for people who have not used agent skills before. By the end you will know what the skill does, how to install it, how to ask for it, and what your Google Cloud project needs before the migration works.
Quick start
- 1Download and unzip the skill. Download the ZIP from this page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder, or upload it under Settings, Capabilities, Skills in the Claude apps.
- 2Prepare Google Cloud. Make sure you have a Google Cloud account with billing enabled, the gcloud CLI installed and authenticated, and IAM permission to grant roles on the target project.
- 3Set a budget alert. In the Billing Console, go to Billing, then Budgets & Alerts, then Create Budget, and set the threshold to your credit limit or the most you are willing to spend.
- 4Enable the Agent Platform API. Run gcloud services enable aiplatform.googleapis.com with your project ID.
- 5Set up authentication. Use Application Default Credentials for local work and grant roles/aiplatform.user. For a Compute Engine VM, grant the same role to its service account and check the access scope.
- 6Switch the SDK to Agent Platform. Set GOOGLE_CLOUD_PROJECT, GOOGLE_CLOUD_LOCATION and GOOGLE_GENAI_USE_ENTERPRISE=TRUE, then run your existing google-genai code.
What the skill makes the agent do
An agent skill is a folder of instructions that an AI agent loads when a task matches it. This skill covers one job: moving an application from the Gemini API in Google AI Studio (the generativelanguage.googleapis.com endpoint) to Gemini on Google Cloud Agent Platform (the aiplatform.googleapis.com endpoint).
When the skill is active, the agent follows a migration guide. It covers setting up billing and budget alerts, enabling the Agent Platform API, configuring authentication with Application Default Credentials and IAM roles, and comparing the two services. The source also tells the agent to tag its gcloud commands with an attribution string so usage can be tracked.
- Explains billing setup, including a budget alert so spending does not fall back to your normal payment method when credits run out
- Enables the Agent Platform API on your target project
- Sets up user authentication (local development) and service authentication (for example a Compute Engine VM)
- Shows how to switch the Google GenAI SDK to the Agent Platform backend with environment variables
Install the skill: download the ZIP and unzip it
Download the ZIP file for this skill from this page, then unzip it. You can install it in one of two places, depending on how you use your agent.
For a personal setup available across your projects, unzip the skill into ~/.claude/skills/. For a single project, unzip it into that project's .claude/skills/ folder. The skill's main file is SKILL.md, and it includes a references/attribution.md file that the agent reads before running commands.
If you use the Claude apps instead, upload the skill under Settings, then Capabilities, then Skills.
- Personal: ~/.claude/skills/
- Per project: .claude/skills/ inside the project folder
- Claude apps: Settings → Capabilities → Skills
Check what you need before you start
The migration only works if your Google Cloud setup is ready. The skill assumes these requirements are met, so check them first. The skill is not useful without them.
- A Google Cloud account with billing enabled. You must provide a valid payment method during setup.
- The gcloud CLI installed and authenticated on your machine.
- IAM permission to grant roles on the target project.
- The Agent Platform API (aiplatform.googleapis.com) enabled on that project.
Trigger the skill with natural requests
You do not need a special command. Ask in plain language about one of the situations the skill is built for: moving an app to Google Cloud, using Cloud credits for Gemini calls, or putting Gemini inference under the same IAM, billing and telemetry as your other Cloud resources.
The more specific your request, the better. Name your project and say whether the app runs on your laptop or on a Compute Engine VM, because the skill covers user and service authentication differently.
- "Help me move this Python app from Google AI Studio to Agent Platform."
- "I have Google Cloud free trial credits. How do I use them for Gemini API calls?"
- "Walk me through migrating our Gemini calls to Vertex AI so they run under our existing IAM and billing."
- "Set up authentication so my Compute Engine VM can call Gemini without an API key."
Understand the authentication steps
For local work, the skill has you authenticate with Application Default Credentials and grant your user the aiplatform.user role on the project. For applications on a Compute Engine VM, it has you grant the VM's service account that role instead.
Access scopes need a check. The skill notes that legacy access scopes can override IAM bindings. The VM's access scope should be set to allow full access to all Cloud APIs, or explicitly include the cloud-platform scope.
- Local: gcloud auth login, then gcloud auth application-default login
- Local role grant: roles/aiplatform.user for your user identity
- VM: grant roles/aiplatform.user to the VM's service account
- VM: confirm the access scope includes https://www.googleapis.com/auth/cloud-platform
gcloud projects add-iam-policy-binding "{project_id}" \
--member="user:YOUR_EMAIL@domain.com" \
--role="roles/aiplatform.user"Enable the API and switch the SDK
Enable the Agent Platform API on your project with the command below. Then set the environment variables that route the Google GenAI SDK (google-genai) to Agent Platform. The source says the same SDK works with both AI Studio and Agent Platform, so your Python code often needs no changes to its initialization.
Set GOOGLE_CLOUD_LOCATION to global or to a regional endpoint of your choice, as the comparison in the skill describes.
gcloud services enable aiplatform.googleapis.com --project="{project_id}"
export GOOGLE_CLOUD_PROJECT="{project_id}"
export GOOGLE_CLOUD_LOCATION="global"
export GOOGLE_GENAI_USE_ENTERPRISE=TRUEKnow the attribution tag and its safety limits
The skill tells the agent to tag gcloud commands it runs directly in the terminal with an attribution string, set inline on each command. The tag identifies the skill and its version and carries no user data. The source says not to use gcloud config set for this, because it would persist beyond the task. Commands written into generated scripts, Terraform or user code are not tagged.
The skill does not run scripts itself, according to its listing. It does use the network, and its instructions include a curl command that downloads and runs a setup script from Google Cloud Storage. Read that command before running it.
- Runs scripts: no (per the listing)
- Uses network: yes
- The optional ADC setup script is fetched from storage.googleapis.com and run with bash, so review it first
- Billing can incur charges if budgets are not set
CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:agent-platform-migrate-from-ai-studio)" \
gcloud <command> [flags]What people use it for
- Moving a prototype built in AI Studio into a Google Cloud project so it sits next to existing infrastructure.
- Using Google Cloud free trial or promotional credits toward Gemini inference, which the source says AI Studio calls cannot use.
- Running an agent framework such as the Agent Development Kit on a Compute Engine VM under one billing and IAM structure.
- Putting Gemini calls under the same telemetry and IAM controls as other Google Cloud services.
Frequently asked questions
How do I install the migrate Gemini API to Google Cloud agent skill?
Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use or into a project's .claude/skills/ folder for one project. In the Claude apps, you can instead upload it under Settings, then Capabilities, then Skills.
What do I need before using this skill?
You need a Google Cloud account with billing enabled, the gcloud CLI installed and authenticated, IAM permission to grant roles on the target project, and the Agent Platform API (aiplatform.googleapis.com) enabled on that project.
Is the skill free to use, and will it cost me money?
The skill itself is listed under the Apache-2.0 licence. Using Gemini on Agent Platform is billed through Google Cloud, so the source warns it can incur charges if budgets are not set. Set a budget alert before you start, and check current pricing on Google Cloud's own pages.
Can I keep using my AI Studio free API key instead?
Yes. This skill is not for people who only want to keep using AI Studio's free API key. The migration pushes you toward Google Cloud billing, so choose it only if you want Cloud credits, IAM, billing or telemetry for your Gemini calls.
Why does my Compute Engine VM still fail after granting the role?
The source says legacy access scopes can override IAM bindings. Check that the VM's access scope is set to allow full access to all Cloud APIs or explicitly includes https://www.googleapis.com/auth/cloud-platform.
Do I have to rewrite my Python code to move to Agent Platform?
Usually not for initialization. The source says the Google GenAI SDK works with both AI Studio and Agent Platform, and you mainly switch routing with environment variables such as GOOGLE_GENAI_USE_ENTERPRISE=TRUE.
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
This skill suits developers and ops engineers who want to run a Gemini app under Google Cloud billing, IAM and telemetry, or who want to use Cloud credits. It is a poor fit if you want to stay on AI Studio's free API key, have no Google Cloud account or payment method, or are uncomfortable with terminal commands and IAM roles.
Download the skill