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("日本の首都は?")
print(response.text)
# Multimodal (image + text)
image = Part.from_uri("gs://my-bucket/photo.jpg", mime_type="image/jpeg")
response = model.generate_content([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(
"東京の天気は?", tools=tools
)from vertexai.preview import caching
from datetime import datetime, timedelta
# システムプロンプト + 長文ドキュメントを Cache
cached_content = caching.CachedContent.create(
model_name="gemini-2.0-pro-001",
system_instruction="あなたは社内 FAQ ボットです",
contents=[long_document],
ttl=timedelta(hours=1),
)
# Cache 利用 (入力 75% 割引)
model = GenerativeModel.from_cached_content(cached_content)
response = model.generate_content("休暇申請の方法は?")| 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 入門|Google Cloud 統合 ML プラットフォームの全機能 (GAIL/PMLE/PCD 必須知識)
Google Cloud Vertex AI の入門解説。Vertex AI Studio / Agent Builder / Model Garden / Search / Pipelines / Training の全機能、Gemini モデルファミリー (Pro/Flash/Ultra)、Azure OpenAI との比較、料金体系、Responsible AI 機能を日本語で整理。
Vertex AI Agent Builder 完全ガイド|Conversational Agents・Vertex AI Search・Tool Use (GCP)
Google Cloud Vertex AI Agent Builder の全機能解説。Conversational Agents (Dialogflow CX 後継)、Vertex AI Search、Tool Use、Grounding、Playbook、料金、ChatGPT GPTs / Copilot Studio 比較を網羅。
Vertex AI vs SageMaker vs Azure ML 徹底比較|MLOps プラットフォーム選び方 (2026)
Google Vertex AI / AWS SageMaker / Azure ML の徹底比較。Gen AI 統合 (Gemini / Bedrock / Azure OpenAI)、AutoML、Pipelines、Feature Store、GPU/TPU、料金、認定試験を 2026 年最新版で網羅。
Gemini vs GPT-4 vs Claude vs Llama 徹底比較|LLM API 選び方・料金 (2026)
Google Gemini 2.0 / OpenAI GPT-4o / Anthropic Claude Opus 4 / Meta Llama 3.3 の徹底比較。性能 / コード / 推論 / マルチモーダル / 料金 / コンテキスト長 / GCP・AWS・Azure 経由利用を 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...