Python 88.3%
TypeScript 7.6%
Shell 4.1%
1#!/usr/bin/env python32# STATUS: UNVERIFIED — no cloud credentials in this atlas; snippet follows official docs verbatim-ish3# Source: https://platform.claude.com/docs/en/build-with-claude/claude-on-vertex-ai (retrieved 2026-09-18)4# Install: pip install -U "anthropic[vertex]"5# Auth: Google Application Default Credentials (`gcloud auth application-default login`).6# Env: ANTHROPIC_VERTEX_PROJECT_ID, CLOUD_ML_REGION ("global" recommended; "us"/"eu" multi-region; or e.g. us-east5).7import os89from anthropic import AnthropicVertex1011client = AnthropicVertex(12 project_id=os.environ["ANTHROPIC_VERTEX_PROJECT_ID"],13 region=os.environ.get("CLOUD_ML_REGION", "global"),14)1516# On Google Cloud the model goes in the URL and anthropic_version ("vertex-2023-10-16") in the body; the SDK handles both.17message = client.messages.create(18 model="claude-haiku-4-5@20251001", # cheapest Haiku 4.5 id on Google Cloud (date separated with @)19 max_tokens=8,20 messages=[{"role": "user", "content": "Reply with OK."}],21)22print(next(block.text for block in message.content if block.type == "text"))23