Gemini 3.8 Flash (gemini-3.8-flash) ist allgemein verfügbar und kann in der Produktion eingesetzt werden. Es ist unser intelligentestes Flash-Modell, das für langfristige Softwareentwicklung, autonome KI-Agenten und komplexe Unternehmensworkflows entwickelt wurde.
In diesem Leitfaden werden die Neuerungen in Gemini 3.8 Flash, API-Änderungen, Codebeispiele und Migrationsanleitungen beschrieben.
Neues Modell
| Modell | Modell-ID | Standardmäßiger Denkaufwand | Preise | Beschreibung |
|---|---|---|---|---|
| Gemini 3.8 Flash | gemini-3.8-flash |
medium |
3.8 Flash ist bis zum Jahresende zum Einführungspreis von 0,75 $ pro 1 Million Eingabetokens und 3,75 $ pro 1 Million Ausgabetokens verfügbar. Weitere Informationen finden Sie unter Preise. | Unser intelligentestes Flash-Modell, das für langfristige Softwareentwicklung, autonome KI-Agenten und komplexe Unternehmensworkflows entwickelt wurde. |
Gemini 3.8 Flash unterstützt ein Kontextfenster mit 1 Million Tokens, maximal 64.000 Ausgabetokens, anpassbare Denkebenen (low, medium, high) und dieselbe umfassende Suite integrierter Tools.
Die vollständigen Spezifikationen finden Sie auf der Modellseite für Gemini 3.8 Flash. Details zu Einführungspreisen finden Sie unten im Abschnitt zu Preisen oder auf der Preisseite.
Kurzanleitung
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."
}'
Neues bei Gemini 3.8 Flash
- Softwareentwicklung mit langem Horizont:Erzielt gute Ergebnisse bei realen Coding-Benchmarks, komplexen Refactorings mit mehreren Dateien und der deterministischen Ausführung von Tools. Weitere Informationen finden Sie in der Bewertungsmethodik.
- Autonome Agents:Damit können Sie robuste mehrstufige Planungs- und Tool-Orchestrierungs-Workflows erstellen und so die Anzahl fehlgeschlagener Schleifen und Fehler erheblich reduzieren.
- Komplexe Unternehmensworkflows:Bietet überlegene Genauigkeit, fundierte Argumentation und hohe faktische Strenge bei anspruchsvollen Aufgaben und umfangreichen Datenpipelines.
- Standardmodell für verwaltete KI-Agenten: Der Standard-KI-Agent für verwaltete KI-Agenten, der Antigravity-KI-Agent, verwendet jetzt Gemini 3.8 Flash. Das Antigravity SDK verwendet standardmäßig auch Gemini 3.8 Flash.
- Einführungspreis:Gemini 3.8 Flash ist bis zum 31. Dezember 2026 zum Einführungspreis von 0,75 $ pro 1 Million Eingabetokens und 3,75 $ pro 1 Million Ausgabetokens verfügbar. Die Standardpreise von 1,50 $ pro 1 Million Eingabetokens und 7,50 $ pro 1 Million Ausgabetokens treten am 1. Januar 2027 in Kraft.
Gemini 3.8 Flash kann bei längeren und komplexen Aufgaben mehr Tokens verwenden. Um bei schwierigen, mehrstufigen Zielen Ergebnisse von höherer Qualität zu liefern, führt das Modell kleinere Denkschritte aus, ruft Tools iterativ auf und überprüft seine Arbeit im Laufe des Prozesses. Nicht für jeden Workflow ist diese Art der Bestätigung erforderlich. Bei alltäglichen Aufgaben können Sie den Aufwand für das Reasoning verringern, um den Tokenverbrauch zu reduzieren. Alternativ wird Gemini 3.7 Flash weiterhin vollständig unterstützt.
Schlussfolgerungsniveaus
Mit Gemini 3.8 Flash haben Sie die Möglichkeit, die Latenz und Intelligenz flexibel zu steuern, indem Sie den Denkaufwand des Modells anpassen:
- Geringer Analyseaufwand: Verkürzt die Zeit bis zur Antwort bei latenzkritischen Tasks wie Incident Response Pipelines, Echtzeit-Chats, dem Verfassen von Entwürfen und der schnellen Datenanalyse.
- Mittel (Standard): Beste Qualität für die meisten Aufgaben. Empfohlen für komplexe Code- und Agent-Anwendungsfälle, da die Genauigkeit beim ersten Durchlauf höher ist.
- Hoher Denkaufwand: Maximiert die Fähigkeiten des Modells in Bezug auf Schlussfolgerungen und Tool-Orchestrierung. Optimal für tiefgründige Problemlösung, Mathematik und schwierige mehrstufige Aufgaben.
Im folgenden Beispiel wird für thinking_level der Wert medium für eine komplexe Anfrage zur Codeanalyse festgelegt:
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"
}
}'
Aktualisierter Antigravity-Agent
Aufgrund der verbesserten Leistung und des besseren Schlussfolgerns wird der Antigravity-Agent in Verwaltete KI-Agenten jetzt standardmäßig basierend auf Gemini 3.8 Flash erstellt.
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"
}'
Das zugrunde liegende Gemini-Modell kann mit agent_config konfiguriert werden.
Checkliste für die Migration
`/gemini-api-dev migrate my app to Gemini 3.8 Flash`
Zu „gemini-3.8-flash“ migrieren
- Modell-ID aktualisieren:Ändern Sie den Zielmodellstring in
gemini-3.8-flash. - Verworfene Sampling-Parameter entfernen:
- Entfernen Sie
temperature,top_pundtop_kaus den Generierungskonfigurationen. - Ersetzen Sie
thinking_budgetdurch das String-Enumthinking_level.minimalwird in Flash 3.8 nicht unterstützt. - Entfernen Sie
candidate_count(wird in Gemini 3 und höher nicht unterstützt).
- Entfernen Sie
- Regeln für die Zugvalidierung erzwingen:
- Standardisieren Sie Mehrfachdialoge auf der Serverseite
previous_interaction_id. - Entfernen Sie die vorab ausgefüllten Modell-Turns.
- Standardisieren Sie Mehrfachdialoge auf der Serverseite
- Funktionsaufrufe prüfen:
- Platzieren Sie multimodale Assets in der Antwortnutzlast.
- Inline-Anweisungen mit
\n\nformatieren. - Wenn Sie
Malformed_Function_Call-Fehler im Zusammenhang mit Text vor dem Tool sehen, lesen Sie den Abschnitt Workarounds for pre-tool text requirements (Umgehungslösungen für Anforderungen an Text vor dem Tool). - Nur bei Verwendung der generateContent API: Achten Sie darauf, dass alle
FunctionResponse-Objektecall_idundnameenthalten.
- Gemini 3-Basisanforderungen:Informationen zu SDK-Updates und zur Beibehaltung der Gedanken-Signatur finden Sie in der Checkliste für die Migration zu Gemini 3.5.
Preise
Bis zum 31. Dezember 2026 können Sie die Einführungspreise für Gemini 3.8 Flash, Gemini 3.7 Flash und Gemini 3.6 Flash in Google AI Studio und der Gemini Enterprise Agent Platform nutzen. Die Standardpreise treten am 1. Januar 2027 in Kraft. Eine vollständige Übersicht der Preisstufen finden Sie auf der Preisseite.
Nächste Schritte
- Sehen Sie sich die API-Spezifikationen in der Modellübersicht an.
- Weitere Informationen zur Orchestrierung mehrerer Agenten finden Sie in der Übersicht über die Interactions API.
- Prompts in Google AI Studio testen und optimieren