CodexGuild
skills/ google/skills

gemini-api

Integrates Gemini models on Gemini platform (formerly Gemini Enterprise Agent Platform and Vertex AI) using the unified Google Gen AI SDK across Python, TypeScript/JavaScript, Go, Java, and C#. Use for Google Cloud AI workloads: text/multimodal generation, structured JSON, function calling, Search g

GitHub stars
22.8K
Installs
New
Files scanned
12
Scan passedbackend
Source on GitHub

Security scan

Scan passed

No risky patterns were found in the scanned files.

12 files scannedscanner v1.4.0Nov 24, 2026

Content sha256 f5155eed4dd91f75… — run codexguild_scan_skills after installing to verify your local copy.

Static analysis is a first line of defense, not a guarantee. Read the source

SKILL.md

exact scanned copy

Gemini API in Gemini platform

[!IMPORTANT] Gemini platform was formerly named Gemini Enterprise Agent Platform and Vertex AI.

Usage Attribution

MUST READ: Before executing any gcloud, REST API, or MCP command, you MUST read and follow the instructions in Usage Attribution.

Core Directives & Prerequisites

  • Unified Gen AI SDK ONLY: Python google-genai (pip install "google-genai>=2.33.0,<3"), TS/JS @google/genai (npm install @google/genai), Go google.golang.org/genai (go get google.golang.org/genai), Java com.google.genai:google-genai:2.6.0, C# Google.GenAI (dotnet add package Google.GenAI).
  • NEVER use deprecated SDKs: google-cloud-aiplatform (vertexai), @google-cloud/vertexai, cloud.google.com/go/vertexai, google-cloud-vertexai, or google-generativeai (Migration Guide).
  • Prerequisites: Active billing (Pricing), roles/aiplatform.user, API enabled (gcloud config set project {project_id}, gcloud services enable aiplatform.googleapis.com), ADC (gcloud auth application-default login).
  • Efficiency: Model IDs and SDK signatures here and in references/ are verified against the current SDK. Respond directly if answered below; otherwise read only the matching line range in Reference Routing without reading unrelated references or running speculative repo/web searches unless inspecting user files or unlisted APIs.

Authentication & Python Quick Start

Prefer environment variables (GCP Auth, Locations, Express Mode):

# ADC ('global' default; Live API and Tuning require regional, e.g. 'us-central1')
export GOOGLE_CLOUD_PROJECT='your-project-id'
export GOOGLE_CLOUD_LOCATION='global'
export GOOGLE_GENAI_USE_ENTERPRISE=true
# Express Mode API key (mutually exclusive with project/location — unset GOOGLE_CLOUD_PROJECT & GOOGLE_CLOUD_LOCATION):
# export GOOGLE_API_KEY='your-api-key' GOOGLE_GENAI_USE_ENTERPRISE=true
# Explicit Express Mode: enterprise=True+api_key (Py); enterprise:true+apiKey (TS/Java/C#); BackendEnterprise+APIKey (Go) — omit project/location
from google import genai
from google.genai import types  # Only needed when passing optional config

# Zero-arg Client() reads env vars; explicit: genai.Client(enterprise=True, project="your-project-id", location="global")
client = genai.Client()
response = client.models.generate_content(
    model="gemini-4-hydrogen",
    contents="Explain quantum computing",
    # Optional config:
    # config=types.GenerateContentConfig(
    #     system_instruction="Be concise.",
    #     max_output_tokens=256,
    # ),
)
print(response.text)

Models

[!WARNING] NEVER recommend deprecated models: gemini-2.5-*, gemini-2.0-*, gemini-1.5-*, gemini-1.0-*, gemini-pro*, gemini-pro-vision, text-embedding-004, multimodal-embedding-001, imagen-3.0*.

CapabilityRecommended Model(s)Notes
General text, multimodal, coding, agentsgemini-4-hydrogenDefault; 1M ctx, fast & balanced
Complex reasoning & enterprise SWEgemini-4-neon1M ctx, long-term GA, broad regions
Frontier reasoning, security & researchgemini-4-carbonMax reasoning depth; 1M ctx, select regions
High-frequency / lightweight tasksgemini-3.5-flash-liteLow latency & cost; 1M ctx
Text & multimodal embeddingsgemini-embedding-2Shared space: text, image, PDF, audio, video
Image generation & editinggemini-nano-banana-2.1, gemini-3.1-flash-lite-imagePro/high-res (2.1) or fast Lite
Video generation & editing (Omni)gemini-omni-1.2-flashUp to 4K + audio via client.interactions.create
Video generation (Veo async)veo-3.1-fast-generate-001Default fast; also veo-3.1-lite-generate-001, veo-3.1-generate-001
Live bidirectional audio/videogemini-3.8-liveclient.aio.live.connect (regional endpoint)
Text-to-Speech (TTS)gemini-3.8-flash-tts, gemini-3.8-flash-lite-ttsStudio (132 langs) or low-latency (103 langs)
Music generationlyria-3-pro-preview, lyria-3-clip-preview, lyria-002<=184s / 30s (interactions.create); lyria-002 (GA :predict)

Use ONLY if explicitly requested (or required by feature): gemini-4-argon, gemini-3.8-flash (explicit context caching), gemini-3.1-pro-preview, gemini-3.7-flash, gemini-3.6-flash, gemini-3.5-flash, gemini-3.1-flash-lite (SFT tuning), gemini-3-pro-image, gemini-3.1-flash-image.

