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 output limit for requests that omit
maxTokens. When unset, each
request uses the model’s output ceiling. See Output
limits.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:Strict tool schemas
Per-toolstrict: true follows the model capabilities of the underlying
Anthropic provider: Claude 4.5 and later models report
{ supported: true, maxStrictTools: 20, maxUnionParameters: 16 }. There is no provider-level switch —
the strictToolSchemasEnabled option was removed. See
Anthropic strict tool schemas
and the tool-calling guide.
Tool discovery
Vertex-hosted Claude models reporttools.toolDiscovery like the direct
Anthropic provider: 'native' for Claude 4.5 and later models, 'emulated'
for older ones. To force emulation, set emulateToolDiscovery: true under the
anthropic-vertex key:
Examples
Basic chat
Streaming
Provider-specific options and reasoning
Provider options are namespaced underanthropic-vertex in providerOptions and accept the same fields as @core-ai/anthropic. Options under the anthropic key are ignored:
providerOptions: { 'anthropic-vertex': { cacheControl: { type: 'ephemeral', ttl: '1h' } } }
on any of them.
See the Anthropic Provider docs for the full list of available fields, reasoning restrictions, and prompt-caching behavior — they apply unchanged to Vertex-hosted Claude models.
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