C.W.K.
Stream
Lesson 02 of 06 · published

AI Studio vs Vertex AI

~12 min · platforms, auth, architecture

Level 0Spark
0 XP0/35 lessons0/10 achievements
0/140 XP to next level140 XP to go0% complete

Two front doors to the same brain

Google ships Gemini through two platforms, and your auth, billing, compliance posture, and even the SDK's vertexai=True switch all change depending on which one you use. Pick wrong at week one and you'll be paying with a refactor at month six.

Google AI Studio — the developer front door

Lives at ai.google.dev. Auth is a single API key. There is a free tier with real (if narrow) limits. You can wire a working client in five minutes: get a key, set GEMINI_API_KEY, instantiate genai.Client(). This is the right starting point for prototypes, side projects, indie products, and most production apps that don't have a compliance reason to choose otherwise.

Vertex AI — the enterprise front door

Lives inside Google Cloud Platform. Auth is service accounts or Application Default Credentials. Billing rolls into your existing GCP invoice. You get SOC 2, HIPAA, and the ability to call non-Google models (Anthropic Claude, Meta Llama, 200+ others) through the same surface. Setup is hours, not minutes — you need a project, IAM bindings, region selection, and IAM permissions for the service account.

The decision matrix

Compliance pressure or multi-model needs? Vertex. Everything else? AI Studio.

  • AI Studio: prototypes, startups, indie products, internal tools, most production traffic.
  • Vertex AI: regulated industries (healthcare, finance, government), apps that already live in GCP, teams that want one bill across providers.

The SDK is the same packagegoogle-genai — and you switch between platforms with a constructor flag. That means refactor cost from AI Studio to Vertex is mostly auth and billing, not application code.

Code

Same SDK, two platforms·python
from google import genai

# Path A: Google AI Studio
# Reads GEMINI_API_KEY (or GOOGLE_API_KEY) from env
client = genai.Client()

# Path B: Vertex AI (enterprise)
client = genai.Client(
    vertexai=True,
    project='my-gcp-project',
    location='us-central1',
)

# Path C: switch via env
# export GOOGLE_GENAI_USE_VERTEXAI=true
# export GOOGLE_CLOUD_PROJECT=my-gcp-project
# export GOOGLE_CLOUD_LOCATION=us-central1
client = genai.Client()  # picks up env vars
Endpoint shapes are different too·text
# AI Studio
POST https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent
Header: x-goog-api-key: $GEMINI_API_KEY

# Vertex AI (region-scoped, project-scoped)
POST https://{LOCATION}-aiplatform.googleapis.com/v1/projects/{PROJECT}/locations/{LOCATION}/publishers/google/models/{MODEL}:generateContent
Header: Authorization: Bearer $(gcloud auth print-access-token)

External links

Exercise

Pick a real or imagined product (a code review bot, a meditation app, a hospital-side scribe, an internal company knowledge tool). Write three sentences: which platform you'd start on, why, and what would force you to migrate to the other one. The third sentence is the important one — name a concrete trigger, not "if we get bigger."

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.