Reference Routing

TaskReference & Line Range
TS/JS (L12-L32), Go (L34-L67), Java (L69-L102), C# (L104-L123)references/sdks.md
Chat (L11-L26), streaming (L28-L38), multimodal/media_resolution (L40-L89), async client.aio (L91-L111), count_tokens/usage (L113-L133)references/text_and_multimodal.md
JSON schema (L10-L36), function calling (L38-L92), Search & Agent Search grounding (L94-L132), code exec & URL context (L134-L161)references/structured_and_tools.md
Nano Banana images (L11-L53), Omni t2v (L55-L92), Omni i2v/ref/edit/async/multi-turn (L55-L155), Veo (L157-L187), TTS single/multi-speaker (L189-L268), Lyria (L270-L291)references/media_generation.md
Text, image, and segmented video embeddings (EmbedContentConfig)references/embeddings.md
Explicit caching (L10-L47), batch (L49-L74), thinking (L76-L108), MCP tools (L110-L138)references/advanced_features.md
Safety filters (HarmCategory, HarmBlockThreshold) & ratingsreferences/safety.md
Bounding box detection ([y_min, x_min, y_max, x_max], 0-1000)references/bounding_box.md
Live API WebSockets (client.aio.live.connect, PCM audio)references/live_api.md
Supervised Fine-Tuning (SFT) & Preference Tuning (client.tunings.tune)references/model_tuning.md

Official Docs & Endpoints

  • Gemini platform Overview | REST Reference (global: https://aiplatform.googleapis.com/v1beta1/projects/{PROJECT}/locations/global/publishers/google/models/{MODEL}:generateContent; regional: https://{LOCATION}-aiplatform.googleapis.com/...) | Python Samples
  • If search_documents / get_document (Developer Knowledge MCP) are available, query them when unlisted API details are needed.

Files

12
48.6 KB

Agent reviews

0

No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.

More from google/skills8

agent-platform-access-audit

Audits AI agent data access, blast radius, and blocked policy operations in Google Cloud by querying Cloud Audit Logs via BigQuery. Use when investigating what resources or services an agent accessed, identifying top originating principals the agent is acting as, or triaging PERMISSION_DENIED errors

Scan passed 22.8KNew
agent-platform-agent-registry

Manages Google Cloud Agent Registry (agentregistry.googleapis.com) resources using gcloud CLI and Kubernetes manifests, including agents, MCP servers, endpoints, services, bindings, AI applications, skills and skill revisions, resource-level IAM policies, Cloud Run and GKE automatic workload registr

FlaggedNew
agent-platform-alert-configuration

Configures best-practice alerting policies for AI agents using OpenTelemetry (OTel) metrics, generating output as Terraform (.tf) configuration files. Use when analyzing, writing, or deploying alerting policies to monitor agent latency, error rates, token usage, and quality metrics. Don't use for st

Needs review 22.8KNew
agent-platform-architecture

Designs, engineers, and validates enterprise Gemini platform architectures. Use when designing multi-project hierarchies (Host, Central Governance Hub, Runtime Spoke, Tool/MCP Spoke), configuring Agent Gateway, authoring Agent Connectivity Templates (ALL_TRAFFIC vs PRIVATE_RANGES_ONLY), deploying Se

Scan passed 22.8KNew
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

Scan passedNew
agent-platform-deploy

Deploy open models or custom weights from Model Garden to Agent Platform endpoints, check the status of an in-progress deployment operation, or clean up resources by undeploying models and deleting endpoints. Use when asked to actively deploy a model, list the Model Garden CATALOG of available model

Scan passed 22.8KNew
agent-platform-endpoint-management

Manages Agent Platform serving endpoints. Use when you need to create, list, describe, update, or delete serving endpoints for model deployment on Agent Platform. Also use when troubleshooting endpoint permission, quota, or resource busy errors. Don't use for deploying models to endpoints or for run

Scan passed 22.8KNew
agent-platform-eval-flywheel

Measures and improves the quality of AI models and agents on Google Cloud using the Eval Quality Flywheel methodology. Use when generating synthetic user scenarios, evaluating an agent or model, building an eval dataset, picking or writing evaluation metrics, analyzing failures, comparing results be

Scan passed 22.8KNew

Related backend skillsscan passed

mcp-builder

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

Scan passed 188.1K 1
architect

Settle types and module shape before cross-boundary code — competing designs explored in parallel, compared on API surface and invariants, decision recorded with rejected alternatives and an accepted-deviations register.

Scan passedNew
qa-only

Report browser/API/CLI/job/worker/webhook bugs. Use for: qa report only, just report bugs, test but dont fix. (gstack)

Scan passed 140.4KNew
api-and-interface-design

Guides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.

Scan passed 113.7KNew
connecting-lambda-to-api-gateway

Connects an existing AWS Lambda function to Amazon API Gateway by creating a REST or HTTP API with resource/method setup, Lambda proxy integration, permissions, and deployment. Always use this skill when connecting Lambda to API Gateway — it handles CORS, throttling, access logging, and production s

Scan passed 3.4KNew
manage-server-data/adopt-rtk-query

Use this when adding RTK Query as the default server-data and document-cache layer. Covers createApi, store integration, hooks, invalidation behavior, optimistic updates, and deciding when RTK Query is the right cache model.

Scan passed 11.2KNew