Providers
Google Cloud
Setup and configuration for Google Cloud Vertex AI
Google Cloud
Google Cloud Vertex AI provides access to Google's state-of-the-art AI models including Gemini image generation and VEO video generation.
Setup
1. Create a Google Cloud Project
- Go to Google Cloud Console
- Create a new project or select an existing one
- Note your Project ID (you'll need this later)
2. Enable Required APIs
Enable the Vertex AI API:
gcloud services enable aiplatform.googleapis.comOr enable it via the Cloud Console API Library.
3. Create a Service Account
- Go to IAM & Admin > Service Accounts
- Click Create Service Account
- Name it (e.g.,
synthome-vertex-ai) - Grant the Vertex AI User role
- Click Done
4. Generate Service Account Key
- Click on your new service account
- Go to Keys tab
- Click Add Key > Create new key
- Select JSON format
- Download the JSON file
5. Configure Environment
The service account JSON is used as the API key:
# .env or .env.local
# Store the entire JSON content (minified) or as a file path
GOOGLE_CLOUD_CREDENTIALS='{"type":"service_account","project_id":"your-project",...}'Alternatively, store the JSON file and reference it:
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.jsonAvailable Models
Image
| Model | ID | Description |
|---|---|---|
| Nana Banana Pro | google/nana-banana-pro | Gemini 3 Pro Image with 4K support |
import { generateImage, imageModel } from "@synthome/sdk";
generateImage({
model: imageModel("google/nana-banana-pro", "google-cloud"),
prompt: "A professional corporate thumbnail with the text 'Q4 Results'",
aspectRatio: "16:9",
imageSize: "4K", // Supports 1K, 2K, 4K
});Video (Coming Soon)
| Model | ID | Description |
|---|---|---|
| VEO 3.0 (Preview) | google/veo-3.0-generate-preview | High-quality video generation |
Image Size Options
Google Cloud's Nana Banana Pro supports high-resolution image generation:
| Size | Resolution | Use Case |
|---|---|---|
1K | 1024px | Fast generation, thumbnails |
2K | 2048px | Standard quality |
4K | 4096px | Print, high-detail work |
generateImage({
model: imageModel("google/nana-banana-pro", "google-cloud"),
prompt: "Detailed product photography",
imageSize: "4K",
});Aspect Ratios
Supported aspect ratios:
1:1- Square3:4- Portrait4:3- Landscape9:16- Vertical video16:9- Widescreen
generateImage({
model: imageModel("google/nana-banana-pro", "google-cloud"),
prompt: "Instagram story design",
aspectRatio: "9:16",
imageSize: "2K",
});Per-Request Credentials
Override the environment variable for specific requests:
generateImage({
model: imageModel("google/nana-banana-pro", "google-cloud"),
prompt: "Marketing banner",
apiKey: '{"type":"service_account","project_id":"other-project",...}',
});Differences from Replicate/Fal
When using Google Cloud directly (vs Replicate or Fal):
| Feature | Google Cloud | Replicate/Fal |
|---|---|---|
imageSize | Supported | Not available |
| Max resolution | 4K (4096px) | Varies |
| Authentication | Service Account JSON | API Key |
| Billing | Google Cloud | Provider-specific |
Resources
How is this guide?