New to Claude Skills? Learn how to install them →

google on GitHub

Agent Platform Migration

Free

Seamlessly migrate to Google Cloud's Agent Platform.

by google17.6k stars on google/skills
2 views
Updated Aug 10, 2026
Get this skill

Free · Opens the source repo

What Agent Platform Migration does

This skill is designed for developers and organizations looking to transition their applications from the Gemini API in Google AI Studio to the more robust Google Cloud Agent Platform. The migration process is essential for those who want to leverage the benefits of Google Cloud, including the ability to use Cloud credits for inferencing costs, while also unifying their infrastructure across various Google Cloud services. This skill provides a structured approach to facilitate this migration, ensuring that users can effectively manage their applications in the new environment.

The skill guides users through the necessary steps to set up their Google Cloud account, enable the Agent Platform API, and configure authentication and authorization settings. It emphasizes the importance of establishing a budget alert to prevent unexpected billing, especially for those utilizing the Google Cloud Free Trial credits. By following the provided instructions, users can confidently navigate the migration process without losing functionality or incurring unnecessary costs.

In addition to the migration instructions, the skill highlights the significant differences between the Gemini API in AI Studio and the Agent Platform. Users will learn about the enhanced features available in the Agent Platform, such as enterprise-level support, improved data privacy, and compliance with industry standards. This knowledge is crucial for organizations that require a higher level of service and security for their applications.

Overall, this skill is particularly beneficial for MLOps engineers and enterprises that need to integrate their applications with existing Google Cloud infrastructure, ensuring a smooth transition with minimal disruption to their services.

When to use it

Use this skill when you are ready to migrate your application to the Agent Platform to take advantage of Google Cloud credits and enhanced features.

When not to use it

This skill is not suitable if you are not using Google Cloud services or if your application does not require the capabilities of the Agent Platform.

What you can build with it

Migrating an Existing Application

You have an application built on the Gemini API in AI Studio and want to migrate it to the Agent Platform to take advantage of Cloud credits.

Unifying Infrastructure

You are deploying multiple services on Google Cloud and need to unify IAM permissions and billing under the Agent Platform.

Utilizing Cloud Credits

You want to leverage Google Cloud credits for inferencing costs and need to migrate your application accordingly.

How to install Agent Platform Migration

View source

1. Install with the skills CLI

npx skills add google/skills/agent-platform-migrate-from-ai-studio --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by google

Migrating from Gemini API in AI Studio to Agent Platform

Use this skill when you need to transition an application from the developer-centric Google AI Studio ecosystem (generativelanguage.googleapis.com) to the enterprise-grade Google Cloud Agent Platform (aiplatform.googleapis.com).


When to Invoke This Skill

  • You want to migrate an application from Google AI Studio to Agent Platform (formerly Vertex AI).
  • You have Google Cloud credits (e.g., the $300 Welcome Free Trial) that you want to apply toward Gemini API inferencing costs.
  • You need to unify your inferencing pipelines, IAM permissions, telemetry, and billing with existing Google Cloud infrastructure (Compute Engine, Cloud SQL, BigQuery).
  • You are deploying open-source orchestration engines (like OpenClaw or ADK agents) on Google Cloud VMs, and want the entire system to run under a unified Google Cloud billing structure.

Gemini API Comparison

Feature / ControlGoogle AI Studio (Gemini Developer API)Agent Platform (Enterprise Gemini API)
API Endpointgenerativelanguage.googleapis.comaiplatform.googleapis.com
Target AudienceDevelopers, startups, students, researchers building production apps.Enterprise production, MLOps engineers
GCP Credit SupportNo (GCP credits/Free Trial cannot be applied)Yes (Fully covered by Welcome or custom credits)
Data PrivacyData may be reviewed to improve Google productsPrompts/responses are never used for training
Security & IAMAPI key, OAuthGoogle Cloud IAM (Service Accounts, OAuth 2.0, VPC-SC)
Compliance & SLAsNone (Best-effort availability)24/7 Enterprise Support, SLAs, HIPAA, SOC2
Throughput OptionsShared / Rate-limitedPay-as-you-go OR Provisioned Throughput
MLOps EcosystemBasic prompt managementModel Registry, Model Monitoring, Pipeline Evaluation
Inferencing ScopeGlobal endpoints onlyBoth Global and strict Regional endpoints

