Google Vertex AI in Practice

Context Caching on Vertex AI: Feature Availability and Usage

Short answer: yes, Claude's prompt caching works on Vertex AI, at the same discount multipliers as the direct API. The differences are in how you enable it — and one convenience feature that isn't there.

Claude 3P 101 · Updated July 2026 · Unofficial guide

Terminology first, because Google Cloud and Anthropic use different words for related ideas. "Context caching" is the phrase you'll often hear in Vertex AI conversations; Anthropic's feature for Claude is called prompt caching. It lets you mark a stable prefix of your request — a long system prompt, tool definitions, a reference document — so that repeat requests reuse the cached prefix instead of reprocessing it, cutting cost and latency. For Claude on Vertex AI, the question enterprises actually need answered is: is Anthropic's prompt caching available there, and does it behave like the direct API?

Availability: supported, with one gap

Prompt caching with both the 5-minute and 1-hour cache durations is generally available for Claude on Vertex AI — Google maintains a Claude-specific prompt caching page in its partner-model documentation, and Anthropic's availability matrix lists it as GA on Vertex. It also works on the global endpoint, so you don't have to trade caching for availability-optimized routing.

The gap: automatic prompt caching is not supported on Vertex AI. On the first-party Claude API, a single top-level cache_control field lets the platform manage cache breakpoints for you, and Anthropic recommends it as the default. On Vertex you use the explicit style instead — cache_control markers placed on individual content blocks. Functionally you get the same discounts; you just decide where the cache boundary sits.

from anthropic import AnthropicVertex

client = AnthropicVertex(project_id="my-project", region="global")
msg = client.messages.create(
    model="claude-opus-4-8",
    max_tokens=1024,
    system=[{
        "type": "text",
        "text": LONG_POLICY_DOCUMENT,          # stable prefix, reused often
        "cache_control": {"type": "ephemeral"},
    }],
    messages=[{"role": "user", "content": "Does clause 7 apply here?"}],
)
print(msg.usage)  # includes cache write/read token counts

Token accounting and pricing

Google's Vertex pricing page lists the same caching multipliers as the direct API: writing a 5-minute cache costs 1.25x the base input rate, writing a 1-hour cache costs 2x, and a cache hit costs 0.1x. For Claude Opus 4.8 ($5.00 per million input tokens on the global endpoint) that means $6.25 per million tokens for a 5-minute cache write, $10.00 for a 1-hour write, and $0.50 for reads. The arithmetic follows: a 5-minute cache pays for itself after a single reuse, a 1-hour cache after two. Watch the usage object in responses — input tokens, cache-creation tokens, and cache-read tokens are reported separately, and all three still count toward the model's context window. Caching changes what you pay, not how much fits.

Three accounting caveats. First, cached tokens still occupy context — a 900k-token cached prefix leaves correspondingly less room. Second, changing the model string invalidates the cache; the first request after a model upgrade rewrites it at write rates. Third, don't reconcile cache economics against the console quota page — token figures there can be inaccurate due to Anthropic's token estimation and refund system; use the token counting API or token_count metrics in Metrics Explorer.

Configuration differences from the direct API, summarized

AspectClaude API (1P)Vertex AI
Explicit cache_control breakpointsYesYes (GA, 5m and 1h)
Automatic prompt cachingYes (recommended default)Not supported
Cache read / write multipliers0.1x / 1.25x / 2xSame
Cache diagnostics (beta)YesNot available

One more planning note: minimum cacheable-prefix sizes vary by model (Anthropic documents 1,024 tokens on Opus 4.8, and a lower 512-token minimum for Claude Fable 5 on the first-party API). Platform-specific minimums can differ — Anthropic notes Fable 5's minimum remains 1,024 on Bedrock, for instance — so verify the current figure for your model on Vertex in the official docs before assuming a short prefix will cache.

Where to go next

See the Vertex prompt caching how-to for breakpoint placement patterns, prompt caching costs for the economics across platforms, and platform feature gaps for the full availability matrix.

Sources