Synthome Docs
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

  1. Go to Google Cloud Console
  2. Create a new project or select an existing one
  3. Note your Project ID (you'll need this later)

2. Enable Required APIs

Enable the Vertex AI API:

gcloud services enable aiplatform.googleapis.com

Or enable it via the Cloud Console API Library.

3. Create a Service Account

  1. Go to IAM & Admin > Service Accounts
  2. Click Create Service Account
  3. Name it (e.g., synthome-vertex-ai)
  4. Grant the Vertex AI User role
  5. Click Done

4. Generate Service Account Key

  1. Click on your new service account
  2. Go to Keys tab
  3. Click Add Key > Create new key
  4. Select JSON format
  5. 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.json

Available Models

Image

ModelIDDescription
Nana Banana Progoogle/nana-banana-proGemini 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)

ModelIDDescription
VEO 3.0 (Preview)google/veo-3.0-generate-previewHigh-quality video generation

Image Size Options

Google Cloud's Nana Banana Pro supports high-resolution image generation:

SizeResolutionUse Case
1K1024pxFast generation, thumbnails
2K2048pxStandard quality
4K4096pxPrint, 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 - Square
  • 3:4 - Portrait
  • 4:3 - Landscape
  • 9:16 - Vertical video
  • 16: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):

FeatureGoogle CloudReplicate/Fal
imageSizeSupportedNot available
Max resolution4K (4096px)Varies
AuthenticationService Account JSONAPI Key
BillingGoogle CloudProvider-specific

Resources

How is this guide?

On this page