Gemini 3.8 Flash(gemini-3.8-flash)は一般提供(GA)されており、本番環境で使用できます。これは、長期的なソフトウェア エンジニアリング、自律型エージェント、複雑なエンタープライズ ワークフロー向けに設計された、最もインテリジェントな Flash モデルです。
このガイドでは、Gemini 3.8 Flash の新機能、API の変更、コード例、移行ガイダンスについて説明します。
新しいモデル
| モデル | モデル ID | デフォルトの思考レベル | 料金 | 説明 |
|---|---|---|---|---|
| Gemini 3.8 Flash | gemini-3.8-flash |
medium |
3.8 Flash は、年末まで、100 万入力トークンあたり $0.75、100 万出力トークンあたり $3.75 のお試し価格でご利用いただけます。詳細については、料金をご覧ください。 | 長期的なソフトウェア エンジニアリング、自律型エージェント、複雑なエンタープライズ ワークフロー向けに設計された、最もインテリジェントな Flash モデルです。 |
Gemini 3.8 Flash は、100 万トークンのコンテキスト ウィンドウ、最大 64,000 個の出力トークン、調整可能な思考レベル(low、medium、high)、および包括的な組み込みツール スイートをサポートしています。
完全な仕様については、Gemini 3.8 Flash モデルのページをご覧ください。特別価格の詳細については、以下の料金セクションまたは料金ページをご覧ください。
クイックスタート
Python
from google import genai
client = genai.Client()
interaction = client.interactions.create(
model="gemini-3.8-flash",
input="Write a three.js script that renders a realistic 3D black hole."
)
print(interaction.output_text)
JavaScript
import { GoogleGenAI } from "@google/genai";
const client = new GoogleGenAI({});
const interaction = await client.interactions.create({
model: "gemini-3.8-flash",
input: "Write a three.js script that renders a realistic 3D black hole.",
});
console.log(interaction.output_text);
Java
import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.CreateModelInteraction;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Model;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
Client client = new Client();
CreateModelInteraction req = CreateModelInteraction.builder()
.model(Model.of("gemini-3.8-flash"))
.input(InteractionsInput.of("Hello world"))
.build();
Interaction interaction =
client.interactions.create(CreateInteractionRequestBody.of(req)).interaction().get();
System.out.println(interaction.outputText().orElse(""));
REST
curl "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H 'Content-Type: application/json' \
-X POST \
-d '{
"model": "gemini-3.8-flash",
"input": "Write a three.js script that renders a realistic 3D black hole."
}'
Gemini 3.8 Flash の新機能
- 長期的なソフトウェア エンジニアリング: 実際のコーディング ベンチマーク、複雑なマルチファイル リファクタリング、決定論的なツール実行で優れた結果が得られます。詳細については、評価方法をご覧ください。
- 自律型エージェント: 復元力のあるマルチステップ プランニングとツール オーケストレーション ワークフローを構築できるため、失敗したループとエラーが大幅に減少します。
- 複雑なエンタープライズ ワークフロー: 要求の厳しいドメイン タスクと大規模なデータ パイプライン全体で、優れた精度、深い推論、高い事実の厳密さを実現します。
- Managed Agents のデフォルト モデル: Managed Agents のデフォルト エージェントである Antigravity エージェントで Gemini 3.8 Flash が使用されるようになりました。Antigravity SDK でも、デフォルトで Gemini 3.8 Flash が使用されます。
- 特別価格: Gemini 3.8 Flash は、2026 年 12 月 31 日まで、100 万入力トークンあたり $0.75、100 万出力トークンあたり $3.75 の特別価格でご利用いただけます。2027 年 1 月 1 日より、100 万入力トークンあたり $1.50、100 万出力トークンあたり $7.50 の標準料金が適用されます。
Gemini 3.8 Flash は、設計上、実行時間が長く複雑なタスクでより多くのトークンを使用できます。困難なマルチステップの目標で高品質の結果を得るために、モデルは推論ステップを細かく分割し、ツールを反復的に呼び出し、その過程で作業を検証します。すべてのワークフローでこのレベルの検証が必要なわけではありません。日常的なタスクでは、推論の労力を減らしてトークンの消費量を削減できます。Gemini 3.7 Flash は引き続き完全にサポートされています。
推論レベルについて
Gemini 3.8 Flash では、モデルの思考レベルを調整することで、レイテンシとインテリジェンスを柔軟に制御できます。
- 思考労力が少ない: インシデント対応パイプライン、リアルタイム チャット、下書きの作成、高速データ分析など、レイテンシが重要なタスクの回答までの時間を短縮します。
- 中(デフォルト): ほとんどのタスクで最高の品質が得られます。複雑なコードやエージェントのユースケースにおすすめです。初回パスの精度が高くなります。
- 思考労力: モデルの推論能力とツール オーケストレーション機能を最大限に活用します。深い推論、数学、難しいマルチステップ タスクに最適です。
次の例では、複雑なコード分析リクエストの thinking_level を medium に設定します。
Python
from google import genai
client = genai.Client()
interaction = client.interactions.create(
model="gemini-3.8-flash",
input="Analyze this payment processing pipeline for race conditions during retry attempts and rewrite the transaction locks safely.",
generation_config={
"thinking_level": "medium" # Balanced reasoning effort for complex tasks
}
)
print(interaction.output_text)
JavaScript
import { GoogleGenAI } from "@google/genai";
const client = new GoogleGenAI({});
const interaction = await client.interactions.create({
model: "gemini-3.8-flash",
input: "Analyze this payment processing pipeline for race conditions during retry attempts and rewrite the transaction locks safely.",
generation_config: {
thinking_level: "medium"
}
});
console.log(interaction.output_text);
Java
import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.CreateModelInteraction;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Model;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
Client client = new Client();
CreateModelInteraction req = CreateModelInteraction.builder()
.model(Model.of("gemini-3.8-flash"))
.input(InteractionsInput.of("Hello world"))
.build();
Interaction interaction =
client.interactions.create(CreateInteractionRequestBody.of(req)).interaction().get();
System.out.println(interaction.outputText().orElse(""));
REST
curl "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H 'Content-Type: application/json' \
-X POST \
-d '{
"model": "gemini-3.8-flash",
"input": "Analyze this payment processing pipeline for race conditions during retry attempts and rewrite the transaction locks safely.",
"generation_config": {
"thinking_level": "medium"
}
}'
更新された Antigravity エージェント
パフォーマンスと推論が改善されたため、Gemini Managed Agents の Antigravity エージェントは、デフォルトで Gemini 3.8 Flash で構築されるようになりました。
Python
from google import genai
client = genai.Client()
interaction = client.interactions.create(
agent="antigravity-preview-05-2026",
input=(
"Audit https://web.dev for performance, Core Web Vitals, and SEO. "
"Query Google's PageSpeed Insights API for both Mobile and Desktop strategies. "
"Check search indexing with Google Search for site:web.dev. "
"Format the output as a side-by-side scorecard table with prioritized fixes."
),
environment="remote",
)
print(interaction.output_text)
JavaScript
import { GoogleGenAI } from "@google/genai";
const client = new GoogleGenAI({});
const interaction = await client.interactions.create({
agent: "antigravity-preview-05-2026",
input: "Audit https://web.dev for performance, Core Web Vitals, and SEO. Query Google's PageSpeed Insights API for both Mobile and Desktop strategies. Check search indexing with Google Search for site:web.dev. Format the output as a side-by-side scorecard table with prioritized fixes.",
environment: "remote",
}, { timeout: 300000 });
console.log(interaction.output_text);
Java
import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.CreateModelInteraction;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Model;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
Client client = new Client();
CreateModelInteraction req = CreateModelInteraction.builder()
.model(Model.of("gemini-3.8-flash"))
.input(InteractionsInput.of("Hello world"))
.build();
Interaction interaction =
client.interactions.create(CreateInteractionRequestBody.of(req)).interaction().get();
System.out.println(interaction.outputText().orElse(""));
REST
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-d '{
"agent": "antigravity-preview-05-2026",
"input": "Audit https://web.dev for performance, Core Web Vitals, and SEO. Query Google'\''s PageSpeed Insights API for both Mobile and Desktop strategies. Check search indexing with Google Search for site:web.dev. Format the output as a side-by-side scorecard table with prioritized fixes.",
"environment": "remote"
}'
基盤となる Gemini モデルは、構成できます。agent_config
移行チェックリスト
`/gemini-api-dev migrate my app to Gemini 3.8 Flash`
gemini-3.8-flash に移行する
- モデル ID を更新する: ターゲット モデル文字列を
gemini-3.8-flashに変更します。 - サポートが終了したサンプリング パラメータを削除する:
- 生成構成から
temperature、top_p、top_kを削除します。 thinking_budgetを文字列列挙型thinking_levelに置き換えます。3.8 Flash ではminimalはサポートされていません。candidate_countを削除します(Gemini 3 以降ではサポートされていません)。
- 生成構成から
- ターン検証ルールを適用する:
- サーバーサイド
previous_interaction_idでマルチターンの会話を標準化します。 - 事前入力されたモデルターンを削除します。
- サーバーサイド
- 関数呼び出しを監査する:
- マルチモーダル アセットをレスポンス ペイロード内に配置します。
\n\nを使用してインライン手順の形式を設定します。- ツール前のテキストに関連する
Malformed_Function_Callエラーが表示される場合は、ツール前のテキスト要件の回避策をご覧ください。 - generateContent API を使用する場合のみ: すべての
FunctionResponseオブジェクトにcall_idとnameが含まれていることを確認します。
- Gemini 3 のベースライン要件: SDK の更新と思考シグネチャの保持については、Gemini 3.5 移行チェックリストをご覧ください。
料金
Gemini 3.8 Flash、Gemini 3.7 Flash、Gemini 3.6 Flash の Google AI Studio と Gemini Enterprise Agent Platform で、2026 年 12 月 31 日まで特別価格をご利用いただけます。2027 年 1 月 1 日より、標準料金が適用されます。料金階層の詳細については、料金ページをご覧ください。
次のステップ
- モデルの概要で API 仕様を確認する。
- Interactions API の概要でマルチエージェント オーケストレーションについて確認する。
- Google AI Studio でプロンプトをテストして調整する。