Anthropic’s Claude models are now generally available through Vertex AI.
model
is not passed in the request body. Instead, it is specified in the Google Cloud endpoint URL.anthropic_version
is passed in the request body (rather than as a header), and must be set to the value vertex-2023-10-16
.Model | Vertex AI API model name |
---|---|
Claude Opus 4.1 | claude-opus-4-1@20250805 |
Claude Opus 4 | claude-opus-4@20250514 |
Claude Sonnet 4 | claude-sonnet-4@20250514 |
Claude Sonnet 3.7 | claude-3-7-sonnet@20250219 |
Claude Haiku 3.5 | claude-3-5-haiku@20241022 |
Claude Sonnet 3.5 | claude-3-5-sonnet-v2@20241022 |
Claude Opus 3 | claude-3-opus@20240229 |
Claude Sonnet 3 | claude-3-sonnet@20240229 |
Claude Haiku 3 | claude-3-haiku@20240307 |
gcloud auth application-default login
to authenticate with GCP.
The following examples shows how to generate text from Claude on Vertex AI: