Loading...
    • Developer Guide
    • API Reference
    • MCP
    • Resources
    • Release Notes
    Search...
    ⌘K

    First steps

    Intro to ClaudeQuickstart

    Models & pricing

    Models overviewChoosing a modelWhat's new in Claude 4.5Migrating to Claude 4.5Model deprecationsPricing

    Build with Claude

    Features overviewUsing the Messages APIContext windowsPrompting best practices

    Capabilities

    Prompt cachingContext editingExtended thinkingStreaming MessagesBatch processingCitationsMultilingual supportToken countingEmbeddingsVisionPDF supportFiles APISearch resultsGoogle Sheets add-on

    Tools

    OverviewHow to implement tool useToken-efficient tool useFine-grained tool streamingBash toolCode execution toolComputer use toolText editor toolWeb fetch toolWeb search toolMemory tool

    Agent Skills

    OverviewQuickstartBest practicesUsing Skills with the API

    Agent SDK

    OverviewTypeScript SDKPython SDK

    Guides

    Streaming InputHandling PermissionsSession ManagementHosting the Agent SDKModifying system promptsMCP in the SDKCustom ToolsSubagents in the SDKSlash Commands in the SDKAgent Skills in the SDKTracking Costs and UsageTodo ListsPlugins in the SDK

    MCP in the API

    MCP connectorRemote MCP servers

    Claude on 3rd-party platforms

    Amazon BedrockVertex AI

    Prompt engineering

    OverviewPrompt generatorUse prompt templatesPrompt improverBe clear and directUse examples (multishot prompting)Let Claude think (CoT)Use XML tagsGive Claude a role (system prompts)Prefill Claude's responseChain complex promptsLong context tipsExtended thinking tips

    Test & evaluate

    Define success criteriaDevelop test casesUsing the Evaluation ToolReducing latency

    Strengthen guardrails

    Reduce hallucinationsIncrease output consistencyMitigate jailbreaksStreaming refusalsReduce prompt leakKeep Claude in character

    Administration and monitoring

    Admin API overviewUsage and Cost APIClaude Code Analytics API
    Console
    Claude on 3rd-party platforms

    Claude on Vertex AI

    Anthropic's Claude models are now generally available through Vertex AI.

    The Vertex API for accessing Claude is nearly-identical to the Messages API and supports all of the same options, with two key differences:

    • 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 value vertex-2023-10-16.

    Vertex is also supported by Anthropic's official client SDKs. This guide will walk you through the process of making a request to Claude on Vertex AI in either Python or TypeScript.

    Note that this guide assumes you have already have a GCP project that is able to use Vertex AI. See using the Claude 3 models from Anthropic for more information on the setup required, as well as a full walkthrough.

    Install an SDK for accessing Vertex AI

    First, install Anthropic's client SDK for your language of choice.

    Python
    pip install -U google-cloud-aiplatform "anthropic[vertex]"
    TypeScript
    npm install @anthropic-ai/vertex-sdk

    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 IDs

    ModelVertex AI API model ID
    Claude Sonnet 4.5claude-sonnet-4-5@20250929
    Claude Sonnet 4claude-sonnet-4@20250514
    Claude Sonnet 3.7 claude-3-7-sonnet@20250219
    Claude Opus 4.1claude-opus-4-1@20250805
    Claude Opus 4claude-opus-4@20250514
    Claude Opus 3 claude-3-opus@20240229
    Claude Haiku 4.5claude-haiku-4-5@20251001
    Claude Haiku 3.5claude-3-5-haiku@20241022
    Claude Haiku 3claude-3-haiku@20240307

    Making requests

    Before running requests you may need to run gcloud auth application-default login to authenticate with GCP.

    The following examples shows how to generate text from Claude on Vertex AI:

    from anthropic import AnthropicVertex
    
    project_id = "MY_PROJECT_ID"
    region = "global"
    
    client = AnthropicVertex(project_id=project_id, region=region)
    
    message = client.messages.create(
        model="claude-sonnet-4-5@20250929",
        max_tokens=100,
        messages=[
            {
                "role": "user",
                "content": "Hey Claude!",
            }
        ],
    )
    print(message)

    See our client SDKs and the official Vertex AI docs for more details.

    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.

    Feature support

    You can find all the features currently supported on Vertex here.

    Global vs regional endpoints

    Starting with Claude Sonnet 4.5 and all future models, Google Vertex AI offers two endpoint types:

    • Global endpoints: Dynamic routing for maximum availability
    • Regional endpoints: Guaranteed data routing through specific geographic regions

    Regional endpoints include a 10% pricing premium over global endpoints.

    This applies to Claude Sonnet 4.5 and future models only. Older models (Claude Sonnet 4, Opus 4, and earlier) maintain their existing pricing structures.

    When to use each option

    Global endpoints (recommended):

    • Provide maximum availability and uptime
    • Dynamically route requests to regions with available capacity
    • No pricing premium
    • Best for applications where data residency is flexible
    • Only supports pay-as-you-go traffic (provisioned throughput requires regional endpoints)

    Regional endpoints:

    • Route traffic through specific geographic regions
    • Required for data residency and compliance requirements
    • Support both pay-as-you-go and provisioned throughput
    • 10% pricing premium reflects infrastructure costs for dedicated regional capacity

    Implementation

    Using global endpoints (recommended):

    Set the region parameter to "global" when initializing the client:

    from anthropic import AnthropicVertex
    
    project_id = "MY_PROJECT_ID"
    region = "global"
    
    client = AnthropicVertex(project_id=project_id, region=region)
    
    message = client.messages.create(
        model="claude-sonnet-4-5@20250929",
        max_tokens=100,
        messages=[
            {
                "role": "user",
                "content": "Hey Claude!",
            }
        ],
    )
    print(message)

    Using regional endpoints:

    Specify a specific region like "us-east1" or "europe-west1":

    from anthropic import AnthropicVertex
    
    project_id = "MY_PROJECT_ID"
    region = "us-east1"  # Specify a specific region
    
    client = AnthropicVertex(project_id=project_id, region=region)
    
    message = client.messages.create(
        model="claude-sonnet-4-5@20250929",
        max_tokens=100,
        messages=[
            {
                "role": "user",
                "content": "Hey Claude!",
            }
        ],
    )
    print(message)

    Additional resources

    • Google Vertex AI pricing: cloud.google.com/vertex-ai/generative-ai/pricing
    • Claude models documentation: Claude on Vertex AI
    • Google blog post: Global endpoint for Claude models
    • Anthropic pricing details: Pricing documentation
    • Install an SDK for accessing Vertex AI
    • Accessing Vertex AI
    • Model Availability
    • Making requests
    • Activity logging
    • Feature support
    • Global vs regional endpoints
    • When to use each option
    • Implementation
    • Additional resources
    © 2025 ANTHROPIC PBC

    Products

    • Claude
    • Claude Code
    • Max plan
    • Team plan
    • Enterprise plan
    • Download app
    • Pricing
    • Log in

    Features

    • Claude and Slack
    • Claude in Excel

    Models

    • Opus
    • Sonnet
    • Haiku

    Solutions

    • AI agents
    • Code modernization
    • Coding
    • Customer support
    • Education
    • Financial services
    • Government
    • Life sciences

    Claude Developer Platform

    • Overview
    • Developer docs
    • Pricing
    • Amazon Bedrock
    • Google Cloud’s Vertex AI
    • Console login

    Learn

    • Blog
    • Catalog
    • Courses
    • Use cases
    • Connectors
    • Customer stories
    • Engineering at Anthropic
    • Events
    • Powered by Claude
    • Service partners
    • Startups program

    Company

    • Anthropic
    • Careers
    • Economic Futures
    • Research
    • News
    • Responsible Scaling Policy
    • Security and compliance
    • Transparency

    Help and security

    • Availability
    • Status
    • Support center

    Terms and policies

    • Privacy policy
    • Responsible disclosure policy
    • Terms of service: Commercial
    • Terms of service: Consumer
    • Usage policy

    Products

    • Claude
    • Claude Code
    • Max plan
    • Team plan
    • Enterprise plan
    • Download app
    • Pricing
    • Log in

    Features

    • Claude and Slack
    • Claude in Excel

    Models

    • Opus
    • Sonnet
    • Haiku

    Solutions

    • AI agents
    • Code modernization
    • Coding
    • Customer support
    • Education
    • Financial services
    • Government
    • Life sciences

    Claude Developer Platform

    • Overview
    • Developer docs
    • Pricing
    • Amazon Bedrock
    • Google Cloud’s Vertex AI
    • Console login

    Learn

    • Blog
    • Catalog
    • Courses
    • Use cases
    • Connectors
    • Customer stories
    • Engineering at Anthropic
    • Events
    • Powered by Claude
    • Service partners
    • Startups program

    Company

    • Anthropic
    • Careers
    • Economic Futures
    • Research
    • News
    • Responsible Scaling Policy
    • Security and compliance
    • Transparency

    Help and security

    • Availability
    • Status
    • Support center

    Terms and policies

    • Privacy policy
    • Responsible disclosure policy
    • Terms of service: Commercial
    • Terms of service: Consumer
    • Usage policy
    © 2025 ANTHROPIC PBC