Gemini 3.8 Flash(gemini-3.8-flash)は一般提供(GA)されており、本番環境で使用できます。Google 史上最もインテリジェントな 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)でご利用いただけます。詳細については、料金をご覧ください。 | Google 史上最もインテリジェントな 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 params =
CreateModelInteraction.builder()
.model(Model.of("gemini-3.8-flash"))
.input(
InteractionsInput.of(
"Write a three.js script that renders a realistic 3D black hole."))
.build();
Interaction interaction =
client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();
System.out.println(interaction.outputText().orElse(""));
Go
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/interactions"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
res, err := client.Interactions.Create(ctx, operations.CreateInteractionRequest{
Body: operations.NewCreateInteractionRequestBody(interactions.CreateModelInteraction{
Model: interactions.Model("gemini-3.8-flash"),
Input: interactions.NewInteractionsInput("Write a three.js script that renders a realistic 3D black hole."),
}),
})
if err != nil {
log.Fatal(err)
}
if res.Interaction.OutputText != nil {
fmt.Println(*res.Interaction.OutputText)
}
}
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 のお試し料金でご利用いただけます。入力トークン 100 万個あたり $1.50、出力トークン 100 万個あたり $7.50 の標準料金は、2027 年 1 月 1 日から適用されます。
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.GenerationConfig;
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.interactions.ThinkingLevel;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
Client client = new Client();
CreateModelInteraction params =
CreateModelInteraction.builder()
.model(Model.of("gemini-3.8-flash"))
.input(
InteractionsInput.of(
"Analyze this payment processing pipeline for race conditions during retry attempts and rewrite the transaction locks safely."))
.generationConfig(
GenerationConfig.builder()
.thinkingLevel(ThinkingLevel.MEDIUM) // Balanced reasoning effort for complex tasks
.build())
.build();
Interaction interaction =
client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();
System.out.println(interaction.outputText().orElse(""));
Go
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/interactions"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
res, err := client.Interactions.Create(ctx, operations.CreateInteractionRequest{
Body: operations.NewCreateInteractionRequestBody(interactions.CreateModelInteraction{
Model: interactions.Model("gemini-3.8-flash"),
Input: interactions.NewInteractionsInput("Analyze this payment processing pipeline for race conditions during retry attempts and rewrite the transaction locks safely."),
GenerationConfig: &interactions.GenerationConfig{
ThinkingLevel: interactions.ThinkingLevelMedium.ToPointer(), // Balanced reasoning effort for complex tasks
},
}),
})
if err != nil {
log.Fatal(err)
}
if res.Interaction.OutputText != nil {
fmt.Println(*res.Interaction.OutputText)
}
}
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-09-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-09-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.AgentOption;
import com.google.genai.gaos.models.interactions.CreateAgentInteraction;
import com.google.genai.gaos.models.interactions.CreateAgentInteractionEnvironment;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
Client client = new Client();
CreateAgentInteraction params =
CreateAgentInteraction.builder()
.agent(AgentOption.of("antigravity-preview-09-2026"))
.input(
InteractionsInput.of(
"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(CreateAgentInteractionEnvironment.of("remote"))
.build();
Interaction interaction =
client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();
System.out.println(interaction.outputText().orElse(""));
Go
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/interactions"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
res, err := client.Interactions.Create(ctx, operations.CreateInteractionRequest{
Body: operations.NewCreateInteractionRequestBody(interactions.CreateAgentInteraction{
Agent: interactions.AgentOption("antigravity-preview-09-2026"),
Input: interactions.NewInteractionsInput(
"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: genai.Ptr(interactions.NewCreateAgentInteractionEnvironment("remote")),
}),
})
if err != nil {
log.Fatal(err)
}
if res.Interaction.OutputText != nil {
fmt.Println(*res.Interaction.OutputText)
}
}
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-09-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に置き換えます。minimalは 3.8 Flash ではサポートされていません。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 の場合、2026 年 12 月 31 日まで Google AI Studio と Gemini Enterprise Agent Platform で導入価格をご利用いただけます。標準料金は 2027 年 1 月 1 日から適用されます。料金プランの詳細については、料金ページをご覧ください。
次のステップ
- モデルの概要で API 仕様を確認します。
- マルチ エージェントのオーケストレーションについては、Interactions API の概要をご覧ください。
- Google AI Studio でプロンプトをテストして調整する。