How to Use Claude API on Google | Vertex AI Setup and Pricing

Developers searching for "how to call the Claude API on Google Cloud" or "do I need a direct Anthropic contract to use Claude?" are really after two things: the concrete steps to enable the Claude API via Google Cloud Vertex AI Model Garden, and how pricing, authentication, and model availability differ from the direct Anthropic API. This article draws on official Google Cloud and Anthropic documentation to cover everything in one place — from project setup and sample code to pricing and a comparison with AWS Bedrock.

AI-generated article summarypowered by Claude
結論powered by Claude

The primary path to using the Claude API on Google is through Google Cloud Vertex AI Model Garden. Anthropic has been a strategic Google Cloud partner since 2023, with Claude models deployed on Vertex AI as "partner models." Developers can enable the Vertex AI API and the relevant model in a GCP project, then call endpoints like claude-opus-4-7@20251218 using the google-cloud-aiplatform SDK and Google account credentials — no separate Anthropic contract required for production workloads.

The biggest difference from the direct Anthropic API is that billing, SSO, and data residency can all be managed centrally on the Google Cloud side. Via Vertex AI, charges are consolidated into a GCP billing account, access is controlled via IAM roles, perimeter protection is provided by VPC Service Controls, and audit logs are captured in Cloud Logging. However, the direct Anthropic API tends to offer the latest models sooner, and regions are limited to areas such as us-east5, europe-west1, and asia-southeast1, so certain models are not yet available in the Tokyo region.

Pricing mirrors Anthropic's direct API on a per-token basis, billed through Google Cloud: Opus 4.7 at $15 input / $75 output, Sonnet 4.6 at $3 input / $15 output, and Haiku 4.5 at $1 input / $5 output (per 1M tokens as of May 2026). Prompt caching and the 50% Batch API discount are also available on Vertex AI. Note that the direct Anthropic API tends to receive new models first, with Vertex AI following weeks to months later, so always check the official sites for the latest availability and pricing. This article also includes the five activation steps, Python sample code, and a comparison table with AWS Bedrock.

目次 (14)

Two Paths to the Claude API on Google

There are essentially two ways to call the Claude API starting from a Google account.

The first path is via Google Cloud Vertex AI Model Garden — the main focus of this article. You enable the Vertex AI API in a GCP project, activate each Claude model from its model card, and call it using the google-cloud-aiplatform SDK or REST API with Google account credentials. No direct Anthropic contract is needed, and billing is consolidated into your GCP billing account. The official documentation is Google Cloud — Claude models from Anthropic and Anthropic — Claude on Vertex AI.

The second path is to log in to the Anthropic Console via Google OAuth and issue an API key. This uses the direct Anthropic API; Google only acts as an OAuth identity provider. Billing goes through Anthropic's prepaid credits, with no Workspace SSO or IAM integration. This approach suits individual developers prototyping or those who need early access to the latest models before they arrive on Vertex AI.

This article focuses on the first path. For the second path, see Claude API Getting Started | Minimum Steps to Run in 10 Lines of Python and Pricing.

5 Steps to Enable the Claude API on Vertex AI

Here are the steps to get Claude API calls working on Google Cloud, starting from a single GCP project.

  1. Enable a billing account on your GCP project. Vertex AI charges per token, so a free-tier account alone cannot support production use.
  2. Enable the Vertex AI API (aiplatform.googleapis.com). Search for it under "APIs & Services" in the Cloud Console, or run gcloud services enable aiplatform.googleapis.com from the CLI.
  3. Enable each Claude model individually in Model Garden. Go to "Vertex AI → Model Garden" in the Console, open the model card for "Claude Opus 4.7," "Claude Sonnet 4.6," "Claude Haiku 4.5," etc., and click "Enable." Accepting the terms of service makes the model ID available within that project.
  4. Grant the Vertex AI User role (roles/aiplatform.user) via IAM. Assign it to a service account or personal account, then run gcloud auth application-default login to obtain Application Default Credentials (ADC).
  5. Choose your region. Claude models are available primarily in us-east5, with support also in us-central1, europe-west1, europe-west4, asia-southeast1, and others. Availability varies by model, so check the model card in Model Garden before passing the region argument to the SDK.
  6. Verify connectivity. Run gcloud ai model-garden models list --region=us-east5 to confirm models are listed, or run the Python sample below to verify a response is returned. If you get a 404 or Permission Denied error, revisit step 3 (model activation) and step 5 (region selection) as your first troubleshooting steps.

