Overview
The Vertex AI Anthropic provider connects core-ai to Claude models hosted on Google Vertex AI through the official@anthropic-ai/vertex-sdk client. It shares its request, streaming, tool-calling, structured-output, and reasoning behavior with @core-ai/anthropic — everything documented on the Anthropic Provider page applies equally here.
Installation
createAnthropicVertex()
Create a Vertex AI Anthropic provider instance.Options
string
Your Google Cloud project id. Required unless
client is provided.string
The Vertex AI region hosting the Claude model, for example
europe-west1 or
eu. Required unless client is provided. A provider instance targets a
single region — create separate providers if you need models hosted in
different regions.object
A parsed Google service account JSON key. When omitted, the provider falls
back to Application Default Credentials
(ADC).
AnthropicChatClient
Provide your own configured client (for example a custom
AnthropicVertex
instance).number
default:"4096"
Default maximum tokens for completions. Can be overridden per request.
Returns
AnthropicVertexProvider with method chatModel().
Authentication
By default, the provider uses Application Default Credentials:credentials:
GOOGLE_APPLICATION_CREDENTIALS_JSON accepts either plain JSON or
base64-encoded JSON. This is separate from Google’s standard
GOOGLE_APPLICATION_CREDENTIALS env var, which points to a credentials file
path for ADC.Model IDs and regions
Pass the Vertex model id (as listed in the Vertex AI Model Garden) tochatModel(). Model availability and naming vary by region — some Claude models are published to Vertex AI’s eu multi-region while others are published to region-specific endpoints such as europe-west1. Since a provider instance targets a single region, create separate providers for models hosted in different regions:
Pass the unversioned Vertex model id (e.g.
claude-sonnet-4-6) rather than
a version-pinned id (e.g. claude-sonnet-4-6@20250929). Reasoning effort
and sampling-restriction capability detection
(getAnthropicModelCapabilities and friends in @core-ai/anthropic) only
recognizes the unversioned form today, so a version-pinned id silently falls
back to standard capabilities instead of the model’s actual ones.Provider support
Model capabilities
Vertex-hosted Claude models use the same capability definitions as the direct Anthropic provider:Examples
Basic chat
Streaming
Provider-specific options and reasoning
Provider options are namespaced underanthropic in providerOptions, matching @core-ai/anthropic:
Error handling
Errors are attributed to provider id
anthropic-vertex, distinguishing them
from direct @core-ai/anthropic errors (anthropic).Related
Anthropic Provider
Claude models via the direct Anthropic API
Google GenAI Provider
Gemini models with multimodal support
Chat Completion Guide
Learn how to use chat completion