Gcp Vertex Ai Setup Guide

assetactive

Gcp Vertex Ai Setup Guide

Source: gcp-vertex-ai-setup-guide.md (ingested 2026-03-28)

Here's what I found after browsing your GCP console, AI Studio, and billing page: Your Current State $300 credit, but expiring in ~22 days (~April 14, 2026) — use it or lose it Payment card (Visa 4987) is closed by your bank — fix this immediately at your billing payment methods page or you may lose access Vertex AI is enabled on morphism-systems-prod with 202 models available (Gemini, Claude, Llama, Mistral, and more) Two Gemini API keys already exist in AI Studio (Paid Tier 1), zero usage so far Key Findings Your Vertex AI Model Garden has 8 Claude models, 14 Llama models, 10 Mistral models, and 19 Gemini models — all billable against that same $300 credit. The full pricing breakdown and model IDs are in the guide. Claude Code CLI Setup The guide includes three provider configurations with shell functions for instant switching: bash claude-vertex # Routes through your GCP $300 credits claude-direct # Uses Anthropic API key directly claude-openrouter # Uses OpenRouter for multi-model access One important gotcha documented: setting CLAUDE_CODE_USE_VERTEX=0 does NOT disable Vertex — you must fully unset the variable. This is a known bug. Immediate Actions Fix your payment card — it's closed by your bank Set a budget alert at $250 so you don't overshoot Request Claude model access in Vertex AI Model Garden if not already approved Add the shell functions from the guide to your ~/.zshrc The guide has everything: model IDs, pricing tables, rate limits, cost estimates, Claude Code config, and all the console URLs you need. gcp_ai_setup_guide GCP AI Platform — Setup Guide & Model Reference Extracted: March 22, 2026 GCP Organization: meshal.ai Billing Account: 019945-B547CC-BF8657 ("My Billing Account") ⚠️ Critical Notices ItemDetail Credit Balance $300.00 remaining (100% unused) Credit Expiration ~April 14, 2026 (22 days from extraction date) Account Status Paid account (upgraded from Free Trial) Payment Card Issue Visa ●●●● 4987 — CLOSED by bank. Add a new card ASAP. Linked Project gen-lang-client-0786782560 ("Default Gemini Project") Vertex AI Project morphism-systems-prod (Vertex AI API ✅ Enabled, 202 models available)

  1. Your API Keys & Access Points Google AI Studio (Gemini Direct API) Key (masked)NameCreatedTierProject ...PY40 Google Workspace Jan 13, 2026 Paid Tier 1 gen-lang-client-0786782560 ...6ZE0 Default Gemini API Key Jan 13, 2026 Paid Tier 1 gen-lang-client-0786782560 Manage keys: https://aistudio.google.com/app/apikey Usage (last 28 days): 0 API calls Vertex AI (Multi-Model Gateway) Console: https://console.cloud.google.com/vertex-ai/model-garden?project=morphism-systems-prod API Endpoint: {REGION}-aiplatform.googleapis.com Auth: gcloud auth application-default login
  2. Vertex AI — Complete Model Catalog & Pricing Source: https://cloud.google.com/vertex-ai/generative-ai/pricing (Fetched March 22, 2026) All prices per 1M tokens, ≤200K input context unless noted Gemini Models (Google) ModelResource IDInput $/1MOutput $/1MCache InputContext Gemini 3.1 Pro Preview google/gemini-3.1-pro-preview $2.00 $12.00 $0.20 — Gemini 3.1 Flash Image Preview google/gemini-3.1-flash-image-preview $0.50 $3.00 — — Gemini 3.1 Flash-Lite Preview google/gemini-3.1-flash-lite-preview $0.25 $1.50 $0.03 — Gemini 3 Pro Preview google/gemini-3-pro-preview $2.00 $12.00 $0.20 — Gemini 3 Flash Preview google/gemini-3-flash-preview $0.50 $3.00 $0.05 — Gemini 2.5 Pro google/gemini-2.5-pro $1.25 $10.00 $0.3125 1M Gemini 2.5 Flash ⭐ google/gemini-2.5-flash $0.30 $2.50 $0.075 1M Gemini 2.5 Flash-Lite ⭐ google/gemini-2.5-flash-lite $0.10 $0.40 — 1M Gemini 2.0 Flash google/gemini-2.0-flash-001 $0.10 $0.40 $0.025 1M Gemini 2.0 Flash-Lite google/gemini-2.0-flash-lite-001 $0.075 $0.30 — 1M ⭐ = Best value picks for daily use Claude / Anthropic Models (Partner) ModelResource IDInput $/1MOutput $/1MContext Claude Opus 4.6 claude-opus-4-6@default $5.00 $25.00 200K (1M avail) Claude Sonnet 4.6 claude-sonnet-4-6@default $3.00 $15.00 200K (1M avail) Claude Opus 4.5 claude-opus-4-5@20251101 $5.00 $25.00 200K Claude Sonnet 4.5 claude-sonnet-4-5@20250929 $3.00 $15.00 200K Claude Haiku 4.5 claude-haiku-4-5@20251001 $1.00 $5.00 200K Claude Opus 4.1 claude-opus-4-1@20250805 $15.00 $75.00 200K Claude Opus 4 claude-opus-4@20250514 $15.00 $75.00 200K Claude Sonnet 4 claude-sonnet-4@20250514 $3.00 $15.00 200K Llama / Meta Models (Partner) ModelResource IDInput $/1MOutput $/1MContext Llama 4 Maverick llama-4-maverick-17b-128e-instruct-maas $0.35 $1.15 1M Llama 4 Scout (API service) $0.25 $0.70 328K Llama 3.3 70B Llama-3.3-70b-instruct-maas $0.72 $0.72 131K Llama 3.1 405B (self-deploy) $5.00 $16.00 131K Mistral Models (Partner) ModelResource IDInput $/1MOutput $/1M Mistral Large 3 mistralai/mistral-large-3-instruct-2512 — — Mistral Medium 3 mistralai/mistral-medium-3@001 $0.40 $2.00 Mistral Small 3.1 mistralai/mistral-small-2503@001 $0.10 $0.30 Codestral 2 mistralai/codestral-2@001 $0.30 $0.90 Mistral OCR mistralai/mistral-ocr-2505@001 $0.0005 $0.0005 Other Notable Models on Vertex ModelTypeNotes Gemini Embedding 001 & 002 Embedding Text embeddings Imagen 4 / Ultra Image Gen 10 RPM / 70 RPD (Tier 1) Veo 3 Video Gen 2 RPM / 10 RPD (Tier 1) Gemma 3 (1B–27B) Open Model Self-deploy, Google's open weights Gemini Computer Use Preview Agent Computer use capability Deep Research Pro Preview Research 1 RPM, 1.44K RPD
  3. Rate Limits (AI Studio — Paid Tier 1) ModelRPMTPMRPD Gemini 2.5 Flash 1,000 1M 10,000 Gemini 2.5 Pro 150 2M 1,000 Gemini 2.5 Flash-Lite 4,000 4M Unlimited Gemini 3 Flash 1,000 2M 10,000 Gemini 3.1 Pro 25 2M 250 Gemini 3.1 Flash-Lite 4,000 4M 150,000
  4. Cost Estimation — $300 Credit Budget Use CaseModel$/1M inputEst. Tokens for $300 High-volume dev work Gemini 2.5 Flash-Lite $0.10 in / $0.40 out ~3B input tokens Daily coding assistant Gemini 2.5 Flash $0.30 in / $2.50 out ~1B input tokens Complex reasoning Gemini 2.5 Pro $1.25 in / $10 out ~240M input tokens Claude Code (Sonnet 4.6) Vertex Claude $3.00 in / $15 out ~100M input tokens Claude Code (Haiku 4.5) Vertex Claude $1.00 in / $5.00 out ~300M input tokens
  5. Claude Code CLI — Provider Configuration Option A: Route Claude Code Through Vertex AI (Use Your $300 Credits) Prerequisites: bash

