Google Cloud

Gemini API Complete Guide: Pricing, Model Selection, Multimodal, Function Calling

2026-05-24
NicheeLab Editorial Team

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 Family (2026)

ModelContextInput ($/M tok)Output ($/M tok)Use Case
Gemini 2.0 Flash1M$0.075$0.30Chat / summarization / lightweight tasks
Gemini 2.0 Pro2M$1.25$5.00RAG / code generation / reasoning
Gemini Ultra2MCustomCustomEnterprise advanced reasoning
Gemma 2 (OSS)8kFreeFreeEdge / on-premises

Google AI Studio vs Vertex AI

ItemGoogle AI StudioVertex AI
Use casePersonal / PoCProduction / Enterprise
Free tierGenerous (RPD limited)$300 credit
AuthAPI KeyIAM / Service Account
CMEKYes
VPC SCYes
SLA99.9%
Data UseMay be used for trainingNot used (default)

Key Features

  • Multimodal: text + image + audio + video + PDF
  • Long Context: 1M / 2M tokens
  • Function Calling: Tool Use, parallel execution, Strict mode
  • Code Execution: sandboxed Python execution (Pro)
  • Context Caching: 75% input token discount
  • Grounding with Google Search: cite up-to-date information
  • JSON Mode: enforce structured output
  • Streaming: incremental responses via SSE
  • Batch API: async with 50% discount

Python Sample (Vertex AI SDK)

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
)

Context Caching Pattern

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("休暇申請の方法は?")

Comparison with Other LLM APIs

ItemGemini 2.0 FlashGPT-4o miniClaude Haiku 3.5
Input ($/M tok)$0.075$0.15$0.80
Output ($/M tok)$0.30$0.60$4.00
Context1M128k200k
MultimodalExcellent (incl. video)Yes (image)Yes (image)
ItemGemini 2.0 ProGPT-4oClaude Sonnet 3.5
Input ($/M tok)$1.25$2.50$3.00
Output ($/M tok)$5.00$10.00$15.00
Context2M128k200k

Typical Use Cases

  • RAG (internal document search + answering)
  • Video content analysis and summarization
  • Multimodal OCR + structured extraction
  • Code generation + refactoring
  • Agents (external API integration via Tool Use)
  • Multilingual translation (100+ languages)

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.

Check what you learned with practice questions

Practice with certification-focused question sets

View GCP Exam Prep
Author

NicheeLab Editorial Team

NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.


Related articles
Google Cloud

Google Cloud Certification Roadmap (2026)

Choose your GCP certification path — Foundational, Associate...

Google Cloud

CDL Cloud Digital Leader: Complete Exam Guide (2026)

Pass the Cloud Digital Leader exam — cloud business value, G...

Google Cloud

GAIL Generative AI Leader: Complete Exam Guide (2026)

Pass the Generative AI Leader exam — Gemini, Vertex AI, Work...

Google Cloud

Vertex AI Fundamentals for GCP Certs (2026)

Vertex AI basics every cert candidate needs — Workbench, Pip...

Google Cloud

Associate Cloud Engineer (ACE): Complete Guide (2026)

Pass the Associate Cloud Engineer exam — Console, gcloud, pr...

Browse all Google Cloud articles (103)
© 2026 NicheeLab All rights reserved.