Learn about configuring Claude Code through Google Vertex AI, including setup, IAM configuration, and troubleshooting.
gcloud
) installed and configuredANTHROPIC_VERTEX_PROJECT_ID
environment variable. To override this, set one of these environment variables: GCLOUD_PROJECT
, GOOGLE_CLOUD_PROJECT
, or GOOGLE_APPLICATION_CREDENTIALS
.cache_control
ephemeral flag. To disable it, set DISABLE_PROMPT_CACHING=1
. For heightened rate limits, contact Google Cloud support./login
and /logout
commands are disabled since authentication is handled through Google Cloud credentials.Model type | Default value |
---|---|
Primary model | claude-sonnet-4@20250514 |
Small/fast model | claude-3-5-haiku@20241022 |
roles/aiplatform.user
role includes the required permissions:
aiplatform.endpoints.predict
- Required for model invocationaiplatform.endpoints.computeTokens
- Required for token countingcontext-1m-2025-08-07
beta header in your Vertex AI requests.CLOUD_ML_REGION=global
, check that your models support global endpoints in Model Garden under “Supported features”. For models that don’t support global endpoints, either:
ANTHROPIC_MODEL
or ANTHROPIC_SMALL_FAST_MODEL
, orVERTEX_REGION_<MODEL_NAME>
environment variablesCLOUD_ML_REGION=global
for better availability