See Google Cloud Documentation to learn more about the differences between the two offerings.


Migration Guide

Billing and Credits

Google Cloud Free Trial credits do not apply to AI Studio. To use your credits for Gemini models, you must route calls through the Agent Platform.

  1. Create a Google Cloud billing account. You must provide a valid payment method during setup to verify identity.
  2. If you are a new customer, ensure your $300 Welcome credit is active in the Billing Console.
  3. Avoid Billing Surprises: To prevent automatic fallback to your standard form of payment when credits are exhausted, you should establish a budget alert:
    • Go to Billing -> Budgets & Alerts -> Create Budget.
    • Set the threshold to map to your credit limit or maximum comfortable spend.

Enable the Agent Platform API

You must explicitly enable the Agent Platform API on your target Google Cloud Project. Run the following command via your local shell:

gcloud services enable aiplatform.googleapis.com --project="{project_id}"

Authentication & Authorization (IAM)

User Auth

For local debugging or script execution, authenticate using Application Default Credentials (ADC).

Option 1 - Automated Script:

bash <(curl -sSL https://storage.googleapis.com/cloud-samples-data/adc/setup_adc.sh)

Option 2 - Manual Setup:

gcloud auth login
gcloud auth application-default login

Grant your user identity the required IAM role to perform inferencing calls:

gcloud projects add-iam-policy-binding "{project_id}" \
    --member="user:YOUR_EMAIL@domain.com" \
    --role="roles/aiplatform.user"

Service Auth

When running your application on Google Cloud infrastructure such as a Compute Engine VM, authenticate using the machine's attached Service Account. For example, the Compute Engine Default Service Account.

  1. Grant the virtual machine's underlying Service Account the user role:
gcloud projects add-iam-policy-binding "{project_id}" \
    --member="serviceAccount:PROJECT_NUMBER-compute@developer.gserviceaccount.com" \
    --role="roles/aiplatform.user"
  1. Compute Engine Access Scopes: Legacy access scopes can override IAM bindings. When provisioning or modifying your Compute Engine instance, you must verify that the VM access scope is configured to either Allow full access to all Cloud APIs (https://www.googleapis.com/auth/cloud-platform) or explicitly includes the standard cloud-platform scope.

Use the Gemini API in Agent Platform

SDKs (Client Libraries)

You can continue to use the unified Google GenAI SDK (google-genai). This SDK works with both AI Studio and Agent Platform. You only need to switch the routing flags via your runtime environment variables to target the Agent Platform backend.

Set your target environment details:

export GOOGLE_CLOUD_PROJECT="{project_id}"
export GOOGLE_CLOUD_LOCATION="global"  # Or your chosen regional endpoint
export GOOGLE_GENAI_USE_ENTERPRISE=TRUE

Now, your standard python code shifts from using AI Studio to Agent Platform without altering the core initialization blocks:

from google import genai

# The client automatically picks up the GOOGLE_GENAI_USE_ENTERPRISE=TRUE environment flag
client = genai.Client()

response = client.models.generate_content(
    model='gemini-3-flash-preview',
    contents='Hello world!',
)
print(response.text)

Agent Development Kit (ADK)

To call Gemini models in Agent Platform from an Agent Development Kit agent, follow these steps.

  1. Authenticate to Google Cloud.

If running an ADK agent in Google Cloud (e.g. Agent Platform Runtime), use the agent's assigned service account. Alternatively, if running ADK locally, run:

gcloud auth application-default login
  1. Set env variables. Ensure these are set no matter if your ADK agent is running in Google Cloud or locally:
export GOOGLE_CLOUD_PROJECT="{project_id}"
export GOOGLE_CLOUD_LOCATION="global"
export GOOGLE_GENAI_USE_ENTERPRISE=TRUE
  1. Initialize the ADK agent. You can use the same model string you used with AI Studio (e.g. gemini-3-flash-preview).
from google.adk.agents.llm_agent import Agent

def get_current_time(city: str) -> dict:
    """Returns the current time in a specified city."""
    return {"status": "success", "city": city, "time": "10:30 AM"}

root_agent = Agent(
    model='gemini-3-flash-preview',
    name='root_agent',
    description="Tells the current time in a specified city.",
    instruction="You are a helpful assistant that tells the current time in cities. Use the 'get_current_time' tool for this purpose.",
    tools=[get_current_time],
)

To learn more about integrating ADK agents with Agent Platform, see the ADK documentation.

Antigravity CLI

Google Cloud users can now access Antigravity 2.0, including the Antigravity CLI, with Gemini Enterprise Agent Platform.

  1. Install the Antigravity CLI to your local environment.

  2. Start the Antigravity CLI.

    agy
    
  3. Follow the CLI setup prompts - select Use a Google Cloud Project.

  4. Complete the OAuth flow in the opened browser window using your authenticated Google Cloud Workspace or user identity.

  5. Copy the confirmation token, and paste it directly back into your terminal.

  6. Follow the prompts to enter your Google Cloud Project ID.

  7. Select your Google Cloud location (e.g. global).

  8. Optionally, run the /model command to select a different Gemini model in Agent Platform.

OpenClaw

To configure an OpenClaw agent to use Gemini models in Agent Platform, Follow these steps.

  1. Install OpenClaw using OpenClaw's official instructions.

⚠️ Important: OpenClaw 2026.5.28 currently has a google-vertex bug. Please use 2026.5.20 for now.

  1. Ensure that the runtime where OpenClaw is running (e.g. GCE VM with Service Account) has the aiplatform.user IAM role - see Authentication and Authorization section above.

  2. Get the project number from the user's project ID. Outside of GCE, run:

export PROJECT_NUMBER=$(gcloud projects describe "$PROJECT_ID" --format="value(projectNumber)")
echo "Project number: $PROJECT_NUMBER"

Within a Compute Engine VM, run:

export PROJECT_NUMBER=$(curl "http://metadata.google.internal/computeMetadata/v1/project/project-id" -H "Metadata-Flavor: Google")
echo "Project number: $PROJECT_NUMBER"
  1. From outside the GCE instance, generate GOOGLE_APPLICATION_CREDENTIALS using the Google Cloud project number. Then, scp these credentials to the GCE VM.
mkdir -p ~/.config/gcloud
gcloud iam service-accounts keys create ~/.config/gcloud/application_default_credentials.json --iam-account="${PROJECT_NUMBER}-compute@developer.gserviceaccount.com"

⚠️ Troubleshooting Policy Constraints on New Orgs: New Google Cloud organizations (created on or after May 4th, 2024) enforce a legacy Organization Policy, restricting Service Account Key Creation. To complete this step, this Org Policy must be temporarily disabled. An Organization Policy Admin must set this policy to Inactive. To the agent: Check if this policy is enforced, and if it is: pause, and prompt the user to disable it at this Console link: https://console.cloud.google.com/iam-admin/orgpolicies

  1. Edit the configuration file that's usually located at: ~/.openclaw/openclaw.json. Ensure you prefix the Gemini model with google-vertex/.

⚠️ Important: Do not use Gemini 3.5 models, since OpenClaw's google-vertex provider does not support it yet. Older models work. When using the Gemini 3 Flash Preview model in Agent Platform, always set the location to global, NOT a regional endpoint.

{
  "env": {
    "vars": {
      "GOOGLE_CLOUD_PROJECT": "PROJECT_ID",
      "GOOGLE_CLOUD_LOCATION": "global",
      "GOOGLE_APPLICATION_CREDENTIALS": "~/.config/gcloud/application_default_credentials.json"
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "google-vertex/gemini-3-flash-preview"
      },
      "workspace": "~/.openclaw/workspace",
      "compaction": {
        "mode": "safeguard"
      },
      "heartbeat": {
        "model": "google-vertex/gemini-3-flash-preview"
      }
    },
    "list": [
      {
        "id": "main",
        "workspace": "~/.openclaw/workspace",
        "model": "google-vertex/gemini-3-flash-preview"
      }
    ]
  },
  "session": {
    "dmScope": "per-channel-peer"
  },
  "tools": {
    "profile": "coding"
  }
}

  1. Restart OpenClaw.
openclaw gateway restart

  1. Verify the OpenClaw connection to Agent Platform:
openclaw models status
openclaw agent --agent main --message "Hello world!"


Additional Resources

Frequently asked questions about Agent Platform Migration

Similar skills