- In Vertex,
model
is not passed in the request body. Instead, it is specified in the Google Cloud endpoint URL. - In Vertex,
anthropic_version
is passed in the request body (rather than as a header), and must be set to the valuevertex-2023-10-16
.
Install an SDK for accessing Vertex AI
First, install Anthropic’s client SDK for your language of choice.Accessing Vertex AI
Model Availability
Note that Anthropic model availability varies by region. Search for “Claude” in the Vertex AI Model Garden or go to Use Claude 3 for the latest information.API model names
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 Haiku 3 | claude-3-haiku@20240307 |
Making requests
Before running requests you may need to rungcloud auth application-default login
to authenticate with GCP.
The following examples shows how to generate text from Claude on Vertex AI:
Activity logging
Vertex provides a request-response logging service that allows customers to log the prompts and completions associated with your usage. Anthropic recommends that you log your activity on at least a 30-day rolling basis in order to understand your activity and investigate any potential misuse.Turning on this service does not give Google or Anthropic any access to your content.