Vertex ai api dev

From LowyShin/giip-dev-agent · View interactive version

Vertex ai api dev is an AI agent skill from the GitHub repository LowyShin/giip-dev-agent. Guides the usage of Gemini API on Google Cloud Vertex AI with the Gen AI SDK. Use when the user asks about using Gemini in an enterprise environment or explicitly mentions Vertex AI. Covers SDK usage (Python, JS/TS, Go, Java, C#), capabilities like Live API, tools, multimedia generation, caching, an

How to use this skill

Skill file

Gemini API in Vertex AI

Access Google's most advanced AI models built for enterprise use cases using the Gemini API in Vertex AI.

Provide these key capabilities:

Core Directives

SDKs

```gradle

implementation("com.google.genai:google-genai:${LAST_VERSION}")

```

```xml

<dependency>

<groupId>com.google.genai</groupId>

<artifactId>google-genai</artifactId>

<version>${LAST_VERSION}</version>

</dependency>

```

[!WARNING]

Legacy SDKs like google-cloud-aiplatform, @google-cloud/vertexai, and google-generativeai are deprecated. Migrate to the new SDKs above urgently by following the Migration Guide.

Authentication & Configuration

Prefer environment variables over hard-coding parameters when creating the client. Initialize the client without parameters to automatically pick up these values.

Application Default Credentials (ADC)

Set these variables for standard Google Cloud authentication:

export GOOGLE_CLOUD_PROJECT='your-project-id'
export GOOGLE_CLOUD_LOCATION='global'
export GOOGLE_GENAI_USE_VERTEXAI=true

Vertex AI in Express Mode

Set these variables when using Express Mode with an API key:

export GOOGLE_API_KEY='your-api-key'
export GOOGLE_GENAI_USE_VERTEXAI=true

Initialization

Initialize the client without arguments to pick up environment variables:

from google import genai
client = genai.Client()

Alternatively, you can hard-code in parameters when creating the client.

from google import genai
client = genai.Client(vertexai=True, project="your-project-id", location="global")

Models

Use the following models if explicitly requested:

[!IMPORTANT]

Models like gemini-2.0-*, gemini-1.5-*, gemini-1.0-*, gemini-pro are legacy and deprecated. Use the new models above. Your knowledge is outdated.

For production environments, consult the Vertex AI documentation for stable model versions (e.g. gemini-3-flash).

Quick Start (Python)

from google import genai
client = genai.Client()
response = client.models.generate_content(
    model="gemini-3-flash-preview",
    contents="Explain quantum computing"
)
print(response.text)

API spec & Documentation (source of truth)

When implementing or debugging API integration for Vertex AI, refer to the official Google Cloud Vertex AI documentation:

The Gen AI SDK on Vertex AI uses the v1beta1 or v1 REST API endpoints (e.g., https://{LOCATION}-aiplatform.googleapis.com/v1beta1/projects/{PROJECT}/locations/{LOCATION}/publishers/google/models/{MODEL}:generateContent).

[!TIP]

Use the Developer Knowledge MCP Server: If the search_documents or get_document tools are available, use them to find and retrieve official documentation for Google Cloud and Vertex AI directly within the context. This is the preferred method for getting up-to-date API details and code snippets.

Workflows and Code Samples

Reference the Python Docs Samples repository for additional code samples and specific usage scenarios.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.