# Enable Anthropic Claude Models on Vertex AI
## ✅ Model Details Confirmed
- **Model Name:** `claude-sonnet-4-5`
- **Model ID:** `publishers/anthropic/models/claude-sonnet-4-5`
- **Version:** `claude-sonnet-4-5@20250929`
- **Status:** The model ID is correct! ✅
## 🔧 Fix the 404 Errors
The 404 errors suggest the model needs to be **enabled** in your Google Cloud project.
### Step 1: Enable Anthropic Models in Model Garden
1. **Go to Vertex AI Model Garden:**
- https://console.cloud.google.com/vertex-ai/model-garden?project=amgn-app
2. **Search for "Claude Sonnet 4.5"** or navigate to:
- **Publishers** → **Anthropic** → **Claude Sonnet 4.5**
3. **Click on "Claude Sonnet 4.5"** model card
4. **Enable the model** - Look for an "Enable" or "Get Started" button
5. **Accept Terms** if prompted
### Step 2: Verify Model Availability in Region
1. **Check if model is available in `us-central1`:**
- After enabling, verify it shows as available in your region
- Some models might only be available in specific regions
2. **If not available in us-central1, try:**
- `us-east1`
- `us-west1`
- `europe-west1`
### Step 3: Update Vercel Environment Variables
Make sure these are set in Vercel:
```
GCP_PROJECT_ID = amgn-app
GCP_LOCATION = us-central1 (or another valid region)
ANTHROPIC_MODEL_ID = claude-sonnet-4-5
GOOGLE_APPLICATION_CREDENTIALS_JSON = (your service account JSON)
```
### Step 4: Test After Enabling
Wait a few minutes after enabling, then test:
```bash
curl -X POST "https://linkedin-mcp-mocha.vercel.app/api/products/analyze" \
-H "Content-Type: application/json" \
-d '{
"api_key": "b01a98cddade43cac435ef18e6bf0ffe9937dd8fd2da7910b2b9c4b11284d471",
"name": "AmroPilot",
"website_url": "https://amropilot.com",
"description": "AmroPilot is an AI-powered content creation platform that generates human-like text. It helps content creators, marketers, and SEO professionals create engaging articles that rank, convert, and dominate search results.",
"value_proposition": "Transform your content strategy with AI that understands search intent, creates engaging articles, and optimizes for maximum visibility. Generate content that bypasses AI detection and ranks on Google.",
"target_audience": "Content creators, SEO professionals, digital marketers, content marketing agencies, bloggers, online businesses"
}' | python -m json.tool
```
## 🔍 Alternative: Check Model Availability via gcloud
```bash
# List available models in region
gcloud ai models list --region=us-central1 --project=amgn-app --filter="displayName:claude"
# Check if Anthropic publisher is available
gcloud ai endpoints list --region=us-central1 --project=amgn-app
```
## ⚠️ If Model Still Not Available
If Claude Sonnet 4.5 is not available:
1. **Check Model Garden** for available Claude versions:
- https://console.cloud.google.com/vertex-ai/model-garden?project=amgn-app
- Look for other Claude models that might be available
2. **Use an alternative model** (update `ANTHROPIC_MODEL_ID` in Vercel):
- `claude-3-5-sonnet-20241022`
- `claude-3-7-sonnet`
- Or whatever is available in Model Garden
3. **Check region availability:**
- Some regions might not have Anthropic models yet
- Try `us-east1` or `us-west1` if `us-central1` doesn't work
## ✅ Code Fix Applied
The code has been updated to use **regional endpoints** (e.g., `us-central1-aiplatform.googleapis.com` instead of `aiplatform.googleapis.com`). This is committed and will be deployed.
## 📋 Summary Checklist
- [x] Model ID confirmed: `claude-sonnet-4-5`
- [x] Code updated to use regional endpoints
- [ ] Enable Anthropic models in Model Garden (DO THIS NOW!)
- [ ] Verify model available in `us-central1` region
- [ ] Test after enabling
**Next Step:** Go to Model Garden and enable the Claude Sonnet 4.5 model!