The Gemini API is Google's latest multimodal LLM family, with the Gemini 2.0 generation rolling out from 2024 onward. Three tiers (Flash / Pro / Ultra) deliver 75% cost reduction via Context Cache, up to 2 million tokens of context, and built-in Tool Use, placing it alongside OpenAI and Anthropic as a top-tier LLM API.
| Model | Context | Input ($/M tok) | Output ($/M tok) | Use Case |
|---|---|---|---|---|
| Gemini 2.0 Flash | 1M | $0.075 | $0.30 | Chat / summarization / lightweight tasks |
| Gemini 2.0 Pro | 2M | $1.25 | $5.00 | RAG / code generation / reasoning |
| Gemini Ultra | 2M | Custom | Custom | Enterprise advanced reasoning |
| Gemma 2 (OSS) | 8k | Free | Free | Edge / on-premises |
| Item | Google AI Studio | Vertex AI |
|---|---|---|
| Use case | Personal / PoC | Production / Enterprise |
| Free tier | Generous (RPD limited) | $300 credit |
| Auth | API Key | IAM / Service Account |
| CMEK | — | Yes |
| VPC SC | — | Yes |
| SLA | — | 99.9% |
| Data Use | May be used for training | Not used (default) |
from vertexai.generative_models import GenerativeModel, Part
import vertexai
vertexai.init(project="my-project", location="asia-northeast1")
model = GenerativeModel("gemini-2.0-flash-001")
# Text
response = model.generate_content("What is the capital of Japan?")
print(response.text)
# Multimodal (image + text)
image = Part.from_uri("gs://my-bucket/photo.jpg", mime_type="image/jpeg")
response = model.generate_content([image, "Describe this image"])
# Function Calling
from vertexai.generative_models import Tool, FunctionDeclaration
weather_func = FunctionDeclaration(
name="get_weather",
description="Get current weather",
parameters={
"type": "object",
"properties": {"city": {"type": "string"}},
"required": ["city"],
},
)
tools = [Tool(function_declarations=[weather_func])]
response = model.generate_content(
"What is the weather in Tokyo?", tools=tools
)from vertexai.preview import caching
from datetime import datetime, timedelta
# Cache the system prompt plus a long document
cached_content = caching.CachedContent.create(
model_name="gemini-2.0-pro-001",
system_instruction="You are an internal FAQ bot",
contents=[long_document],
ttl=timedelta(hours=1),
)
# Using the cache (75% discount on input)
model = GenerativeModel.from_cached_content(cached_content)
response = model.generate_content("How do I request time off?")| Item | Gemini 2.0 Flash | GPT-4o mini | Claude Haiku 3.5 |
|---|---|---|---|
| Input ($/M tok) | $0.075 | $0.15 | $0.80 |
| Output ($/M tok) | $0.30 | $0.60 | $4.00 |
| Context | 1M | 128k | 200k |
| Multimodal | Excellent (incl. video) | Yes (image) | Yes (image) |
| Item | Gemini 2.0 Pro | GPT-4o | Claude Sonnet 3.5 |
|---|---|---|---|
| Input ($/M tok) | $1.25 | $2.50 | $3.00 |
| Output ($/M tok) | $5.00 | $10.00 | $15.00 |
| Context | 2M | 128k | 200k |
Should I use Google AI Studio or Vertex AI for the Gemini API?
Use Google AI Studio for personal projects and PoCs (generous free tier); use Vertex AI for production and enterprise (CMEK / VPC SC / SLA). Both serve the same Gemini models, but auth, billing, and SLAs differ.
What's the difference between Gemini 2.0 Flash and Pro?
Flash = low latency, low cost, 1M tokens (chat, summarization). Pro = higher accuracy, 2M tokens (RAG, code generation). Flash covers 99% of use cases.
How much does Gemini cost?
Flash: $0.075/M input tokens, $0.30/M output tokens. Pro: $1.25/M input, $5.00/M output. That's 5-10x cheaper than GPT-4o and roughly on par with Claude Sonnet.
What multimodal inputs are supported?
Text + image + audio + video + PDF inputs are supported. Pro can process up to 2 hours of video, Flash up to 1 hour, in a single request.
What about Function Calling?
An OpenAI-compatible Tool Use API. Supports automatic function invocation, parallel execution, and Strict mode for strict JSON Schema adherence.
What is Context Caching?
Cache large reusable contexts (system prompts + documents) to cut input token pricing by 75%. Hugely effective for RAG and chatbots.
What is Grounding with Google Search?
Available on Pro. Grounds responses on live Google Search results. Priced at $35 per 1,000 requests.
How do I configure the Safety Filter?
Four categories (Harassment / Hate Speech / Sexually Explicit / Dangerous Content) each with 4 thresholds (BLOCK_NONE / FEW / SOME / MOST). The default is SOME.
Related Articles & Gen AI
Vertex AI Fundamentals for GCP Certs (2026)
Vertex AI basics every cert candidate needs — Workbench, Pipelines, Model Garden, Endpoints.
Vertex AI Agent Builder Detailed Guide (2026)
Agent Builder — Conversational Agents, Agent Engine, data stores. The agent platform on GCP.
Vertex AI vs SageMaker vs Azure ML (2026)
Three managed ML platforms compared — feature parity, training/serving, MLOps maturity.
Gemini vs GPT vs Claude: LLM Comparison for Builders (2026)
Honest LLM comparison — Gemini, OpenAI GPT, Anthropic Claude. Capability, cost, ergonomics in 2026.
* Google and Gemini are trademarks of Google LLC. For the latest information, see the Vertex AI Gen AI official docs.
Practice with certification-focused question sets
View GCP Exam PrepNicheeLab Editorial Team
NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.
Google Cloud Certification Roadmap (2026)
Choose your GCP certification path — Foundational, Associate...
CDL Cloud Digital Leader: Complete Exam Guide (2026)
Pass the Cloud Digital Leader exam — cloud business value, G...
GAIL Generative AI Leader: Complete Exam Guide (2026)
Pass the Generative AI Leader exam — Gemini, Vertex AI, Work...
Vertex AI Fundamentals for GCP Certs (2026)
Vertex AI basics every cert candidate needs — Workbench, Pip...
Associate Cloud Engineer (ACE): Complete Guide (2026)
Pass the Associate Cloud Engineer exam — Console, gcloud, pr...