◉CLAUDE LABJP
●THREADS — Message threads arrived in beta on the Messages API (11/2): the server keeps the conversation and you send only new messages●API — The Messages API maximum request size grew from 32 MB to 128 MB (10/28)●SONNET 4.5 — Retires on the Claude API on 11/30, 26 days left. Migrate to Sonnet 5.5●WINDOWS — Reports say hooks break silently only on Japanese-locale Windows; check the character encoding first●FAST — Opus 4.8 fast mode is deprecated and will be removed on 11/30. Migrate to Opus 5.5●NEW — I Put a Ten-Line Promise File at the To…●THREADS — Message threads arrived in beta on the Messages API (11/2): the server keeps the conversation and you send only new messages●API — The Messages API maximum request size grew from 32 MB to 128 MB (10/28)●SONNET 4.5 — Retires on the Claude API on 11/30, 26 days left. Migrate to Sonnet 5.5●WINDOWS — Reports say hooks break silently only on Japanese-locale Windows; check the character encoding first●FAST — Opus 4.8 fast mode is deprecated and will be removed on 11/30. Migrate to Opus 5.5●NEW — I Put a Ten-Line Promise File at the To…
Articles/API & SDK
⬡ API & SDK/2026-04-07Advanced

Vertex AI × Claude Enterprise Integration Guide: Prompt Caching, Multimodal, and Agent Design

A practical guide to enterprise-grade Claude integrations on Google Cloud Vertex AI. Covers prompt caching, BigQuery logging, multimodal processing, agent design, RAG, and production-ready patterns.

Vertex AI3Google CloudEnterprise4Prompt Caching6Multi-agentBigQuery

✦ Premium Article

Why You Need an Enterprise Architecture

Getting Claude running on Vertex AI is straightforward — as covered in the setup guide. But running a stable, cost-efficient production service at scale requires significantly more than a basic API call.

This guide goes deep into the following areas, with working code for each:

  • Prompt caching: Dramatically reduce costs by reusing repeated context
  • BigQuery logging: Compliance, quality monitoring, and cost analysis
  • Multimodal processing: Handling images, PDFs, and complex document inputs
  • Agent design: Tool calling and multi-agent orchestration
  • RAG integration: Connecting Claude to your internal knowledge base
  • Production patterns: Retry logic, circuit breakers, and cost controls

1. Prompt Caching: Cut API Costs by Up to 90%

How Prompt Caching Works

Claude supports prompt caching, which lets you cache long system prompts or context blocks after the first request. Subsequent requests that hit the cache are charged at approximately 10–20% of the standard input token price — a massive cost reduction for applications that reuse the same context repeatedly.

Prompt caching is especially valuable when:

  • Your system prompt runs to thousands of tokens (persona definitions, rules, knowledge)
  • Multiple questions are asked against the same document in a RAG system
  • A code assistant repeatedly references the same large codebase

Implementation: Caching System Prompts

from anthropic import AnthropicVertex
 
client = AnthropicVertex(project_id="your-project", region="asia-southeast1")
 
system_prompt = """You are a customer support agent for Acme Corp.
Follow these guidelines at all times.
 
[Product Catalog — 2,500 Products]
Product ID: P001 — SmartWatch Pro X
Price: $299
Specs: Heart rate monitor, GPS, 5ATM waterproof, 7-day battery
...
[This section may span thousands of tokens — exactly where caching shines]
 
[Support Policy]
1. Returns accepted within 30 days of purchase
2. Repair support available Monday–Friday, 9AM–6PM
3. Escalate urgent cases to senior support
...
"""
 
# First request: cache is created
response1 = client.beta.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=1024,
    betas=["prompt-caching-2024-07-31"],
    system=[
        {
            "type": "text",
            "text": system_prompt,
            "cache_control": {"type": "ephemeral"}
        }
    ],
    messages=[{"role": "user", "content": "Tell me about product P001"}]
)
print("Cache stats:", response1.usage)
# {'input_tokens': 2800, 'cache_creation_input_tokens': 2500, 'cache_read_input_tokens': 0, ...}
 
# Second request: cache is hit
response2 = client.beta.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=1024,
    betas=["prompt-caching-2024-07-31"],
    system=[
        {
            "type": "text",
            "text": system_prompt,
            "cache_control": {"type": "ephemeral"}
        }
    ],
    messages=[{"role": "user", "content": "What's the return policy?"}]
)
print("Cache stats (2nd request):", response2.usage)
# {'input_tokens': 300, 'cache_creation_input_tokens': 0, 'cache_read_input_tokens': 2500, ...}
# → System prompt tokens are now served from cache!

Multi-turn Conversation with Caching

class CachedConversationManager:
    """Multi-turn conversation manager with prompt caching."""
 
    def __init__(self, client: AnthropicVertex, system_prompt: str):
        self.client = client
        self.system_prompt = system_prompt
        self.conversation_history = []
        self.total_cache_hits = 0
 
    def chat(self, user_message: str) -> str:
        self.conversation_history.append({
            "role": "user",
            "content": user_message
        })
 
        response = self.client.beta.messages.create(
            model="claude-sonnet-4-6",
            max_tokens=2048,
            betas=["prompt-caching-2024-07-31"],
            system=[
                {
                    "type": "text",
                    "text": self.system_prompt,
                    "cache_control": {"type": "ephemeral"}
                }
            ],
            messages=self.conversation_history
        )
 
        assistant_message = response.content[0].text
        self.conversation_history.append({
            "role": "assistant",
            "content": assistant_message
        })
 
        cache_read = response.usage.cache_read_input_tokens
        if cache_read:
            self.total_cache_hits += cache_read
            print(f"💰 Cache hit: {cache_read} tokens saved at ~90% discount")
 
        return assistant_message

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦Cut API costs by up to 90% with prompt caching — with real implementation code
✦Enterprise security design using BigQuery logging, IAM, and VPC on Google Cloud
✦Production-ready patterns for multimodal processing, agent orchestration, and RAG
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

⬡ API & SDK2026-09-21
The morning a deprecation notice appeared, I checked versions before editing config
Claude Desktop and Cowork stop accepting older managed-configuration spellings on October 7. Here is how I sorted mine into what to fix now, what to fix after upgrading, and what changes meaning on its own.
⬡ API & SDK2026-08-01
Swapping Tools Mid-Conversation Without Losing Your Prompt Cache
Tools can now be added and removed between turns, but the tool block sits at the very front of the cache prefix. I measured 12 mutation patterns with fingerprints and built a stable-core plus volatile-tail registry with a guard that refuses unsafe changes.
⬡ API & SDK2026-11-05
Three Changes I Made Before Moving to Message Threads, So My Own Copy of the Conversation Stays Mine
What changes when a loop that resends the full history every turn moves to message threads, which entered beta on November 2. How create and continue differ, how to triage a 404 or 400, and where I would not migrate, all based on the official docs.