[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M698YDAZ24VB915XJZHV6JAE":3,"skill-same:01M698YDAZ24VB915XJZHV6JAE":87},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":50,"linkOnly":51,"markdownContent":52,"markdownBody":53,"frontMatter":54,"refName":58,"commitSha":59,"skillDirectory":60,"forksCount":61,"repositoryHtmlUrl":62,"repositoryHomepageUrl":17,"ownerHtmlUrl":63,"ownerBlogUrl":64,"ownerDescription":65,"updatedAt":66,"install":67,"resources":80},"01M698YDAZ24VB915XJZHV6JAE","agent-platform-migrate-from-ai-studio","Gemini API 迁移至智能体平台","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 AI Studio 中的 Gemini API 迁移到 Gemini Enterprise Agent Platform（原 Vertex AI）。当需要把应用迁移到 Google Cloud、利用 Cloud 额度（credits），或与其他 Cloud 基础设施（IAM、计费、遥测）统一推理能力时，使用此技能。","google\u002Fskills","google","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1342004?v=4","01M698VYEFDM0VJBZDYYJ2T83S","Google","01M698WR0H76ENHE587T9EJT89",24235,"Apache-2.0",null,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fagent-platform-migrate-from-ai-studio\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQNXPY1AV6BSR5VKHDMWRH","部署与发布管理","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,10,42,43,44,45,46,47,48,49],"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":55,"description":7},{"version":56,"category":57},"1.0.1","AiAndMachineLearning","main","bb9b3f464aae37af360d079c1d863524955b0363","skills\u002Fcloud\u002Fagent-platform-migrate-from-ai-studio",2014,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills","https:\u002F\u002Fgithub.com\u002Fgoogle","https:\u002F\u002Fopensource.google\u002F","Google ❤️ Open Source","2026-11-14 23:31:00",{"source":9,"skillName":5,"commands":68,"prompt":78,"zipAvailable":79},[69,72,75],{"tool":70,"command":71},"npx","npx skills add google\u002Fskills --skill agent-platform-migrate-from-ai-studio",{"tool":73,"command":74},"bunx","bunx skills add google\u002Fskills --skill agent-platform-migrate-from-ai-studio",{"tool":76,"command":77},"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,[81],{"path":82,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Fattribution.md","REFERENCE","参考文档",1959,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fagent-platform-migrate-from-ai-studio\u002Freferences\u002Fattribution.md",[88,96,103,110,117,124],{"skillNo":89,"name":90,"nameZh":17,"description":91,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":95},"01M7DQ9K7JF4T7NJZ2K1MQZ44Q","cloud-operator-share-context","Shares Google Cloud operating context the user or their team already have — environments, projects, services and regions, product preferences, best practices, architecture guidance, runbooks — found in agent instruction files, local memory, skills and workflows, and the repository's GCP docs, with the operator agent's memory after the user reviews the list. Use when the user runs this skill, accepts the cloud-operator or cloud-operator-setup skill's offer to share their existing Google Cloud context, or asks to share, import or save that context or a GCP fact for the operator agent. Don't use for ordinary GCP requests, which go to the cloud-operator skill.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fcloud-operator-share-context\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":97,"name":98,"nameZh":17,"description":99,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":95},"01M7DQ9ERFGGQCFAWQW0KRKYBY","cloud-operator-setup","Sets up the operator agent in a Google Cloud project via the autocloud MCP server: picks the operator project, creates or checks the user's operator agent, saves the project, and offers to share the user's existing Google Cloud operating context with the operator agent's memory. Use when the user runs this skill, asks to set up the operator or create their operator agent, or chooses setup when the cloud-operator skill asks. Don't use for ordinary GCP requests or installing gcloud.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fcloud-operator-setup\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":17,"description":106,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":95},"01M7B4RHQCM0DK2XQ7S7ZXVN8D","developer-device-platform-device-run","Runs automated, non-interactive jobs on remote Android devices with Developer Device Platform (DDP) Device Run using `gcloud beta device-run sessions`: native Android executables or shell scripts (for example CLI tools, custom runners, test harnesses or benchmarks) and Android instrumentation tests, on one or many devices, then waits for completion and collects per-device outputs and logs. Use when running a binary or test suite on remote devices without an interactive connection. Don't use it for interactive device reservations, adb tunnels or screen streaming (use developer-device-platform-basics), or for local devices.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloper-device-platform-device-run\u002FSKILL.md",[],[],{"skillNo":111,"name":112,"nameZh":17,"description":113,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":95},"01M7B4R9YXMRW7RZP9Q9FMZJ2P","compute-vm-creation","Guides the planning, configuration, and provisioning of standalone Google Compute Engine virtual machines (VMs) and bare metal (-metal) instances using gcloud CLI commands or direct MCP tool execution. Use ONLY when the user wants to create, configure, or provision a new standalone Compute Engine VM or bare metal instance from conversational intents (hardware sizing, region selection, OS image, networking, security defaults). DO NOT read or use for Google Kubernetes Engine (GKE) Autopilot or Standard clusters, Kubernetes node pools or Pods, container orchestration, managing existing VMs, Managed Instance Groups (MIGs), or Instance Templates.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fcompute-vm-creation\u002FSKILL.md",[],[],{"skillNo":118,"name":119,"nameZh":17,"description":120,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":95},"01M7B4QD02N0YBVT0838Z5K5VC","agent-platform-autorater-customization","Customizes an autorater (evaluation metric) for an AI agent so its grades match the user's own judgment, starting from the agent's real trajectories. Use when a user wants a metric tailored to their agent, wants to turn failing trajectories into rubrics, says an existing autorater grades their agent wrong, or wants an autorater to agree with human labels (autorater hillclimbing, judge calibration). Don't use for quick evals with built-in metrics or for improving the agent itself (use agent-platform-eval-flywheel).","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fagent-platform-autorater-customization\u002FSKILL.md",[],[],{"skillNo":125,"name":126,"nameZh":17,"description":127,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":128,"categories":129,"keywords":130,"publishedAt":95},"01M78JP22K73KK96JH0JNDT5C4","iap-agent-platform-troubleshooting","Diagnoses Identity-Aware Proxy (IAP) denials of outbound requests from Gemini Enterprise Agent Platform agents that run on Agent Runtime and send traffic through Agent Gateway. Use when an agent request fails with \"Egress request is not authorized\", when Cloud Audit Logs show an IAP egressViaIAP decision with granted false, when IAP audit entries are missing while debugging agent egress, or when Access policies, IAP allow policies, policy bindings, or Agent Registry entries might block agent egress. Don't use for Gemini model IAM permission errors (such as aiplatform.endpoints.predict), Agent Platform API errors, or Agent Runtime deployment or 500 errors (use agent-platform-troubleshooting instead). Don't use for setting up, creating, or connecting an Agent Gateway, or for IAP web apps, IAP TCP forwarding, or SSH.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fiap-agent-platform-troubleshooting\u002FSKILL.md",[],[]]