Steps 3, 5, and 6 are the most common sticking points — calling a model ID in an unsupported region returns 404 or Permission Denied. For the most reliable current availability, check the Vertex AI model region availability list.

Python Sample | Calling Vertex AI with the Anthropic SDK

There are two ways to call Claude via Vertex AI: (1) the Anthropic official SDK's AnthropicVertex client (same feel as the direct API — recommended in this article, shown below) and (2) Google's google-cloud-aiplatform SDK. This article covers the first. The AnthropicVertex client exposes nearly the same interface as the direct Anthropic API. Here is a minimal example:

# pip install anthropic[vertex]
from anthropic import AnthropicVertex

client = AnthropicVertex(
    project_id="your-gcp-project-id",
    region="us-east5",
)

message = client.messages.create(
    model="claude-opus-4-7@20251218",
    max_tokens=1024,
    messages=[
        {"role": "user", "content": "Hello Claude on Vertex AI"}
    ],
)

print(message.content[0].text)

Credentials are read automatically from the service account key file specified in the GOOGLE_APPLICATION_CREDENTIALS environment variable, or from the credentials file obtained via gcloud auth application-default login. No Anthropic API key is required.

For TypeScript, the @anthropic-ai/vertex-sdk package provides an equivalent API. Java and Go typically call the REST API directly. See Anthropic SDK — Vertex AI for details.

Pricing | Differences from the Direct Anthropic API

The Claude API via Vertex AI uses the same per-token input/output rates as the direct Anthropic API, billed through your GCP billing account. The table below shows pricing for major models as of May 2026 (per 1M tokens).

Model Input Output Prompt Cache Write Cache Read
Claude Opus 4.7 $15 $75 $18.75 $1.50
Claude Sonnet 4.6 $3 $15 $3.75 $0.30
Claude Haiku 4.5 $1 $5 $1.25 $0.10

On Opus 4.8: As of June 2026, Claude Opus 4.8 is available as the latest generation on the direct Anthropic API, but its deployment to Vertex AI Model Garden has not been confirmed. Since Vertex AI tends to receive new models weeks to months after the direct API, check Vertex AI Pricing — Anthropic models for the latest Opus 4.8 pricing and availability. If you need Opus 4.8 right now, the direct Anthropic API is the reliable choice.

Prompt caching is also available on Vertex AI, enabling up to 90% reduction in input costs for workloads that reuse long prompts. The 50% Batch API discount is likewise supported, though on Vertex AI it operates as a "batch prediction job" with job management following Vertex AI's interface.

The main practical difference from the direct Anthropic API lies in Committed Use Discounts (CUD) and commitment-based discounts. Via Vertex AI, GCP's long-term commitment discounts and per-billing-account cost aggregation apply, whereas the direct Anthropic API Enterprise plan offers separately negotiated volume discounts with a different structure. At monthly spend in the thousands of dollars, comparing both options with concrete estimates is recommended. Always verify the latest rates at Vertex AI Pricing — Anthropic models and Anthropic Pricing.

Available Models and Regional Availability

Because Google Cloud certifies and deploys Claude models after Anthropic releases them, Vertex AI tends to lag the direct Anthropic API by weeks to months. As of June 2026, Opus 4.7, Sonnet 4.6, and Haiku 4.5 are available in major regions, with 200K token context windows, image input, tool use, and Extended Thinking all supported on par with the direct API. Claude Opus 4.8 is available as the latest generation on the direct Anthropic API, but its deployment to Vertex AI has not been confirmed as of June 2026. If you need Opus 4.8 immediately, use the direct Anthropic API and wait for it to land on Vertex AI.

