Quick answer: Gemini 3.8 Flash is Google’s new generally available Flash model for coding, autonomous agents and complex workflows. Use the stable model ID gemini-3.8-flash. It accepts text, images, video, audio and PDFs, returns text, supports a 1,048,576-token input window and up to 65,536 output tokens, and exposes low, medium and high thinking levels.[2][3]
Start in 60 seconds
If you already have a Gemini API key, install Google’s current SDK and keep the key in an environment variable rather than hard-coding it:
python -m pip install -U google-genai
export GEMINI_API_KEY="your-api-key"
Then run this minimal Python request:
from google import genai
client = genai.Client()
response = client.models.generate_content(
model="gemini-3.8-flash",
contents="Review this function for correctness, security and edge cases."
)
print(response.text)
Google documents gemini-3.8-flash as a stable ID and says the model is GA and ready for production use.[2][3]
Do not paste a real API key into source code, screenshots or a public repository. Use an environment variable locally and a managed secret store in production.
Gemini 3.8 Flash at a glance
| Item | Official specification |
|---|---|
| Model ID | gemini-3.8-flash |
| Release state | Generally available (GA) |
| Inputs | Text, image, video, audio and PDF |
| Output | Text |
| Input limit | 1,048,576 tokens |
| Output limit | 65,536 tokens |
| Thinking levels | low, medium, high; default is medium |
| Built-in capabilities | Caching, code execution, file search, function calling, Search grounding, Maps grounding, structured output and URL context |
| Preview capability | Computer use |
| Not supported | Image generation, audio generation and Live API |
These specifications come from Google’s live model page and latest-model guide.[2][3]
REST API example you can copy
curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.8-flash:generateContent" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-X POST \
-d '{
"contents": [{
"parts": [{
"text": "Create a launch checklist for a small SaaS product. Return JSON with owner, task and status fields."
}]
}],
"generationConfig": {
"thinkingConfig": {
"thinkingLevel": "medium"
}
}
}'
The endpoint, payload structure and camel-case thinkingLevel field follow Google’s documented REST example.[3]
JavaScript example
Install the SDK:
npm install @google/genai
Create an ES module:
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({});
const response = await ai.models.generateContent({
model: "gemini-3.8-flash",
contents: "Find likely race conditions in this job-queue design and propose tests.",
config: {
thinkingConfig: {
thinkingLevel: "medium"
}
}
});
console.log(response.text);
Google’s guide provides examples for Python, JavaScript and REST, so you do not need a third-party gateway to make a first-party Gemini API request.[3]
Pricing: current rate and 2027 change
Google lists introductory paid pricing through December 31, 2026 at $0.75 per 1 million input tokens and $3.75 per 1 million output tokens, including thinking tokens. The announced standard rate from January 1, 2027 is $1.50 per 1 million input tokens and $7.50 per 1 million output tokens.[1][3]
| Example workload | Through Dec. 31, 2026 | From Jan. 1, 2027 |
|---|---|---|
| 100,000 input + 10,000 output tokens, Standard | $0.1125 | $0.2250 |
| 100,000 input + 10,000 output tokens, Batch | $0.05625 | $0.1125 |
The example is simple token arithmetic and excludes grounding calls, cache storage and any other tool charges. Google’s pricing page says Batch API pricing is 50% below Standard and separately prices tools such as Google Search grounding.[4]
Cost formula
estimated cost =
(input tokens / 1,000,000 × input rate)
+ (output tokens / 1,000,000 × output rate)
+ tool and cache-storage charges, if used
Because 3.8 Flash may take extra reasoning steps and make iterative tool calls on difficult tasks, estimate cost using real production traces—not only the shortest test prompt.[1][3]
Which thinking level should you use?
Low
Use low for latency-sensitive, high-volume or relatively straightforward work: extraction, classification, short transformations and first-pass drafts. Lower effort can reduce token overhead when a task does not need long reasoning.[1][3]
Medium
Use medium as the starting point for coding, analysis and general agent workflows. It is the documented default, so requests that omit the setting use medium effort.[3]
High
Reserve high for difficult multi-step reasoning, complex debugging and tasks where the quality gain is worth extra latency and token use. Test it against medium on your own acceptance set before making it the default.[1][5]
minimal is not supported for Gemini 3.8 Flash and returns an error; valid options are low, medium and high.[2]
Migration checklist from Gemini 3.7 Flash or an older model
- Create a repeatable evaluation set. Include normal requests, long-context prompts, tool calls, structured outputs, refusals and malformed inputs.
- Change only the model ID first: replace the old ID with
gemini-3.8-flash.[2][3] - Replace old thinking-budget logic. Use a string thinking level—
low,mediumorhigh—instead of assuming that a numeric budget will behave the same.[3] - Remove any
minimalvalue. It is invalid for this model.[2] - Run schema and tool-call tests. The model supports function calling and structured output, but your application still needs to validate arguments before executing a tool.[2]
- Measure accepted-output cost. Record input, output and thinking-token use, latency, retries and the percentage of answers that pass your checks.
- Keep a tested fallback. Gemini 3.7 Flash remains supported for efficiency-first workloads, according to Google’s launch post.[1]
- Roll out gradually. Start with internal traffic, then a small production percentage, and increase only after error rate and cost remain within limits.
What changed from Gemini 3.7 Flash?
Google positions 3.8 Flash as an improvement in software engineering, agentic tasks and multi-step professional reasoning while keeping the introductory token price of 3.7 Flash. The design deliberately lets the model take more reasoning steps and call tools repeatedly on hard tasks.[1][3]
That does not mean every 3.7 workload should be migrated immediately. If your task is deterministic extraction or a simple rewrite, a longer reasoning loop may add cost without improving the accepted result. Keep 3.7 as a control and compare both models on your own prompts.
Capabilities that matter in production
Large multimodal context
The API accepts text, images, video, audio and PDF input within a 1,048,576-token input limit. The output is text, with a 65,536-token ceiling.[2]
Built-in tools
Google lists code execution, file search, function calling, Search and Maps grounding, structured outputs and URL context as supported. Computer use is marked Preview, so isolate it and require approval before consequential actions.[2]
Stable model ID
The model page labels gemini-3.8-flash as stable rather than a preview-suffixed release. Pinning the explicit ID is safer for controlled evaluation than relying on a moving latest alias.[2]
Production safety checklist
- Treat model output as untrusted input.
- Validate function names and arguments against an allowlist.
- Require human approval for payments, publishing, deletion, account changes and outbound messages.
- Give tools the minimum permissions needed for the current task.
- Redact secrets and personal data before logging prompts or responses.
- Set token, time and tool-call budgets for every run.
- Add retries with limits; do not create infinite agent loops.
- Test prompt-injection defenses when the model reads websites, email or uploaded documents.
- Keep audit logs for tool calls and state changes.
- Use domain-specific verification for legal, medical, financial and safety-sensitive work.
Google’s model card warns that Gemini 3.8 Flash can hallucinate, may occasionally be slow or time out, and may consume more tokens at higher effort levels.[5]
When not to choose Gemini 3.8 Flash
Choose another route when you specifically need native image generation, native audio generation or the Live API, because the model page marks those capabilities unsupported.[2] A smaller or lower-cost model may also be more economical for simple bulk classification, while a stronger premium model may be justified if it materially improves completion rates on your hardest evaluation set.
Practical evaluation template
Run 30–100 representative tasks through the old and new model with the same tool permissions. Record:
| Metric | Why it matters |
|---|---|
| Acceptance rate | Measures usable results, not attractive demos |
| Human correction time | Captures hidden labor cost |
| Median and p95 latency | Shows normal and worst-case delays |
| Input/output/thinking tokens | Predicts actual spend |
| Tool-call error rate | Finds broken arguments and loops |
| Structured-output validity | Protects downstream automation |
| Safety-policy failures | Prevents risky deployment |
Ship the migration only if the new model improves the metric that matters for the workflow. A benchmark win does not replace application-level testing.
Frequently asked questions
Is Gemini 3.8 Flash generally available?
Yes. Google’s latest-model guide says gemini-3.8-flash is GA and ready for production use.[3]
What is the Gemini 3.8 Flash API model ID?
Use gemini-3.8-flash.[2]
Does Gemini 3.8 Flash have a free tier?
Google’s Gemini API pricing page offers free access for supported models and small projects, but limits and model availability can vary. Check the live pricing and rate-limit pages in your account before promising free production capacity.[4]
What is the default thinking level?
The default is medium. You can explicitly set low, medium or high; minimal is invalid.[2][3]
Can Gemini 3.8 Flash generate images?
No. It can accept images as input, but Google marks image generation as unsupported for this model.[2]
Is Gemini 3.8 Flash Cyber available to everyone?
No. Google says the Cyber variant is available to selected trusted defenders through its Fairwind Program. The standard Gemini 3.8 Flash model is the generally available option discussed in this guide.[1]