Vertex AI Claude

Use Claude models through Vertex AI with Agno agents.

v2.1.3

Use Claude models through Vertex AI. Agno sends synchronous and asynchronous requests with Anthropic's AnthropicVertex clients.

We recommend experimenting to find the best-suited model for your use case. Here are some general recommendations:

  • claude-sonnet-4-6 is the newer Sonnet model (Claude Sonnet 4.6). Current-generation models use bare IDs on Vertex AI, with no @date suffix.
  • claude-sonnet-4@20250514 is the Agno default. It is deprecated on Vertex AI; use claude-sonnet-4-6 for new work.

Installation

uv pip install -U 'anthropic[vertex]' agno

Authentication

Before authenticating, follow Google's Claude setup: select a billing-enabled project, enable the Vertex AI API, enable Claude in Model Garden and accept its terms, and grant the caller the required prediction permissions. Install the Google Cloud CLI. Select a region that serves your model; us-east5 is an example for Sonnet 4.6.

Set GOOGLE_CLOUD_PROJECT and CLOUD_ML_REGION for that project and region. Application Default Credentials (ADC) supplies the project when project_id is not explicit. The Agno-specific override ANTHROPIC_VERTEX_PROJECT_ID is also supported.

export GOOGLE_CLOUD_PROJECT="your_value_here"
export CLOUD_ML_REGION="us-east5"

And then authenticate your CLI session:

gcloud auth application-default login

Example

Use Claude with your Agent:

from agno.agent import Agent
from agno.models.vertexai.claude import Claude

agent = Agent(
    model=Claude(id="claude-sonnet-4-6"),
)

# Print the response on the terminal
agent.print_response("Share a 2 sentence dramatic story.")
View more examples here.

Parameters

The table records the adapter default. Runnable examples explicitly use Sonnet 4.6; older cookbook examples may still show the deprecated Sonnet 4 route. Check Anthropic's Vertex model table for platform-specific availability.

ParameterTypeDefaultDescription
idstr"claude-sonnet-4@20250514"The specific Vertex AI Claude model ID to use
namestr"Claude"The name identifier for the Vertex AI Claude model
providerstr"VertexAI"The provider of the model
regionOptional[str]NoneThe region to use for the model (defaults to CLOUD_ML_REGION env var)
project_idOptional[str]NoneThe project ID to use for the model (defaults to ANTHROPIC_VERTEX_PROJECT_ID env var)
base_urlOptional[str]NoneThe base URL to use for the model (defaults to ANTHROPIC_VERTEX_BASE_URL env var)

Claude (Vertex AI) extends the Anthropic Claude model with Vertex AI integration and has access to most of the same parameters.