Skip to content

SOP-003: Setting Up Google Vertex AI

Fresh

Source: Claude with Google Vertex AI

Document Control

FieldValue
SOP IDSOP-003
Version1.0
StatusActive
Last Updated2024-12

Overview

Configure Claude access through Google Cloud's Vertex AI platform.

Prerequisites

  • Google Cloud account with billing enabled
  • Vertex AI API enabled
  • Python 3.8+
  • gcloud CLI installed

Setup Architecture

Step 1: Enable Vertex AI

bash
# Enable the API
gcloud services enable aiplatform.googleapis.com

# Set project
gcloud config set project YOUR_PROJECT_ID

Step 2: Enable Claude Models

  1. Go to Google Cloud Console
  2. Navigate to Vertex AI → Model Garden
  3. Search for Claude
  4. Click Enable for desired models

Step 3: Configure Authentication

bash
# Login with gcloud
gcloud auth application-default login

# Or set service account
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account.json"

Step 4: Install SDK

bash
pip install anthropic[vertex]

Step 5: Make API Call

python
import anthropic

client = anthropic.AnthropicVertex(
    region="us-east5",
    project_id="your-project-id"
)

message = client.messages.create(
    model="claude-sonnet-4@20250514",
    max_tokens=1024,
    messages=[
        {"role": "user", "content": "Hello, Claude!"}
    ]
)

print(message.content[0].text)

Model Names for Vertex AI

ModelVertex AI Model Name
Opus 4.5claude-opus-4-5@20251101
Sonnet 4claude-sonnet-4@20250514
Haiku 3.5claude-3-5-haiku@20241022

Available Regions: us-east5, europe-west1, asia-southeast1

Required IAM Roles

RolePurpose
roles/aiplatform.userPredict and explain with AI Platform models
roles/serviceusage.serviceUsageConsumerUse enabled services

Verification Checklist

  • [ ] Vertex AI API enabled
  • [ ] Claude models enabled in Model Garden
  • [ ] Service account or ADC configured
  • [ ] Correct project ID set
  • [ ] Test call returns response

Troubleshooting

IssueSolution
PermissionDeniedCheck IAM roles
ModelNotFoundEnable in Model Garden
RegionNotSupportedUse supported region
QuotaExceededRequest quota increase

See Also

Based on Anthropic Academy courses