us-east5 is the primary deployment region, where the latest models like Opus 4.7 tend to appear first. asia-northeast1 (Tokyo) does not currently offer Claude as of June 2026, so users in Japan should use asia-southeast1 (Singapore). Availability is subject to change, so consult the Vertex AI model region availability list for the latest information (last checked: 2026-06-08).

Placing Vertex AI inside a VPC Service Controls perimeter (GCP's network boundary feature that prevents requests from leaving the project boundary) lets you call the Claude API entirely within GCP's protected boundary — a common setup in finance, healthcare, and other industries that handle sensitive data. The direct Anthropic API does not support this level of network isolation.

Comparison with AWS Bedrock | Choosing in a Multi-Cloud Environment

The Claude API is also available as a managed service on AWS Bedrock, making it a frequent comparison point with Vertex AI. The table below summarizes the implementation-level differences.

Item Google Cloud Vertex AI AWS Bedrock Direct Anthropic API
Authentication Google account / service account IAM role / access key Anthropic API key
Billing GCP billing account AWS account Anthropic credits
New model availability Medium (weeks behind) Medium (weeks behind) Fast (day of release)
Prompt caching Supported Supported Supported
Batch API 50% discount Supported Supported Supported
Data residency Region selection Region selection US/EU only
Primary Japan region asia-southeast1 etc. ap-northeast-1 (Tokyo) N/A
SLA Vertex AI SLA Bedrock SLA Anthropic SLA

The first criterion should be aligning with your existing cloud contract. GCP-centric organizations are a natural fit for Vertex AI, AWS-centric organizations for Bedrock, and smaller, cloud-agnostic development teams for the direct Anthropic API. Using a multi-cloud AI library (LiteLLM, LangChain, etc.) as an intermediary makes it possible to design for backend switching later.

Frequently Asked Questions (FAQ)

Do I need an Anthropic API key to use Vertex AI?

No. Google Cloud Application Default Credentials (ADC) are sufficient. The AnthropicVertex client internally obtains a Google OAuth2 token and sends it to Vertex AI.

Can I use an API key issued from the Anthropic Console on Vertex AI?

No. Anthropic's direct API keys are exclusive to api.anthropic.com and will not authenticate against Vertex AI endpoints (such as us-east5-aiplatform.googleapis.com). The two paths are completely separate.

asia-southeast1 (Singapore) is currently the top choice. asia-northeast1 (Tokyo) does not offer Claude as of June 2026, so please select Singapore as the nearest available region. Combined with VPC Service Controls, you can configure Claude requests to never leave the GCP perimeter. See Vertex AI VPC Service Controls for specific configuration guidance.

What should I watch out for when migrating from the direct Anthropic API to Vertex AI?

Model ID naming changes. The direct Anthropic API uses formats like claude-opus-4-7, whereas on Vertex AI the same model may appear as claude-opus-4-7@20251218 with a snapshot date appended. The SDK call itself is straightforward — just swap in the AnthropicVertex client — but you need to verify the correct model ID and region combination against the latest documentation.

Summary — Vertex AI Model Garden Is the Go-To Path for Claude API on Google

The answer to "how do I use the Claude API on Google" is: enable a Claude model in Google Cloud Vertex AI Model Garden and call it using the Anthropic SDK's AnthropicVertex client. No direct Anthropic contract is required, and you can manage Claude entirely within GCP's billing, IAM, and VPC boundaries — making it the top choice for enterprise adoption.

The first five steps are: (1) enable a billing account in your GCP project, (2) enable the Vertex AI API, (3) enable the target model in Model Garden, (4) grant the aiplatform.user role via IAM, and (5) confirm the supported regions. Pricing is on par with the direct Anthropic API at $1–$15 input / $5–$75 output per 1M tokens, with prompt caching and Batch API discounts equally available.

For individual developers who want the latest models first, use the direct Anthropic API. AWS-centric organizations should use Bedrock. GCP-centric organizations should use Vertex AI. Aligning with your existing cloud contract is the operationally optimal choice.

Sources

参考になったら ♡
Clauder Navi 編集部
@clauder_navi

Anthropic の Claude / Claude Code を中心に、日本のエンジニア向けに最新動向と実務 を毎日発信。 運営方針 は メディアについて をご覧ください。