Install gcloud CLI if not already installed

https://cloud.google.com/sdk/docs/install

Authenticate

gcloud auth application-default login

Set your project

gcloud config set project morphism-systems-prod

Enable Vertex AI API (already enabled on your project)

gcloud services enable aiplatform.googleapis.com Configure Claude Code for Vertex AI: Add to your ~/.zshrc or ~/.bashrc: bash

=== Claude Code — Vertex AI Provider ===

export CLAUDE_CODE_USE_VERTEX=1 export CLOUD_ML_REGION=global export ANTHROPIC_VERTEX_PROJECT_ID=morphism-systems-prod

Optional: pin a specific model

export ANTHROPIC_MODEL="claude-sonnet-4-6"

Optional: region overrides for specific models if global isn't available

export VERTEX_REGION_CLAUDE_4_0_OPUS=europe-west1

export VERTEX_REGION_CLAUDE_4_0_SONNET=us-east5

Or add to ~/.claude/settings.json: json { "env": { "CLAUDE_CODE_USE_VERTEX": "1", "CLOUD_ML_REGION": "global", "ANTHROPIC_VERTEX_PROJECT_ID": "morphism-systems-prod" } } Default models when using Vertex AI: RoleModelVertex ID Primary Claude Sonnet 4.6 claude-sonnet-4-6 Small/Fast Claude Haiku 4.5 claude-haiku-4-5@20251001 Option B: Direct Anthropic API bash

=== Claude Code — Anthropic Direct ===

