[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M698YDAZ24VB915XJZHV6JAE":3,"skill-same:01M698YDAZ24VB915XJZHV6JAE":80},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":43,"linkOnly":44,"markdownContent":45,"markdownBody":46,"frontMatter":47,"refName":51,"commitSha":52,"skillDirectory":53,"forksCount":54,"repositoryHtmlUrl":55,"repositoryHomepageUrl":6,"ownerHtmlUrl":56,"ownerBlogUrl":57,"ownerDescription":58,"updatedAt":59,"install":60,"resources":73},"01M698YDAZ24VB915XJZHV6JAE","agent-platform-migrate-from-ai-studio",null,"Guides agents and users through migrating from Gemini API in Google AI Studio to Gemini Enterprise Agent Platform (formerly Vertex AI). Use this skill when moving applications to Google Cloud, to leverage Cloud credits, or to unify inferencing with other Cloud infrastructure (IAM, billing, telemetry).","google\u002Fskills","google","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1342004?v=4","01M698VYEFDM0VJBZDYYJ2T83S","Google","01M698WR0H76ENHE587T9EJT89",24122,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fagent-platform-migrate-from-ai-studio\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,9,35,36,37,38,39,40,41,42],"migrate","agent platform","studio","platform","agent platform migrate from ai studio","gemini enterprise agent platform","google cloud","infrastructure","iam","applications","api","credits","leverage","guides","billing","gemini api","unify","when","gemini","2026-11-10 10:12:30",false,"---\nname: agent-platform-migrate-from-ai-studio\nmetadata:\n  version: \"1.0.1\"\n  category: AiAndMachineLearning\ndescription: >-\n  Guides agents and users through migrating from Gemini API in Google AI Studio to Gemini Enterprise Agent Platform (formerly Vertex AI). Use this skill when moving applications to Google Cloud, to leverage Cloud credits, or to unify inferencing with other Cloud infrastructure (IAM, billing, telemetry).\n---\n\n# Migrating from Gemini API in AI Studio to Agent Platform\n\nUse this skill when you need to transition an application from the\ndeveloper-centric Google AI Studio ecosystem\n(`generativelanguage.googleapis.com`) to the enterprise-grade Google Cloud Agent\nPlatform (`aiplatform.googleapis.com`).\n\n## Attribution\n\n**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you\nMUST read [Usage Attribution](references\u002Fattribution.md). For commands executed\ndirectly in the terminal (never in generated scripts, Terraform, or user code),\nprefix `gcloud` with\n`CLOUDSDK_METRICS_REQUEST_ATTRIBUTION=\"agent-skills\u002F1.0 (skill:agent-platform-migrate-from-ai-studio)\"`\nand append\n`agent-skills\u002F1.0 (skill:agent-platform-migrate-from-ai-studio)`\nto `User-Agent` headers.\n\n--------------------------------------------------------------------------------\n\n## When to Invoke This Skill\n\n*   You want to migrate an application from Google AI Studio to Agent Platform\n    (formerly Vertex AI).\n*   You have **Google Cloud credits** (e.g., the $300 Welcome Free Trial) that\n    you want to apply toward Gemini API inferencing costs.\n*   You need to unify your inferencing pipelines, IAM permissions, telemetry,\n    and billing with existing Google Cloud infrastructure (Compute Engine, Cloud\n    SQL, BigQuery).\n*   You are deploying open-source orchestration engines (like OpenClaw or ADK\n    agents) on Google Cloud VMs, and want the entire system to run under a\n    unified Google Cloud billing structure.\n\n--------------------------------------------------------------------------------\n\n## Gemini API Comparison\n\nFeature \u002F Control      | Google AI Studio (Gemini Developer API)                               | Agent Platform (Enterprise Gemini API)\n:--------------------- | :-------------------------------------------------------------------- | :-------------------------------------\n**API Endpoint**       | `generativelanguage.googleapis.com`                                   | `aiplatform.googleapis.com`\n**Target Audience**    | Developers, startups, students, researchers building production apps. | Enterprise production, MLOps engineers\n**GCP Credit Support** | No (GCP credits\u002FFree Trial **cannot** be applied)                     | Yes (Fully covered by Welcome or custom credits)\n**Data Privacy**       | Data may be reviewed to improve Google products                       | Prompts\u002Fresponses are **never** used for training\n**Security & IAM**     | API key, OAuth                                                        | Google Cloud IAM (Service Accounts, OAuth 2.0, VPC-SC)\n**Compliance & SLAs**  | None (Best-effort availability)                                       | 24\u002F7 Enterprise Support, SLAs, HIPAA, SOC2\n**Throughput Options** | Shared \u002F Rate-limited                                                 | Pay-as-you-go OR Provisioned Throughput\n**MLOps Ecosystem**    | Basic prompt management                                               | Model Registry, Model Monitoring, Pipeline Evaluation\n**Inferencing Scope**  | Global endpoints only                                                 | Both Global and strict Regional endpoints\n\nSee\n[Google Cloud Documentation](https:\u002F\u002Fdocs.cloud.google.com\u002Fgemini-enterprise-agent-platform\u002Fmodels\u002Fmigrate\u002Fmigrate-google-ai.md.txt)\nto learn more about the differences between the two offerings.\n\n--------------------------------------------------------------------------------\n\n## Migration Guide\n\n### Billing and Credits\n\nGoogle Cloud Free Trial credits\n**[do not apply to AI Studio](https:\u002F\u002Fdocs.cloud.google.com\u002Ffree\u002Fdocs\u002Ffree-cloud-features.md.txt)**.\nTo use your credits for Gemini models, you must route calls through the Agent\nPlatform.\n\n1.  Create a Google Cloud billing account. You must provide a valid payment\n    method during setup to verify identity.\n2.  If you are a new customer, ensure your $300 Welcome credit is active in the\n    Billing Console.\n3.  **Avoid Billing Surprises:** To prevent automatic fallback to your standard\n    form of payment when credits are exhausted, you should establish a budget\n    alert:\n    *   Go to **Billing** -> **Budgets & Alerts** -> **Create Budget**.\n    *   Set the threshold to map to your credit limit or maximum comfortable\n        spend.\n\n### Enable the Agent Platform API\n\nYou must explicitly enable the Agent Platform API on your target Google Cloud\nProject. Run the following command via your local shell:\n\n```bash\ngcloud services enable aiplatform.googleapis.com --project=\"{project_id}\"\n```\n\n### Authentication & Authorization (IAM)\n\n#### User Auth\n\nFor local debugging or script execution, authenticate using\n[Application Default Credentials](https:\u002F\u002Fdocs.cloud.google.com\u002Fdocs\u002Fauthentication\u002Fapplication-default-credentials.md.txt)\n(ADC).\n\n**Option 1 - Automated Script**:\n\n```bash\nbash \u003C(curl -sSL https:\u002F\u002Fstorage.googleapis.com\u002Fcloud-samples-data\u002Fadc\u002Fsetup_adc.sh)\n```\n\n**Option 2 - Manual Setup**:\n\n```bash\ngcloud auth login\ngcloud auth application-default login\n```\n\nGrant your user identity the required IAM role to perform inferencing calls:\n\n```bash\ngcloud projects add-iam-policy-binding \"{project_id}\" \\\n    --member=\"user:YOUR_EMAIL@domain.com\" \\\n    --role=\"roles\u002Faiplatform.user\"\n```\n\n#### Service Auth\n\nWhen running your application on Google Cloud infrastructure such as a Compute\nEngine VM, authenticate using the machine's attached Service Account. For\nexample, the\n[Compute Engine Default Service Account](https:\u002F\u002Fdocs.cloud.google.com\u002Fcompute\u002Fdocs\u002Faccess\u002Fservice-accounts#default_service_account.md.txt).\n\n1.  Grant the virtual machine's underlying Service Account the user role:\n\n```bash\ngcloud projects add-iam-policy-binding \"{project_id}\" \\\n    --member=\"serviceAccount:PROJECT_NUMBER-compute@developer.gserviceaccount.com\" \\\n    --role=\"roles\u002Faiplatform.user\"\n```\n\n2.  **[Compute Engine Access Scopes](https:\u002F\u002Fdocs.cloud.google.com\u002Fcompute\u002Fdocs\u002Faccess\u002Fservice-accounts.md.txt):**\n    Legacy access scopes can override IAM bindings. When provisioning or\n    modifying your Compute Engine instance, you must verify that the VM access scope is\n    configured to either **Allow full access to all Cloud APIs**\n    (`https:\u002F\u002Fwww.googleapis.com\u002Fauth\u002Fcloud-platform`) or explicitly includes\n    the standard cloud-platform scope.\n\n--------------------------------------------------------------------------------\n\n## Use the Gemini API in Agent Platform\n\n### SDKs (Client Libraries)\n\nYou can continue to use the unified\n[Google GenAI SDK](https:\u002F\u002Fdocs.cloud.google.com\u002Fgemini-enterprise-agent-platform\u002Fmodels\u002Fsdks\u002Foverview.md.txt)\n(`google-genai`). This SDK works with both AI Studio and Agent Platform. You\nonly need to switch the routing flags via your runtime environment variables to\ntarget the Agent Platform backend.\n\nSet your target environment details:\n\n```bash\nexport GOOGLE_CLOUD_PROJECT=\"{project_id}\"\nexport GOOGLE_CLOUD_LOCATION=\"global\"  # Or your chosen regional endpoint\nexport GOOGLE_GENAI_USE_ENTERPRISE=TRUE\n```\n\nNow, your standard python code shifts from using AI Studio to Agent Platform\nwithout altering the core initialization blocks:\n\n```python\nfrom google import genai\n\n# The client automatically picks up the GOOGLE_GENAI_USE_ENTERPRISE=TRUE environment flag\nclient = genai.Client()\n\nresponse = client.models.generate_content(\n    model='gemini-3-flash-preview',\n    contents='Hello world!',\n)\nprint(response.text)\n```\n\n### Agent Development Kit (ADK)\n\nTo call Gemini models in Agent Platform from an Agent Development Kit agent,\nfollow these steps.\n\n1.  Authenticate to Google Cloud.\n\nIf running an ADK agent in Google Cloud (e.g. Agent Platform Runtime), use the\nagent's assigned service account. Alternatively, if running ADK locally, run:\n\n```bash\ngcloud auth application-default login\n```\n\n1.  Set env variables. Ensure these are set no matter if your ADK agent is\n    running in Google Cloud or locally:\n\n```bash\nexport GOOGLE_CLOUD_PROJECT=\"{project_id}\"\nexport GOOGLE_CLOUD_LOCATION=\"global\"\nexport GOOGLE_GENAI_USE_ENTERPRISE=TRUE\n```\n\n2.  Initialize the ADK agent. You can use the same model string you used with AI\n    Studio (e.g. `gemini-3-flash-preview`).\n\n```python\nfrom google.adk.agents.llm_agent import Agent\n\ndef get_current_time(city: str) -> dict:\n    \"\"\"Returns the current time in a specified city.\"\"\"\n    return {\"status\": \"success\", \"city\": city, \"time\": \"10:30 AM\"}\n\nroot_agent = Agent(\n    model='gemini-3-flash-preview',\n    name='root_agent',\n    description=\"Tells the current time in a specified city.\",\n    instruction=\"You are a helpful assistant that tells the current time in cities. Use the 'get_current_time' tool for this purpose.\",\n    tools=[get_current_time],\n)\n```\n\nTo learn more about integrating ADK agents with Agent Platform,\n[see the ADK documentation](https:\u002F\u002Fraw.githubusercontent.com\u002Fgoogle\u002Fadk-docs\u002Fmain\u002Fdocs\u002Fagents\u002Fmodels\u002Fagent-platform.md).\n\n### Antigravity CLI\n\nGoogle Cloud users [can now access](https:\u002F\u002Fantigravity.google\u002Fpricing)\nAntigravity 2.0, including the Antigravity CLI, with Gemini Enterprise Agent\nPlatform.\n\n1.  [Install the Antigravity CLI](https:\u002F\u002Fantigravity.google\u002Fdocs\u002Fcli-install)\n    to your local environment.\n2.  Start the Antigravity CLI.\n\n    ```bash\n    agy\n    ```\n\n3.  Follow the CLI setup prompts - select **Use a Google Cloud Project**.\n\n4.  Complete the OAuth flow in the opened browser window using your\n    authenticated Google Cloud Workspace or user identity.\n\n5.  Copy the confirmation token, and paste it directly back into your terminal.\n\n6.  Follow the prompts to enter your Google Cloud Project ID.\n\n7.  Select your Google Cloud location (e.g. `global`).\n\n8.  Optionally, run the `\u002Fmodel` command to select a different Gemini model in\n    Agent Platform.\n\n### OpenClaw\n\nTo configure an OpenClaw agent to use Gemini models in Agent Platform, Follow\nthese steps.\n\n1.  [Install OpenClaw using OpenClaw's official instructions](https:\u002F\u002Fdocs.openclaw.ai\u002Finstall).\n\n⚠️ Important: OpenClaw 2026.5.28 currently has a `google-vertex` bug. Please use\n2026.5.20 for now.\n\n2.  Ensure that the runtime where OpenClaw is running (e.g. GCE VM with Service\n    Account) has the `aiplatform.user` IAM role - see Authentication and\n    Authorization section above.\n\n3.  Get the project number from the user's project ID. Outside of GCE, run:\n\n```bash\nexport PROJECT_NUMBER=$(gcloud projects describe \"$PROJECT_ID\" --format=\"value(projectNumber)\")\necho \"Project number: $PROJECT_NUMBER\"\n\n```\n\nWithin a Compute Engine VM, run:\n\n```bash\nexport PROJECT_NUMBER=$(curl \"http:\u002F\u002Fmetadata.google.internal\u002FcomputeMetadata\u002Fv1\u002Fproject\u002Fproject-id\" -H \"Metadata-Flavor: Google\")\necho \"Project number: $PROJECT_NUMBER\"\n```\n\n4.  From outside the GCE instance, generate `GOOGLE_APPLICATION_CREDENTIALS`\n    using the Google Cloud project number. Then, `scp` these credentials to the\n    GCE VM.\n\n```bash\nmkdir -p ~\u002F.config\u002Fgcloud\ngcloud iam service-accounts keys create ~\u002F.config\u002Fgcloud\u002Fapplication_default_credentials.json --iam-account=\"${PROJECT_NUMBER}-compute@developer.gserviceaccount.com\"\n```\n\n> ⚠️ **Troubleshooting Policy Constraints on New Orgs**: New Google\n> Cloud organizations (created on or after May 4th, 2024) enforce a [legacy Organization Policy, restricting Service Account Key Creation](https:\u002F\u002Fdocs.cloud.google.com\u002Forganization-policy\u002Frestrict-service-accounts.md.txt). To complete this step, this Org Policy must be temporarily disabled.\n> An Organization Policy Admin must set this policy to Inactive. \n> To the agent: Check if this policy is enforced, and if it is: pause, and \n> prompt the user to disable it at this Console link: \n> https:\u002F\u002Fconsole.cloud.google.com\u002Fiam-admin\u002Forgpolicies\n\n\n5.  Edit the configuration file that's usually located at:\n    `~\u002F.openclaw\u002Fopenclaw.json`. Ensure you prefix the Gemini model with\n    `google-vertex\u002F`.\n\n> ⚠️ Important: Do not use Gemini 3.5 models, since OpenClaw's `google-vertex`\n> provider does not support it yet. Older models work. When using the\n> [Gemini 3 Flash Preview](https:\u002F\u002Fdocs.cloud.google.com\u002Fgemini-enterprise-agent-platform\u002Fmodels\u002Fgemini\u002F3-flash)\n> model in Agent Platform, always set the location to `global`, NOT a regional\n> endpoint.\n\n```json\n{\n  \"env\": {\n    \"vars\": {\n      \"GOOGLE_CLOUD_PROJECT\": \"PROJECT_ID\",\n      \"GOOGLE_CLOUD_LOCATION\": \"global\",\n      \"GOOGLE_APPLICATION_CREDENTIALS\": \"~\u002F.config\u002Fgcloud\u002Fapplication_default_credentials.json\"\n    }\n  },\n  \"agents\": {\n    \"defaults\": {\n      \"model\": {\n        \"primary\": \"google-vertex\u002Fgemini-3-flash-preview\"\n      },\n      \"workspace\": \"~\u002F.openclaw\u002Fworkspace\",\n      \"compaction\": {\n        \"mode\": \"safeguard\"\n      },\n      \"heartbeat\": {\n        \"model\": \"google-vertex\u002Fgemini-3-flash-preview\"\n      }\n    },\n    \"list\": [\n      {\n        \"id\": \"main\",\n        \"workspace\": \"~\u002F.openclaw\u002Fworkspace\",\n        \"model\": \"google-vertex\u002Fgemini-3-flash-preview\"\n      }\n    ]\n  },\n  \"session\": {\n    \"dmScope\": \"per-channel-peer\"\n  },\n  \"tools\": {\n    \"profile\": \"coding\"\n  }\n}\n\n```\n\n6.  Restart OpenClaw.\n\n```bash\nopenclaw gateway restart\n\n```\n\n7.  Verify the OpenClaw connection to Agent Platform:\n\n```bash\nopenclaw models status\nopenclaw agent --agent main --message \"Hello world!\"\n\n```\n\n--------------------------------------------------------------------------------\n\n## Additional Resources\n\n*   [Google Cloud Free Trial Features & Limits](https:\u002F\u002Fdocs.cloud.google.com\u002Ffree\u002Fdocs\u002Ffree-cloud-features.md.txt)\n*   [Migrate from Google AI Studio to Gemini Enterprise Agent Platform](https:\u002F\u002Fdocs.cloud.google.com\u002Fgemini-enterprise-agent-platform\u002Fmodels\u002Fmigrate\u002Fmigrate-google-ai.md.txt)\n*   [Gemini Enterprise Agent Platform - Models](https:\u002F\u002Fdocs.cloud.google.com\u002Fgemini-enterprise-agent-platform\u002Fmodels\u002Fgoogle-models.md.txt)\n*   [Agent Development Kit Documentation - Connect to Models in Agent Platform](https:\u002F\u002Fadk.dev\u002Fagents\u002Fmodels\u002Fagent-platform\u002F#agent-platform-setup)\n*   [OpenClaw Documentation - Connect to Google models](https:\u002F\u002Fdocs.openclaw.ai\u002Fproviders\u002Fgoogle)\n*   [Google Cloud Budget Alerts - Setup Guide](https:\u002F\u002Fdocs.cloud.google.com\u002Fbilling\u002Fdocs\u002Fhow-to\u002Fbudgets#steps-to-create-budget.md.txt)\n","# Migrating from Gemini API in AI Studio to Agent Platform\n\nUse this skill when you need to transition an application from the\ndeveloper-centric Google AI Studio ecosystem\n(`generativelanguage.googleapis.com`) to the enterprise-grade Google Cloud Agent\nPlatform (`aiplatform.googleapis.com`).\n\n## Attribution\n\n**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you\nMUST read [Usage Attribution](references\u002Fattribution.md). For commands executed\ndirectly in the terminal (never in generated scripts, Terraform, or user code),\nprefix `gcloud` with\n`CLOUDSDK_METRICS_REQUEST_ATTRIBUTION=\"agent-skills\u002F1.0 (skill:agent-platform-migrate-from-ai-studio)\"`\nand append\n`agent-skills\u002F1.0 (skill:agent-platform-migrate-from-ai-studio)`\nto `User-Agent` headers.\n\n--------------------------------------------------------------------------------\n\n## When to Invoke This Skill\n\n*   You want to migrate an application from Google AI Studio to Agent Platform\n    (formerly Vertex AI).\n*   You have **Google Cloud credits** (e.g., the $300 Welcome Free Trial) that\n    you want to apply toward Gemini API inferencing costs.\n*   You need to unify your inferencing pipelines, IAM permissions, telemetry,\n    and billing with existing Google Cloud infrastructure (Compute Engine, Cloud\n    SQL, BigQuery).\n*   You are deploying open-source orchestration engines (like OpenClaw or ADK\n    agents) on Google Cloud VMs, and want the entire system to run under a\n    unified Google Cloud billing structure.\n\n--------------------------------------------------------------------------------\n\n## Gemini API Comparison\n\nFeature \u002F Control      | Google AI Studio (Gemini Developer API)                               | Agent Platform (Enterprise Gemini API)\n:--------------------- | :-------------------------------------------------------------------- | :-------------------------------------\n**API Endpoint**       | `generativelanguage.googleapis.com`                                   | `aiplatform.googleapis.com`\n**Target Audience**    | Developers, startups, students, researchers building production apps. | Enterprise production, MLOps engineers\n**GCP Credit Support** | No (GCP credits\u002FFree Trial **cannot** be applied)                     | Yes (Fully covered by Welcome or custom credits)\n**Data Privacy**       | Data may be reviewed to improve Google products                       | Prompts\u002Fresponses are **never** used for training\n**Security & IAM**     | API key, OAuth                                                        | Google Cloud IAM (Service Accounts, OAuth 2.0, VPC-SC)\n**Compliance & SLAs**  | None (Best-effort availability)                                       | 24\u002F7 Enterprise Support, SLAs, HIPAA, SOC2\n**Throughput Options** | Shared \u002F Rate-limited                                                 | Pay-as-you-go OR Provisioned Throughput\n**MLOps Ecosystem**    | Basic prompt management                                               | Model Registry, Model Monitoring, Pipeline Evaluation\n**Inferencing Scope**  | Global endpoints only                                                 | Both Global and strict Regional endpoints\n\nSee\n[Google Cloud Documentation](https:\u002F\u002Fdocs.cloud.google.com\u002Fgemini-enterprise-agent-platform\u002Fmodels\u002Fmigrate\u002Fmigrate-google-ai.md.txt)\nto learn more about the differences between the two offerings.\n\n--------------------------------------------------------------------------------\n\n## Migration Guide\n\n### Billing and Credits\n\nGoogle Cloud Free Trial credits\n**[do not apply to AI Studio](https:\u002F\u002Fdocs.cloud.google.com\u002Ffree\u002Fdocs\u002Ffree-cloud-features.md.txt)**.\nTo use your credits for Gemini models, you must route calls through the Agent\nPlatform.\n\n1.  Create a Google Cloud billing account. You must provide a valid payment\n    method during setup to verify identity.\n2.  If you are a new customer, ensure your $300 Welcome credit is active in the\n    Billing Console.\n3.  **Avoid Billing Surprises:** To prevent automatic fallback to your standard\n    form of payment when credits are exhausted, you should establish a budget\n    alert:\n    *   Go to **Billing** -> **Budgets & Alerts** -> **Create Budget**.\n    *   Set the threshold to map to your credit limit or maximum comfortable\n        spend.\n\n### Enable the Agent Platform API\n\nYou must explicitly enable the Agent Platform API on your target Google Cloud\nProject. Run the following command via your local shell:\n\n```bash\ngcloud services enable aiplatform.googleapis.com --project=\"{project_id}\"\n```\n\n### Authentication & Authorization (IAM)\n\n#### User Auth\n\nFor local debugging or script execution, authenticate using\n[Application Default Credentials](https:\u002F\u002Fdocs.cloud.google.com\u002Fdocs\u002Fauthentication\u002Fapplication-default-credentials.md.txt)\n(ADC).\n\n**Option 1 - Automated Script**:\n\n```bash\nbash \u003C(curl -sSL https:\u002F\u002Fstorage.googleapis.com\u002Fcloud-samples-data\u002Fadc\u002Fsetup_adc.sh)\n```\n\n**Option 2 - Manual Setup**:\n\n```bash\ngcloud auth login\ngcloud auth application-default login\n```\n\nGrant your user identity the required IAM role to perform inferencing calls:\n\n```bash\ngcloud projects add-iam-policy-binding \"{project_id}\" \\\n    --member=\"user:YOUR_EMAIL@domain.com\" \\\n    --role=\"roles\u002Faiplatform.user\"\n```\n\n#### Service Auth\n\nWhen running your application on Google Cloud infrastructure such as a Compute\nEngine VM, authenticate using the machine's attached Service Account. For\nexample, the\n[Compute Engine Default Service Account](https:\u002F\u002Fdocs.cloud.google.com\u002Fcompute\u002Fdocs\u002Faccess\u002Fservice-accounts#default_service_account.md.txt).\n\n1.  Grant the virtual machine's underlying Service Account the user role:\n\n```bash\ngcloud projects add-iam-policy-binding \"{project_id}\" \\\n    --member=\"serviceAccount:PROJECT_NUMBER-compute@developer.gserviceaccount.com\" \\\n    --role=\"roles\u002Faiplatform.user\"\n```\n\n2.  **[Compute Engine Access Scopes](https:\u002F\u002Fdocs.cloud.google.com\u002Fcompute\u002Fdocs\u002Faccess\u002Fservice-accounts.md.txt):**\n    Legacy access scopes can override IAM bindings. When provisioning or\n    modifying your Compute Engine instance, you must verify that the VM access scope is\n    configured to either **Allow full access to all Cloud APIs**\n    (`https:\u002F\u002Fwww.googleapis.com\u002Fauth\u002Fcloud-platform`) or explicitly includes\n    the standard cloud-platform scope.\n\n--------------------------------------------------------------------------------\n\n## Use the Gemini API in Agent Platform\n\n### SDKs (Client Libraries)\n\nYou can continue to use the unified\n[Google GenAI SDK](https:\u002F\u002Fdocs.cloud.google.com\u002Fgemini-enterprise-agent-platform\u002Fmodels\u002Fsdks\u002Foverview.md.txt)\n(`google-genai`). This SDK works with both AI Studio and Agent Platform. You\nonly need to switch the routing flags via your runtime environment variables to\ntarget the Agent Platform backend.\n\nSet your target environment details:\n\n```bash\nexport GOOGLE_CLOUD_PROJECT=\"{project_id}\"\nexport GOOGLE_CLOUD_LOCATION=\"global\"  # Or your chosen regional endpoint\nexport GOOGLE_GENAI_USE_ENTERPRISE=TRUE\n```\n\nNow, your standard python code shifts from using AI Studio to Agent Platform\nwithout altering the core initialization blocks:\n\n```python\nfrom google import genai\n\n# The client automatically picks up the GOOGLE_GENAI_USE_ENTERPRISE=TRUE environment flag\nclient = genai.Client()\n\nresponse = client.models.generate_content(\n    model='gemini-3-flash-preview',\n    contents='Hello world!',\n)\nprint(response.text)\n```\n\n### Agent Development Kit (ADK)\n\nTo call Gemini models in Agent Platform from an Agent Development Kit agent,\nfollow these steps.\n\n1.  Authenticate to Google Cloud.\n\nIf running an ADK agent in Google Cloud (e.g. Agent Platform Runtime), use the\nagent's assigned service account. Alternatively, if running ADK locally, run:\n\n```bash\ngcloud auth application-default login\n```\n\n1.  Set env variables. Ensure these are set no matter if your ADK agent is\n    running in Google Cloud or locally:\n\n```bash\nexport GOOGLE_CLOUD_PROJECT=\"{project_id}\"\nexport GOOGLE_CLOUD_LOCATION=\"global\"\nexport GOOGLE_GENAI_USE_ENTERPRISE=TRUE\n```\n\n2.  Initialize the ADK agent. You can use the same model string you used with AI\n    Studio (e.g. `gemini-3-flash-preview`).\n\n```python\nfrom google.adk.agents.llm_agent import Agent\n\ndef get_current_time(city: str) -> dict:\n    \"\"\"Returns the current time in a specified city.\"\"\"\n    return {\"status\": \"success\", \"city\": city, \"time\": \"10:30 AM\"}\n\nroot_agent = Agent(\n    model='gemini-3-flash-preview',\n    name='root_agent',\n    description=\"Tells the current time in a specified city.\",\n    instruction=\"You are a helpful assistant that tells the current time in cities. Use the 'get_current_time' tool for this purpose.\",\n    tools=[get_current_time],\n)\n```\n\nTo learn more about integrating ADK agents with Agent Platform,\n[see the ADK documentation](https:\u002F\u002Fraw.githubusercontent.com\u002Fgoogle\u002Fadk-docs\u002Fmain\u002Fdocs\u002Fagents\u002Fmodels\u002Fagent-platform.md).\n\n### Antigravity CLI\n\nGoogle Cloud users [can now access](https:\u002F\u002Fantigravity.google\u002Fpricing)\nAntigravity 2.0, including the Antigravity CLI, with Gemini Enterprise Agent\nPlatform.\n\n1.  [Install the Antigravity CLI](https:\u002F\u002Fantigravity.google\u002Fdocs\u002Fcli-install)\n    to your local environment.\n2.  Start the Antigravity CLI.\n\n    ```bash\n    agy\n    ```\n\n3.  Follow the CLI setup prompts - select **Use a Google Cloud Project**.\n\n4.  Complete the OAuth flow in the opened browser window using your\n    authenticated Google Cloud Workspace or user identity.\n\n5.  Copy the confirmation token, and paste it directly back into your terminal.\n\n6.  Follow the prompts to enter your Google Cloud Project ID.\n\n7.  Select your Google Cloud location (e.g. `global`).\n\n8.  Optionally, run the `\u002Fmodel` command to select a different Gemini model in\n    Agent Platform.\n\n### OpenClaw\n\nTo configure an OpenClaw agent to use Gemini models in Agent Platform, Follow\nthese steps.\n\n1.  [Install OpenClaw using OpenClaw's official instructions](https:\u002F\u002Fdocs.openclaw.ai\u002Finstall).\n\n⚠️ Important: OpenClaw 2026.5.28 currently has a `google-vertex` bug. Please use\n2026.5.20 for now.\n\n2.  Ensure that the runtime where OpenClaw is running (e.g. GCE VM with Service\n    Account) has the `aiplatform.user` IAM role - see Authentication and\n    Authorization section above.\n\n3.  Get the project number from the user's project ID. Outside of GCE, run:\n\n```bash\nexport PROJECT_NUMBER=$(gcloud projects describe \"$PROJECT_ID\" --format=\"value(projectNumber)\")\necho \"Project number: $PROJECT_NUMBER\"\n\n```\n\nWithin a Compute Engine VM, run:\n\n```bash\nexport PROJECT_NUMBER=$(curl \"http:\u002F\u002Fmetadata.google.internal\u002FcomputeMetadata\u002Fv1\u002Fproject\u002Fproject-id\" -H \"Metadata-Flavor: Google\")\necho \"Project number: $PROJECT_NUMBER\"\n```\n\n4.  From outside the GCE instance, generate `GOOGLE_APPLICATION_CREDENTIALS`\n    using the Google Cloud project number. Then, `scp` these credentials to the\n    GCE VM.\n\n```bash\nmkdir -p ~\u002F.config\u002Fgcloud\ngcloud iam service-accounts keys create ~\u002F.config\u002Fgcloud\u002Fapplication_default_credentials.json --iam-account=\"${PROJECT_NUMBER}-compute@developer.gserviceaccount.com\"\n```\n\n> ⚠️ **Troubleshooting Policy Constraints on New Orgs**: New Google\n> Cloud organizations (created on or after May 4th, 2024) enforce a [legacy Organization Policy, restricting Service Account Key Creation](https:\u002F\u002Fdocs.cloud.google.com\u002Forganization-policy\u002Frestrict-service-accounts.md.txt). To complete this step, this Org Policy must be temporarily disabled.\n> An Organization Policy Admin must set this policy to Inactive. \n> To the agent: Check if this policy is enforced, and if it is: pause, and \n> prompt the user to disable it at this Console link: \n> https:\u002F\u002Fconsole.cloud.google.com\u002Fiam-admin\u002Forgpolicies\n\n\n5.  Edit the configuration file that's usually located at:\n    `~\u002F.openclaw\u002Fopenclaw.json`. Ensure you prefix the Gemini model with\n    `google-vertex\u002F`.\n\n> ⚠️ Important: Do not use Gemini 3.5 models, since OpenClaw's `google-vertex`\n> provider does not support it yet. Older models work. When using the\n> [Gemini 3 Flash Preview](https:\u002F\u002Fdocs.cloud.google.com\u002Fgemini-enterprise-agent-platform\u002Fmodels\u002Fgemini\u002F3-flash)\n> model in Agent Platform, always set the location to `global`, NOT a regional\n> endpoint.\n\n```json\n{\n  \"env\": {\n    \"vars\": {\n      \"GOOGLE_CLOUD_PROJECT\": \"PROJECT_ID\",\n      \"GOOGLE_CLOUD_LOCATION\": \"global\",\n      \"GOOGLE_APPLICATION_CREDENTIALS\": \"~\u002F.config\u002Fgcloud\u002Fapplication_default_credentials.json\"\n    }\n  },\n  \"agents\": {\n    \"defaults\": {\n      \"model\": {\n        \"primary\": \"google-vertex\u002Fgemini-3-flash-preview\"\n      },\n      \"workspace\": \"~\u002F.openclaw\u002Fworkspace\",\n      \"compaction\": {\n        \"mode\": \"safeguard\"\n      },\n      \"heartbeat\": {\n        \"model\": \"google-vertex\u002Fgemini-3-flash-preview\"\n      }\n    },\n    \"list\": [\n      {\n        \"id\": \"main\",\n        \"workspace\": \"~\u002F.openclaw\u002Fworkspace\",\n        \"model\": \"google-vertex\u002Fgemini-3-flash-preview\"\n      }\n    ]\n  },\n  \"session\": {\n    \"dmScope\": \"per-channel-peer\"\n  },\n  \"tools\": {\n    \"profile\": \"coding\"\n  }\n}\n\n```\n\n6.  Restart OpenClaw.\n\n```bash\nopenclaw gateway restart\n\n```\n\n7.  Verify the OpenClaw connection to Agent Platform:\n\n```bash\nopenclaw models status\nopenclaw agent --agent main --message \"Hello world!\"\n\n```\n\n--------------------------------------------------------------------------------\n\n## Additional Resources\n\n*   [Google Cloud Free Trial Features & Limits](https:\u002F\u002Fdocs.cloud.google.com\u002Ffree\u002Fdocs\u002Ffree-cloud-features.md.txt)\n*   [Migrate from Google AI Studio to Gemini Enterprise Agent Platform](https:\u002F\u002Fdocs.cloud.google.com\u002Fgemini-enterprise-agent-platform\u002Fmodels\u002Fmigrate\u002Fmigrate-google-ai.md.txt)\n*   [Gemini Enterprise Agent Platform - Models](https:\u002F\u002Fdocs.cloud.google.com\u002Fgemini-enterprise-agent-platform\u002Fmodels\u002Fgoogle-models.md.txt)\n*   [Agent Development Kit Documentation - Connect to Models in Agent Platform](https:\u002F\u002Fadk.dev\u002Fagents\u002Fmodels\u002Fagent-platform\u002F#agent-platform-setup)\n*   [OpenClaw Documentation - Connect to Google models](https:\u002F\u002Fdocs.openclaw.ai\u002Fproviders\u002Fgoogle)\n*   [Google Cloud Budget Alerts - Setup Guide](https:\u002F\u002Fdocs.cloud.google.com\u002Fbilling\u002Fdocs\u002Fhow-to\u002Fbudgets#steps-to-create-budget.md.txt)\n",{"name":5,"metadata":48,"description":7},{"version":49,"category":50},"1.0.1","AiAndMachineLearning","main","bb9b3f464aae37af360d079c1d863524955b0363","skills\u002Fcloud\u002Fagent-platform-migrate-from-ai-studio",2005,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills","https:\u002F\u002Fgithub.com\u002Fgoogle","https:\u002F\u002Fopensource.google\u002F","Google ❤️ Open Source","2026-11-14 01:51:35",{"source":8,"skillName":5,"commands":61,"prompt":71,"zipAvailable":72},[62,65,68],{"tool":63,"command":64},"npx","npx skills add google\u002Fskills --skill agent-platform-migrate-from-ai-studio",{"tool":66,"command":67},"bunx","bunx skills add google\u002Fskills --skill agent-platform-migrate-from-ai-studio",{"tool":69,"command":70},"pnpm","pnpm dlx skills add google\u002Fskills --skill agent-platform-migrate-from-ai-studio","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fagent-platform-migrate-from-ai-studio\u002FSKILL.md",true,[74],{"path":75,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":78,"sourceHtmlUrl":79},"references\u002Fattribution.md","REFERENCE","参考文档",1959,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fagent-platform-migrate-from-ai-studio\u002Freferences\u002Fattribution.md",[81,115,143,171,197,222],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":93,"publishedAt":43},"01M6998S2EZKD3GEJ7F943RZTE","sign-in-with-google-web","Implement, configure, and secure Sign In With Google (SiwG) using Google Identity Services (GIS \u002F `https:\u002F\u002Faccounts.google.com\u002Fgsi\u002Fclient`) across web architectures. Use when creating Google sign-in buttons, implementing Google One Tap with FedCM, integrating GIS in React\u002FNext.js\u002FAngular\u002FHTML, verifying ID tokens on backend runtimes (Python\u002FNode.js\u002FGo\u002FJava), enforcing Google Workspace domain restrictions (`hd`), securing client-side ID tokens via WebCrypto nonces or encrypted IndexedDB, embedding in cross-origin iframes via the Intermediate Iframe API (`https:\u002F\u002Faccounts.google.com\u002Fgsi\u002Fintermediate`), configuring Content Security Policy (CSP), COOP, and Permissions Policy (`identity-credentials-get`) headers, or handling sign-out and revocation. Don't use for legacy Google Sign-In (`gapi.auth2`), Google Cloud IAM service accounts, or Android\u002FiOS native Credential Manager.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fidentity\u002Fsign-in-with-google-web\u002FSKILL.md",[87,90],{"categoryNo":88,"categoryName":89,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000009","前端开发",{"categoryNo":91,"categoryName":92,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口",[9,94,95,96,97,98,99,100,101,30,102,103,104,105,106,32,107,108,109,110,111,112,113,114],"sign in with google web","sign","with","web","android","go","security","google workspace","implement","policy","python","implementing","react","permissions","buttons","secure","manager","identity","architectures","domain","runtimes",{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":128,"publishedAt":43},"01M6998PHPDCAD684VW5WRG83D","dpop-adoption","Implement and debug OAuth 2.0 DPoP (RFC 9449) refresh token sender-constraining for WebCrypto, Node.js ES6, and browser runtimes integrating with Google's OAuth platform. Use when configuring non-extractable asymmetric key pairs (P-256), generating DPoP Proof JWTs for authorization code exchange and token refresh, or handling 400 use_dpop_nonce challenge retry loops at oauth2.googleapis.com\u002Ftoken. Don't use for unconstrained OAuth 2.0 flows (where refresh tokens are not bound to a client key pair), or for Google Cloud IAM \u002F service account authentication.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fidentity\u002Fdpop-adoption\u002FSKILL.md",[121,122,123],{"categoryNo":91,"categoryName":92,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":124,"categoryName":125,"taxonomyType":126,"taxonomyTypeDesc":127},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[129,130,9,30,131,132,133,134,135,136,32,137,138,139,140,141,142,111,114,27,41],"dpop adoption","adoption","es6","retry","authentication","flows","challenge","code","browser","loops","at","node","token","pair",{"skillNo":144,"name":145,"nameZh":6,"description":146,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":147,"categories":148,"keywords":155,"publishedAt":43},"01M6998M72TC73EEAQH4XC7EXW","retrieving-developer-knowledge","Searches, retrieves, and synthesizes official Google developer documentation across Google Cloud, AI\u002FGemini, Android, Chrome, Web, Flutter, Go, Firebase, and other Google developer platforms. Integrates with the Developer Knowledge MCP server (search_documents, get_documents, answer_query) or the Developer Knowledge REST API fallback. Use when searching for gcloud CLI commands, API syntax, IAM permissions, official documentation, architectural comparisons, or product choice overviews. Don't use for local filesystem lookups or non-Google documentation.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdevelopers\u002Fretrieving-developer-knowledge\u002FSKILL.md",[149,150,153,154],{"categoryNo":91,"categoryName":92,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":151,"categoryName":152,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000021","资料检索与研究",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":124,"categoryName":125,"taxonomyType":126,"taxonomyTypeDesc":127},[156,157,158,159,30,160,161,162,163,164,165,166,167,41,168,34,169,32,170,107],"retrieving developer knowledge","knowledge","developer","MCP","mcp server","official","developer documentation","get","search","local","choice","documents","query","across","documentation",{"skillNo":172,"name":173,"nameZh":6,"description":174,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":175,"categories":176,"keywords":177,"publishedAt":43},"01M6998J2CZEXS9BES9S3WWFKC","migrate-to-rust","Clones, analyzes, plans, and migrates legacy codebases (C++, Fortran, Java, Python, C, Shell) from a GitHub URL or local directory to a modern, high-performance, deterministic, 100% Safe Rust architecture, tracking live telemetry across every task bucket, test failure\u002Ffix cycle, and Profile-Guided Optimization (PGO) stage, and producing a first-person AI storytelling report and interactive HTML infographic. Use when migrating a GitHub repository or local codebase to Rust, porting legacy C++, Fortran, Python, or Java workloads to memory-safe Rust, designing Struct-of-Arrays (SoA) or SIMD Rust architectures, or optimizing Rust ports with LLVM PGO. Don't use for unrelated non-Rust refactoring or single-line syntax questions.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdevelopers\u002Fmigrate-to-rust\u002FSKILL.md",[],[178,179,24,180,181,182,183,184,104,185,186,187,188,189,190,165,191,192,193,41,194,195,169,196],"migrate to rust","rust","github","memory","performance","directory","safe","ports","llvm","soa","cycle","porting","fix","arrays","infographic","high-performance","URL","architecture","unrelated",{"skillNo":198,"name":199,"nameZh":6,"description":200,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":201,"categories":202,"keywords":206,"publishedAt":43},"01M6998GCC3K29WZ82KXMB9E02","finding-google-skills","Google platform decision and setup guidance, loaded on demand from Google's skill catalog. Use when a developer is choosing or setting up part of their stack, such as where to run a service, a database, storage, messaging, authentication, analytics, ads, or AI model serving, and a Google product is a reasonable candidate - whether or not a vendor is named - or when a request names a Google product or API. Brings in the matching Google skill so the answer can weigh Google options, their trade-offs, and when they are not the right fit. Skip when the stack is already settled on another provider and no Google product is named, or the task involves no platform choice.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdevelopers\u002Ffinding-google-skills\u002FSKILL.md",[203,204,205],{"categoryNo":91,"categoryName":92,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":124,"categoryName":125,"taxonomyType":126,"taxonomyTypeDesc":127},[9,207,208,209,210,27,211,212,213,214,215,133,216,217,218,166,219,220,41,221,34],"finding google skills","storage","as","messaging","model","trade-offs","provider","answer","fit","catalog","up","decision","use","database","candidate",{"skillNo":223,"name":224,"nameZh":6,"description":225,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":226,"categories":227,"keywords":230,"publishedAt":43},"01M6998DWNHTH0BS6W1CY8ZXMP","workload-manager-basics","Use this skill to manage Google Cloud Workload Manager evaluations, rules, scanned resources, and validation results by using public client libraries and the REST API. Use when you need to inspect workload best-practice rules, create and run evaluations for Google Cloud general best practices, SAP, SQL Server, or custom organizational rules, review violations, export results to BigQuery, or automate Workload Manager through client libraries because no service-specific public CLI or MCP server is available. Don't use for general Google Compute Engine instance management, VPC configuration, or standard IAM auditing.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fworkload-manager-basics\u002FSKILL.md",[228,229],{"categoryNo":91,"categoryName":92,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[231,232,110,233,9,159,234,30,160,235,236,237,238,41,239,34,32,240,241,242,243],"workload manager basics","workload","basics","cli","review","vpc","resources","inspect","you","create","libraries","server","run"]