Skip to content

Google Vertex AI API: Generate Content

ZenMux supports the Google Vertex AI API using the Generative AI SDK. For detailed request parameters and response structures, see the Google Vertex AI official documentation.

SDK

bash
pip install google-genai
bash
npm install @google/genai

Examples

Python
from google import genai  
from google.genai import types  
  
client = genai.Client(  
    api_key="$ZenMux_API_KEY",  
    vertexai=True,  
    http_options=types.HttpOptions(
        api_version='v1', 
        base_url='https://zenmux.ai/api'
    ),  
)  
  
response = client.models.generate_content(  
    model="google/gemini-2.5-pro",  
    contents="How does AI work?"  
)  
print(response.text)
ts
const genai = require("@google/genai");

const client = new genai.GoogleGenAI({
  apiKey: "$ZenMux_API_KEY",
  vertexai: true,
  httpOptions: {
    baseUrl: "https://zenmux.ai/api",
    apiVersion: "v1"
  }
});

const response = await client.models.generateContent({
  model: "google/gemini-2.5-pro",
  contents: "How does AI work?",
});
console.log(response);

Supported Models

Supported Models for the Google Vertex AI Protocol

Models compatible with the Google Vertex AI protocol are being onboarded in batches. You can view currently supported models by filtering for Vertex AI API Compatible in the official model list: VertexAI-support You can also check via the model detail page: VertexAI-support