SOP-003: Setting Up Google Vertex AI
FreshSource: Claude with Google Vertex AI
Document Control
| Field | Value |
|---|---|
| SOP ID | SOP-003 |
| Version | 1.0 |
| Status | Active |
| Last Updated | 2024-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_IDStep 2: Enable Claude Models
- Go to Google Cloud Console
- Navigate to Vertex AI → Model Garden
- Search for Claude
- 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
| Model | Vertex AI Model Name |
|---|---|
| Opus 4.5 | claude-opus-4-5@20251101 |
| Sonnet 4 | claude-sonnet-4@20250514 |
| Haiku 3.5 | claude-3-5-haiku@20241022 |
Available Regions: us-east5, europe-west1, asia-southeast1
Required IAM Roles
| Role | Purpose |
|---|---|
roles/aiplatform.user | Predict and explain with AI Platform models |
roles/serviceusage.serviceUsageConsumer | Use 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
| Issue | Solution |
|---|---|
PermissionDenied | Check IAM roles |
ModelNotFound | Enable in Model Garden |
RegionNotSupported | Use supported region |
QuotaExceeded | Request quota increase |