export ANTHROPIC_API_KEY="sk-ant-api03-YOUR-KEY-HERE" export ANTHROPIC_MODEL="claude-sonnet-4-6"

IMPORTANT: Make sure CLAUDE_CODE_USE_VERTEX is NOT set (not even =0)

The presence of the variable (any value) triggers Vertex mode

unset CLAUDE_CODE_USE_VERTEX Switching Between Providers Quick shell functions (add to ~/.zshrc): bash

Switch to Vertex AI (uses GCP $300 credits)

function claude-vertex() { export CLAUDE_CODE_USE_VERTEX=1 export CLOUD_ML_REGION=global export ANTHROPIC_VERTEX_PROJECT_ID=morphism-systems-prod unset ANTHROPIC_API_KEY echo "→ Claude Code: Vertex AI (morphism-systems-prod)" claude "$@" }

Switch to Anthropic Direct API

function claude-direct() { unset CLAUDE_CODE_USE_VERTEX unset CLOUD_ML_REGION unset ANTHROPIC_VERTEX_PROJECT_ID export ANTHROPIC_API_KEY="sk-ant-api03-YOUR-KEY-HERE" echo "→ Claude Code: Anthropic Direct API" claude "$@" }

Switch to OpenRouter (access to many models)

function claude-openrouter() { unset CLAUDE_CODE_USE_VERTEX unset ANTHROPIC_API_KEY export ANTHROPIC_BASE_URL="https://openrouter.ai/api" export ANTHROPIC_AUTH_TOKEN="sk-or-v1-YOUR-KEY-HERE" export ANTHROPIC_MODEL="anthropic/claude-sonnet-4.6" echo "→ Claude Code: OpenRouter" claude "$@" } Usage: bash claude-vertex # Use GCP credits claude-direct # Use Anthropic key claude-openrouter # Use OpenRouter

Or switch models within Claude Code:

/model → interactive model picker

/status → see current model

claude --model claude-opus-4-6 → one-time override

⚠️ Known Issue Setting CLAUDE_CODE_USE_VERTEX=0 does NOT disable Vertex — it checks for variable presence, not value. You must fully unset the variable to switch back to Anthropic direct. (Bug tracked at: https://github.com/anthropics/claude-code/issues/2804) Alternative: claude-provider plugin (npm) bash

Install the provider switcher plugin

npm install -g claude-provider

Interactive switching

claude-provider

Or use inside Claude Code:

/plugin marketplace add iqbal-rashed/claude-provider-plugin

/provider:add vertex

/provider:add anthropic-direct

/provider:switch vertex

/provider:list

  1. Recommended Setup for Your $300 / 22 Days Priority Actions Fix payment card — Visa 4987 is closed by your bank. Add a new card at: https://console.cloud.google.com/billing/019945-B547CC-BF8657/payment-methods Set budget alerts — Create a $250 budget alert so you don't burn through credits: https://console.cloud.google.com/billing/019945-B547CC-BF8657/budgets Enable Claude models on Vertex — Navigate to Model Garden, search "Claude", request access: https://console.cloud.google.com/vertex-ai/model-garden?project=morphism-systems-prod Configure Claude Code — Use the Vertex AI setup above to route through your GCP credits Cost-Optimized Model Strategy TaskUse ThisWhy Bulk coding tasks Gemini 2.5 Flash ($0.30/$2.50) Cheap, fast, 1M context Quick lookups/classification Gemini 2.5 Flash-Lite ($0.10/$0.40) Cheapest option Complex reasoning/architecture Claude Sonnet 4.6 on Vertex ($3/$15) Best coding quality Heavy agentic coding (Claude Code) Claude Haiku 4.5 on Vertex ($1/$5) Good balance for Claude Code Reserve for critical tasks only Claude Opus 4.6 on Vertex ($5/$25) Top-tier but expensive Document processing/OCR Mistral OCR ($0.0005) Nearly free Open-weight experimentation Llama 4 Maverick ($0.35/$1.15) Best open model on Vertex
  2. Quick Reference — All Your API Endpoints ServiceEndpoint / URL Gemini API (AI Studio) https://generativelanguage.googleapis.com/v1beta/ Vertex AI API https://{REGION}-aiplatform.googleapis.com/v1/ AI Studio Keys https://aistudio.google.com/app/apikey Vertex Model Garden https://console.cloud.google.com/vertex-ai/model-garden Billing Dashboard https://console.cloud.google.com/billing/019945-B547CC-BF8657 Vertex AI Pricing https://cloud.google.com/vertex-ai/generative-ai/pricing Claude on Vertex Docs https://docs.cloud.google.com/vertex-ai/generative-ai/docs/partner-models/claude/use-claude Claude Code + Vertex Setup https://code.claude.com/docs/en/google-vertex-ai