gemini-3-pro-api
Gemini 3 Pro APIを使って、テキスト生成や高度な推論、チャットボット開発などをスムーズに行えるように、設定から認証、本番環境への導入までをサポートするSkill。
📜 元の英語説明(参考)
Gemini 3 Pro API/SDK integration for text generation, reasoning, and chat. Covers setup, authentication, thinking levels, streaming, and production deployment. Use when working with Gemini 3 Pro API, Python SDK, Node.js SDK, text generation, chat applications, or advanced reasoning tasks.
🇯🇵 日本人クリエイター向け解説
Gemini 3 Pro APIを使って、テキスト生成や高度な推論、チャットボット開発などをスムーズに行えるように、設定から認証、本番環境への導入までをサポートするSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o gemini-3-pro-api.zip https://jpskill.com/download/9429.zip && unzip -o gemini-3-pro-api.zip && rm gemini-3-pro-api.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/9429.zip -OutFile "$d\gemini-3-pro-api.zip"; Expand-Archive "$d\gemini-3-pro-api.zip" -DestinationPath $d -Force; ri "$d\gemini-3-pro-api.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
gemini-3-pro-api.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
gemini-3-pro-apiフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Gemini 3 Pro API 統合
Google の Gemini 3 Pro API/SDK をアプリケーションに統合するための包括的なガイドです。セットアップ、認証、テキスト生成、動的思考による高度な推論、チャットアプリケーション、ストリーミング応答、および本番環境へのデプロイメントパターンについて説明します。
概要
Gemini 3 Pro (gemini-3-pro-preview) は、高度な推論と幅広い世界知識を必要とする複雑なタスク向けに設計された、Google の最もインテリジェントなモデルです。このスキルは、Python または Node.js SDK を使用した API 統合のための完全なワークフローを提供します。
主な機能
- 大規模なコンテキスト: 100 万トークンの入力、64,000 トークンの出力
- 動的思考: 高/低モードによる適応的な推論
- ストリーミング: リアルタイムなトークン配信
- チャット: 履歴付きの複数ターンの会話
- 本番環境対応: エラー処理、再試行ロジック、コスト最適化
このスキルを使用する場面
- Gemini 3 Pro API アクセスのセットアップ
- テキスト生成アプリケーションの構築
- 推論を用いたチャットアプリケーションの実装
- 高度な思考モードの設定
- 本番環境への Gemini アプリケーションのデプロイ
- API の使用量とコストの最適化
クイックスタート
前提条件
- API キー: Google AI Studio から取得
- Python 3.9+ または Node.js 18+
Python クイックスタート
# SDK のインストール
pip install google-genai
# 基本的な使い方
import google.generativeai as genai
genai.configure(api_key="YOUR_API_KEY")
model = genai.GenerativeModel("gemini-3-pro-preview")
response = model.generate_content("Explain quantum computing")
print(response.text)
Node.js クイックスタート
// SDK のインストール
npm install @google/generative-ai
// 基本的な使い方
import { GoogleGenerativeAI } from "@google/generative-ai";
const genAI = new GoogleGenerativeAI("YOUR_API_KEY");
const model = genAI.getGenerativeModel({ model: "gemini-3-pro-preview" });
const result = await model.generateContent("Explain quantum computing");
console.log(result.response.text());
コアワークフロー
ワークフロー 1: クイックスタートセットアップ
目標: ゼロから最初の API 呼び出し成功までを 5 分未満で達成する。
手順:
-
API キーの取得
- Google AI Studio にアクセス
- プロジェクトを作成または選択
- API キーを生成
- キーを安全にコピー
-
SDK のインストール
# Python pip install google-genai # Node.js npm install @google/generative-ai -
認証の設定
# Python - 環境変数を使用 (推奨) import os import google.generativeai as genai genai.configure(api_key=os.getenv("GEMINI_API_KEY"))// Node.js - 環境変数を使用 (推奨) const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY); -
最初の API 呼び出し
# Python model = genai.GenerativeModel("gemini-3-pro-preview") response = model.generate_content("Write a haiku about coding") print(response.text) -
成功の確認
- 応答が受信されたか確認
- テキスト出力の検証
- トークン使用量の記録
- API キーが動作しているか確認
期待される結果: 5 分未満で API 統合が動作すること。
ワークフロー 2: チャットアプリケーションの開発
目標: 会話履歴とストリーミングを備えた、本番環境対応のチャットアプリケーションを構築する。
手順:
-
チャットモデルの初期化
# Python model = genai.GenerativeModel( "gemini-3-pro-preview", generation_config={ "thinking_level": "high", # 動的推論 "temperature": 1.0, # 最良の結果を得るには 1.0 に保つ "max_output_tokens": 8192 } ) -
チャットセッションの開始
chat = model.start_chat(history=[]) -
ストリーミングによるメッセージの送信
response = chat.send_message( "Explain how neural networks learn", stream=True ) # トークンをリアルタイムでストリーミング for chunk in response: print(chunk.text, end="", flush=True) -
会話履歴の管理
# 履歴は自動的に維持されます # いつでもアクセスできます print(f"Conversation turns: {len(chat.history)}") # 会話を続ける response = chat.send_message("Can you give an example?") -
思考署名の処理
- SDK は標準的なチャットフローで自動的に処理します
- 基本的な使用では手動での介入は不要です
- 高度なケースについては
references/thought-signatures.mdを参照してください
-
エラー処理の実装
import time from google.api_core import retry, exceptions @retry.Retry(predicate=retry.if_exception_type( exceptions.ResourceExhausted, exceptions.ServiceUnavailable )) def send_with_retry(chat, message): return chat.send_message(message) try: response = send_with_retry(chat, user_input) except exceptions.GoogleAPIError as e: print(f"API error: {e}")
期待される結果: ストリーミング、履歴、およびエラー処理を備えた、本番環境対応のチャットアプリケーション。
ワークフロー 3: 本番環境へのデプロイメント
目標: 監視、コスト管理、および信頼性を備えた Gemini 3 Pro 統合をデプロイする。
手順:
-
認証のセットアップ (本番環境)
# 環境変数を使用 (キーをハードコードしないでください) import os from pathlib import Path # オプション 1: 環境変数 api_key = os.getenv("GEMINI_API_KEY") # オプション 2: シークレットマネージャー (本番環境に推奨) # Google Secret Manager、AWS Secrets Manager などを使用します -
本番環境設定の構成
model = genai.GenerativeModel( "gemini-3-pro-preview", generation_config={ "thinking_level": "high", # または単純なタスクの場合は "low" "temperature": 1.0, # 重要: 1.0 に保つ "max_output_tokens": 4096, "top_p": 0.95, "top_k": 40 }, safety_settings={ # 必要に応じてコンテンツフィルタリングを設定します } )
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Gemini 3 Pro API Integration
Comprehensive guide for integrating Google's Gemini 3 Pro API/SDK into your applications. Covers setup, authentication, text generation, advanced reasoning with dynamic thinking, chat applications, streaming responses, and production deployment patterns.
Overview
Gemini 3 Pro (gemini-3-pro-preview) is Google's most intelligent model designed for complex tasks requiring advanced reasoning and broad world knowledge. This skill provides complete workflows for API integration using Python or Node.js SDKs.
Key Capabilities
- Massive Context: 1M token input, 64k token output
- Dynamic Thinking: Adaptive reasoning with high/low modes
- Streaming: Real-time token delivery
- Chat: Multi-turn conversations with history
- Production-Ready: Error handling, retry logic, cost optimization
When to Use This Skill
- Setting up Gemini 3 Pro API access
- Building text generation applications
- Implementing chat applications with reasoning
- Configuring advanced thinking modes
- Deploying production Gemini applications
- Optimizing API usage and costs
Quick Start
Prerequisites
- API Key: Get from Google AI Studio
- Python 3.9+ or Node.js 18+
Python Quick Start
# Install SDK
pip install google-genai
# Basic usage
import google.generativeai as genai
genai.configure(api_key="YOUR_API_KEY")
model = genai.GenerativeModel("gemini-3-pro-preview")
response = model.generate_content("Explain quantum computing")
print(response.text)
Node.js Quick Start
// Install SDK
npm install @google/generative-ai
// Basic usage
import { GoogleGenerativeAI } from "@google/generative-ai";
const genAI = new GoogleGenerativeAI("YOUR_API_KEY");
const model = genAI.getGenerativeModel({ model: "gemini-3-pro-preview" });
const result = await model.generateContent("Explain quantum computing");
console.log(result.response.text());
Core Workflows
Workflow 1: Quick Start Setup
Goal: Get from zero to first successful API call in < 5 minutes.
Steps:
-
Get API Key
- Visit Google AI Studio
- Create or select project
- Generate API key
- Copy key securely
-
Install SDK
# Python pip install google-genai # Node.js npm install @google/generative-ai -
Configure Authentication
# Python - using environment variable (recommended) import os import google.generativeai as genai genai.configure(api_key=os.getenv("GEMINI_API_KEY"))// Node.js - using environment variable (recommended) const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY); -
Make First API Call
# Python model = genai.GenerativeModel("gemini-3-pro-preview") response = model.generate_content("Write a haiku about coding") print(response.text) -
Verify Success
- Check response received
- Verify text output
- Note token usage
- Confirm API key working
Expected Outcome: Working API integration in under 5 minutes.
Workflow 2: Chat Application Development
Goal: Build a production-ready chat application with conversation history and streaming.
Steps:
-
Initialize Chat Model
# Python model = genai.GenerativeModel( "gemini-3-pro-preview", generation_config={ "thinking_level": "high", # Dynamic reasoning "temperature": 1.0, # Keep at 1.0 for best results "max_output_tokens": 8192 } ) -
Start Chat Session
chat = model.start_chat(history=[]) -
Send Message with Streaming
response = chat.send_message( "Explain how neural networks learn", stream=True ) # Stream tokens in real-time for chunk in response: print(chunk.text, end="", flush=True) -
Manage Conversation History
# History is automatically maintained # Access it anytime print(f"Conversation turns: {len(chat.history)}") # Continue conversation response = chat.send_message("Can you give an example?") -
Handle Thought Signatures
- SDKs handle automatically in standard chat flows
- No manual intervention needed for basic use
- See
references/thought-signatures.mdfor advanced cases
-
Implement Error Handling
import time from google.api_core import retry, exceptions @retry.Retry(predicate=retry.if_exception_type( exceptions.ResourceExhausted, exceptions.ServiceUnavailable )) def send_with_retry(chat, message): return chat.send_message(message) try: response = send_with_retry(chat, user_input) except exceptions.GoogleAPIError as e: print(f"API error: {e}")
Expected Outcome: Production-ready chat application with streaming, history, and error handling.
Workflow 3: Production Deployment
Goal: Deploy Gemini 3 Pro integration with monitoring, cost control, and reliability.
Steps:
-
Setup Authentication (Production)
# Use environment variables (never hardcode keys) import os from pathlib import Path # Option 1: Environment variable api_key = os.getenv("GEMINI_API_KEY") # Option 2: Secrets manager (recommended for production) # Use Google Secret Manager, AWS Secrets Manager, etc. -
Configure Production Settings
model = genai.GenerativeModel( "gemini-3-pro-preview", generation_config={ "thinking_level": "high", # or "low" for simple tasks "temperature": 1.0, # CRITICAL: Keep at 1.0 "max_output_tokens": 4096, "top_p": 0.95, "top_k": 40 }, safety_settings={ # Configure content filtering as needed } ) -
Implement Comprehensive Error Handling
from google.api_core import exceptions, retry import logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) def generate_with_fallback(prompt, max_retries=3): @retry.Retry( predicate=retry.if_exception_type( exceptions.ResourceExhausted, exceptions.ServiceUnavailable, exceptions.DeadlineExceeded ), initial=1.0, maximum=10.0, multiplier=2.0, deadline=60.0 ) def _generate(): return model.generate_content(prompt) try: return _generate() except exceptions.InvalidArgument as e: logger.error(f"Invalid argument: {e}") raise except exceptions.PermissionDenied as e: logger.error(f"Permission denied: {e}") raise except Exception as e: logger.error(f"Unexpected error: {e}") # Fallback to simpler model or cached response return None -
Monitor Usage and Costs
def log_usage(response): usage = response.usage_metadata logger.info(f"Tokens - Input: {usage.prompt_token_count}, " f"Output: {usage.candidates_token_count}, " f"Total: {usage.total_token_count}") # Estimate cost (for prompts ≤200k tokens) input_cost = (usage.prompt_token_count / 1_000_000) * 2.00 output_cost = (usage.candidates_token_count / 1_000_000) * 12.00 total_cost = input_cost + output_cost logger.info(f"Estimated cost: ${total_cost:.6f}") response = model.generate_content(prompt) log_usage(response) -
Implement Rate Limiting
import time from collections import deque class RateLimiter: def __init__(self, max_requests_per_minute=60): self.max_rpm = max_requests_per_minute self.requests = deque() def wait_if_needed(self): now = time.time() # Remove requests older than 1 minute while self.requests and self.requests[0] < now - 60: self.requests.popleft() # Check if at limit if len(self.requests) >= self.max_rpm: sleep_time = 60 - (now - self.requests[0]) if sleep_time > 0: time.sleep(sleep_time) self.requests.append(now) limiter = RateLimiter(max_requests_per_minute=60) def generate_with_rate_limit(prompt): limiter.wait_if_needed() return model.generate_content(prompt) -
Setup Logging and Monitoring
import logging from datetime import datetime # Configure logging logging.basicConfig( level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', handlers=[ logging.FileHandler('gemini_api.log'), logging.StreamHandler() ] ) logger = logging.getLogger(__name__) def monitored_generate(prompt): start_time = datetime.now() try: response = model.generate_content(prompt) duration = (datetime.now() - start_time).total_seconds() logger.info(f"Success - Duration: {duration}s, " f"Tokens: {response.usage_metadata.total_token_count}") return response except Exception as e: duration = (datetime.now() - start_time).total_seconds() logger.error(f"Failed - Duration: {duration}s, Error: {e}") raise
Expected Outcome: Production-ready deployment with monitoring, cost control, error handling, and rate limiting.
Thinking Levels
Dynamic Thinking System
Gemini 3 Pro introduces thinking_level to control reasoning depth:
thinking_level: "high" (default)
- Maximum reasoning depth
- Best quality for complex tasks
- Slower first-token response
- Higher cost
- Use for: Complex reasoning, coding, analysis, research
thinking_level: "low"
- Minimal reasoning overhead
- Faster response
- Lower cost
- Simpler output
- Use for: Simple questions, factual answers, quick queries
Configuration
# Python
model = genai.GenerativeModel(
"gemini-3-pro-preview",
generation_config={
"thinking_level": "high" # or "low"
}
)
// Node.js
const model = genAI.getGenerativeModel({
model: "gemini-3-pro-preview",
generationConfig: {
thinking_level: "high" // or "low"
}
});
Critical Notes
⚠️ Temperature MUST stay at 1.0 - Changing temperature can cause looping or degraded performance on complex reasoning tasks.
⚠️ Cannot combine thinking_level with legacy thinking_budget parameter.
See references/thinking-levels.md for detailed guide.
Streaming Responses
Python Streaming
response = model.generate_content(
"Write a long article about AI",
stream=True
)
for chunk in response:
print(chunk.text, end="", flush=True)
Node.js Streaming
const result = await model.generateContentStream("Write a long article about AI");
for await (const chunk of result.stream) {
process.stdout.write(chunk.text());
}
Benefits
- Lower perceived latency
- Real-time user feedback
- Better UX for long responses
- Can process tokens as they arrive
See references/streaming.md for advanced patterns.
Cost Optimization
Pricing (Gemini 3 Pro)
| Context Size | Input | Output |
|---|---|---|
| ≤ 200k tokens | $2/1M | $12/1M |
| > 200k tokens | $4/1M | $18/1M |
Optimization Strategies
- Keep prompts under 200k tokens (50% cheaper)
- Use
thinking_level: "low"for simple tasks (faster, lower cost) - Implement context caching for reusable contexts (see
gemini-3-advancedskill) - Monitor token usage and set budgets
- Use Gemini 1.5 Flash for simple tasks (20x cheaper)
See references/best-practices.md for comprehensive cost optimization.
Model Selection
Gemini 3 Pro vs Other Models
| Model | Context | Output | Input Price | Best For |
|---|---|---|---|---|
| gemini-3-pro-preview | 1M | 64k | $2-4/1M | Complex reasoning, coding |
| gemini-1.5-pro | 1M | 8k | $7-14/1M | General use, multimodal |
| gemini-1.5-flash | 1M | 8k | $0.35-0.70/1M | Simple tasks, cost-sensitive |
When to Use Gemini 3 Pro
✅ Complex reasoning tasks ✅ Advanced coding problems ✅ Long-context analysis (up to 1M tokens) ✅ Large output requirements (up to 64k tokens) ✅ Tasks requiring dynamic thinking
When to Use Alternatives
- Gemini 1.5 Flash: Simple tasks, cost-sensitive applications
- Gemini 1.5 Pro: Multimodal tasks, general use
- Gemini 2.5 models: Experimental features, specific capabilities
Error Handling
Common Errors
| Error | Cause | Solution |
|---|---|---|
ResourceExhausted |
Rate limit exceeded | Implement retry with backoff |
InvalidArgument |
Invalid parameters | Validate input, check docs |
PermissionDenied |
Invalid API key | Check authentication |
DeadlineExceeded |
Request timeout | Reduce context, retry |
Production Error Handling
from google.api_core import exceptions, retry
@retry.Retry(
predicate=retry.if_exception_type(
exceptions.ResourceExhausted,
exceptions.ServiceUnavailable
),
initial=1.0,
maximum=60.0,
multiplier=2.0
)
def safe_generate(prompt):
try:
return model.generate_content(prompt)
except exceptions.InvalidArgument as e:
logger.error(f"Invalid argument: {e}")
raise
except exceptions.PermissionDenied as e:
logger.error(f"Permission denied - check API key: {e}")
raise
except Exception as e:
logger.error(f"Unexpected error: {e}")
raise
See references/error-handling.md for comprehensive patterns.
References
Setup & Configuration
- Setup Guide - Installation, authentication, configuration
- Best Practices - Optimization, cost control, tips
Features
- Text Generation - Detailed text generation patterns
- Chat Patterns - Chat conversation management
- Thinking Levels - Dynamic thinking system guide
- Streaming - Streaming response patterns
Production
- Error Handling - Error handling and retry strategies
Official Resources
Next Steps
After Basic Setup
- Explore chat applications - Build conversational interfaces
- Add multimodal capabilities - Use
gemini-3-multimodalskill - Add image generation - Use
gemini-3-image-generationskill - Add advanced features - Use
gemini-3-advancedskill (caching, tools, batch)
Common Integration Patterns
- Simple Chatbot: This skill only
- Multimodal Assistant: This skill +
gemini-3-multimodal - Creative Bot: This skill +
gemini-3-image-generation - Production App: All 4 Gemini 3 skills
Troubleshooting
Issue: API key not working
Solution: Verify API key in Google AI Studio, check environment variable
Issue: Rate limit errors
Solution: Implement rate limiting, upgrade to paid tier, reduce request frequency
Issue: Slow responses
Solution: Use thinking_level: "low" for simple tasks, enable streaming, reduce context size
Issue: High costs
Solution: Keep prompts under 200k tokens, use appropriate thinking level, consider Gemini 1.5 Flash for simple tasks
Issue: Temperature warnings
Solution: Keep temperature at 1.0 (default) - do not modify for complex reasoning tasks
Summary
This skill provides everything needed to integrate Gemini 3 Pro API into your applications:
✅ Quick setup (< 5 minutes) ✅ Production-ready chat applications ✅ Dynamic thinking configuration ✅ Streaming responses ✅ Error handling and retry logic ✅ Cost optimization strategies ✅ Monitoring and logging patterns
For multimodal, image generation, and advanced features, see the companion skills.
Ready to build? Start with Workflow 1: Quick Start Setup above!