$npx -y skills add jmxt3/gitscape.ai --skill gemini-apiGuides the usage of the Gemini API on Agent Platform with the Google Gen AI SDK. Use when the user asks about using Gemini in an enterprise environment or explicitly mentions Vertex AI, Google Cloud, or Agent Platform. Covers SDK usage (Python, JS/TS, Go, Java, C#), capabilities
| 1 | IMPORTANT: Agent Platform (full name Gemini Enterprise Agent Platform) was previously named "Vertex AI" and many web resources use the legacy branding. |
| 2 | |
| 3 | # Gemini API in Agent Platform |
| 4 | |
| 5 | Access Google's most advanced AI models built for enterprise use cases using the Gemini API in Agent Platform. |
| 6 | |
| 7 | Provide these key capabilities: |
| 8 | |
| 9 | - **Text generation** - Chat, completion, summarization |
| 10 | - **Multimodal understanding** - Process images, audio, video, and documents |
| 11 | - **Function calling** - Let the model invoke your functions |
| 12 | - **Structured output** - Generate valid JSON matching your schema |
| 13 | - **Context caching** - Cache large contexts for efficiency |
| 14 | - **Embeddings** - Generate text embeddings for semantic search |
| 15 | - **Live Realtime API** - Bidirectional streaming for low latency Voice and Video interactions |
| 16 | - **Batch Prediction** - Handle massive async dataset prediction workloads |
| 17 | |
| 18 | ## Core Directives |
| 19 | |
| 20 | - **Unified SDK**: ALWAYS use the Gen AI SDK (`google-genai` for Python, `@google/genai` for JS/TS, `google.golang.org/genai` for Go, `com.google.genai:google-genai` for Java, `Google.GenAI` for C#). |
| 21 | - **Legacy SDKs**: DO NOT use `google-cloud-aiplatform`, `@google-cloud/vertexai`, or `google-generativeai`. |
| 22 | |
| 23 | ## SDKs |
| 24 | |
| 25 | - **Python**: Install `google-genai` with `pip install google-genai` |
| 26 | - **JavaScript/TypeScript**: Install `@google/genai` with `npm install @google/genai` |
| 27 | - **Go**: Install `google.golang.org/genai` with `go get google.golang.org/genai` |
| 28 | - **C#/.NET**: Install `Google.GenAI` with `dotnet add package Google.GenAI` |
| 29 | - **Java**: |
| 30 | - groupId: `com.google.genai`, artifactId: `google-genai` |
| 31 | - Latest version can be found here: https://central.sonatype.com/artifact/com.google.genai/google-genai/versions (let's call it `LAST_VERSION`) |
| 32 | - Install in `build.gradle`: |
| 33 | |
| 34 | ``` |
| 35 | implementation("com.google.genai:google-genai:${LAST_VERSION}") |
| 36 | ``` |
| 37 | |
| 38 | - Install Maven dependency in `pom.xml`: |
| 39 | |
| 40 | ```xml |
| 41 | <dependency> |
| 42 | <groupId>com.google.genai</groupId> |
| 43 | <artifactId>google-genai</artifactId> |
| 44 | <version>${LAST_VERSION}</version> |
| 45 | </dependency> |
| 46 | ``` |
| 47 | |
| 48 | > [!WARNING] |
| 49 | > 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. |
| 50 | |
| 51 | ## Authentication & Configuration |
| 52 | |
| 53 | Prefer environment variables over hard-coding parameters when creating the client. Initialize the client without parameters to automatically pick up these values. |
| 54 | |
| 55 | ### Application Default Credentials (ADC) |
| 56 | Set these variables for standard [Google Cloud authentication](https://docs.cloud.google.com/vertex-ai/generative-ai/docs/start/gcp-auth): |
| 57 | ```bash |
| 58 | export GOOGLE_CLOUD_PROJECT='your-project-id' |
| 59 | export GOOGLE_CLOUD_LOCATION='global' |
| 60 | export GOOGLE_GENAI_USE_VERTEXAI=true |
| 61 | ``` |
| 62 | - By default, use `location="global"` to access the global endpoint, which provides automatic routing to regions with available capacity. |
| 63 | - If a user explicitly asks to use a specific region (e.g., `us-central1`, `europe-west4`), specify that region in the `GOOGLE_CLOUD_LOCATION` parameter instead. Reference the [supported regions documentation](https://docs.cloud.google.com/vertex-ai/generative-ai/docs/learn/locations) if needed. |
| 64 | |
| 65 | ### Agent Platform in Express Mode |
| 66 | Set these variables when using [Express Mode](https://docs.cloud.google.com/vertex-ai/generative-ai/docs/start/api-keys?usertype=expressmode) with an API key: |
| 67 | ```bash |
| 68 | export GOOGLE_API_KEY='your-api-key' |
| 69 | export GOOGLE_GENAI_USE_VERTEXAI=true |
| 70 | ``` |
| 71 | |
| 72 | ### Initialization |
| 73 | Initialize the client without arguments to pick up environment variables: |
| 74 | ```python |
| 75 | from google import genai |
| 76 | client = genai.Client() |
| 77 | ``` |
| 78 | |
| 79 | Alternatively, you can hard-code in parameters when creating the client. |
| 80 | |
| 81 | ```python |
| 82 | from google import genai |
| 83 | client = genai.Client(vertexai=True, project="your-project-id", location="global") |
| 84 | ``` |
| 85 | |
| 86 | ## Models |
| 87 | |
| 88 | - Use `gemini-3.1-pro-preview` for complex reasoning, coding, research (1M tokens) |
| 89 | - IMPORTANT: Do not use `gemini-3-pro-preview` |
| 90 | - Use `gemini-3-flash-preview` for fast, balanced performance, multimodal (1M tokens) |
| 91 | - Use `gemini-3.1-flash-lite-preview` for high-frequency, lightweight tasks (1M tokens) |
| 92 | - Use `gemini-3-pro-image-preview` for Nano Banana Pro image generation and editing |
| 93 | - Use `gemini-3.1-flash-image-preview` for Nano Banana 2 image generation and editing |
| 94 | - Use `gemini-live-2.5-flash-native-audio` for Live Realtime API including native audio |
| 95 | |
| 96 | Use the following models only if explicitly requested: |
| 97 | |
| 98 | - `g |