Gemini 3.8 Flash vs 3.7 Flash API Upgrade Guide (2026): Same Price, More Tokens, Better Agents

On September 2, 2026, Google DeepMind shipped Gemini 3.8 Flash, its third Flash model in six weeks. The pitch from Raluca Ada Popa, Gemini Security Lead at DeepMind: the best reasoning and coding Flash yet, "at the same speed and low cost of 3.7." It landed alongside Gemini 3.8 Flash Cyber, a vulnerability-hunting variant gated behind the new Fairwind Program.

The same-price claim is true on paper. It's also the part that will quietly wreck a few budgets. Google says, in its own announcement, that 3.8 Flash "works harder" and "might use more tokens to maximize performance, especially at higher effort levels." Identical rate card, bigger token counts. That's the whole upgrade decision in one sentence, and this guide is about making it deliberately instead of by accident.

Key Takeaways

  • Google released Gemini 3.8 Flash and Gemini 3.8 Flash Cyber on September 2, 2026; 3.8 Flash is generally available in the Gemini API, and 3.8 Flash Cyber is limited to Fairwind Program defenders.
  • Gemini 3.8 Flash costs $0.75 per million input tokens and $3.75 per million output tokens (thinking tokens included) through December 31, 2026, the same as Gemini 3.7 Flash; both rise to $1.50 and $7.50 on January 1, 2027.
  • Gemini 3.8 Flash has a 1,048,576-token input limit and a 65,536-token output limit, and accepts text, image, video, audio, and PDF input.
  • Google states Gemini 3.8 Flash may consume more tokens per task than 3.7 Flash, especially at higher effort levels, so per-task cost can rise even though per-token pricing is unchanged.
  • Gemini 3.8 Flash scores 54.9% on HLE-Verified, and Gemini 3.8 Flash Cyber reaches 47.2% pass@1 on CWE-Bench versus 47.8% for a leading frontier model.

What Actually Changed in 3.8 Flash

Google is unusually specific about where the gains are. Three areas:

The mechanism behind all three is the same: the model executes more reasoning steps and calls tools more iteratively before answering. That's a design choice, not a side effect. Google also reports a "significant leap in prompt injection robustness" measured by Gray Swan, which matters more than benchmark deltas if your agent reads untrusted web content.

Interesting detail: the coding and reasoning gains came partly from training in cybersecurity. Chrome's security team found 3.8 Flash Cyber produced 2.6 times more correct vulnerability patches than much larger commercial models, and Wiz measured 7.5 to 9.7 points higher recall on its penetration-testing benchmark at 2.3 to 5.2 times lower cost. You can't get the Cyber variant without Fairwind approval, but the shared core is what you're buying with plain 3.8 Flash.

Pricing: Identical Rate Card, Different Bill

Here's the rate card confirmed from Google's Gemini API pricing page. Every figure is USD per 1 million tokens on the paid tier.

ModelInput (through Dec 31, 2026)Output incl. thinking (through Dec 31, 2026)Cache read / storageBatch / Flex input · outputContext window
Gemini 3.8 Flash$0.75$3.75$0.075 / $0.50 per 1M tokens per hour$0.375 · $1.8751,048,576 in / 65,536 out
Gemini 3.7 Flash$0.75$3.75$0.075 / $0.50 per 1M tokens per hour$0.375 · $1.8751,048,576 in / 65,536 out
Gemini 3.8 Flash (from Jan 1, 2027)$1.50$7.50$0.15 / $1.00 per 1M tokens per hour$0.75 · $3.751,048,576 in / 65,536 out

Two things jump out. First, the introductory pricing has a hard end date. On January 1, 2027 every Gemini 3.x Flash rate doubles. If you're modeling a 2027 budget on today's numbers, stop. Second, the rows for 3.8 and 3.7 are literally identical. So the cost question isn't "which is cheaper per token." It's "which finishes my task in fewer tokens."

Google's honest answer is that 3.8 will often use more. Output tokens are billed at five times the input rate and thinking tokens count as output, so a model that reasons longer gets expensive fast. A task that costs $0.020 on 3.7 Flash could plausibly cost $0.030 on 3.8 Flash if thinking output rises 50%. Whether that's worth it depends entirely on whether 3.7 was failing the task in the first place. A 50% cost increase that turns a 60% pass rate into a 90% pass rate is a bargain. The same increase on a job 3.7 already nails is waste.

3.8 Flash vs 3.7 Flash vs the Cheap Alternative

AttributeGemini 3.8 FlashGemini 3.7 FlashGPT-5.6 Luna (OpenAI)
ReleasedSeptember 2, 2026August 13, 2026Mid-2026 (GPT-5.6 family)
Input / output price per 1M tokens$0.75 / $3.75 (through Dec 31, 2026)$0.75 / $3.75 (through Dec 31, 2026)$0.20 / $1.20
Context window1,048,576 tokens1,048,576 tokens1,050,000 tokens
Best forLong-horizon coding agents, multi-step reasoning, finance and legal analysisHigh-volume everyday coding, tool use, classification, extractionBulk, cost-sensitive tasks where Flash-class reasoning is overkill
Key limitationUses more tokens per task at higher effort levels; per-task cost can exceed 3.7Lower ceiling on complex agentic and specialized-domain tasksWeakest of the three on frontier reasoning benchmarks; no Google Search grounding
Native multimodal inputText, image, video, audio, PDFText, image, video, audio, PDFText, image

The honest routing map: Luna for volume, 3.7 Flash for reliable mid-tier work, 3.8 Flash where the task is hard enough that failures cost more than tokens. Most production stacks want all three behind one endpoint, which is also why I keep pushing people toward an OpenAI-compatible gateway rather than three SDKs.

Migration: It's a String Change, Plus One Decision

The API surface didn't move. Swap gemini-3.7-flash for gemini-3.8-flash and your existing calls work. The decision you actually need to make is the effort level, because that's the knob Google points at for controlling 3.8's extra token appetite.

curl: Gemini API native

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" \
  -d '{
    "contents": [{"parts": [{"text": "Refactor this function and explain each change..."}]}],
    "generationConfig": {
      "thinkingConfig": {"thinkingLevel": "low"},
      "maxOutputTokens": 4096
    }
  }'

Start at low for anything you're migrating from 3.7. Raise it only on the endpoints where 3.7 was underperforming. Check the current Gemini thinking docs for the exact level names your account exposes; Google has adjusted these across the 3.x line.

Python: route by task difficulty

import os
from google import genai
from google.genai import types

client = genai.Client(api_key=os.environ["GEMINI_API_KEY"])

ROUTES = {
    # (model, thinking_level, max_output_tokens)
    "classify": ("gemini-3.7-flash", "low", 512),
    "code_review": ("gemini-3.8-flash", "low", 4096),
    "agentic_fix": ("gemini-3.8-flash", "high", 16384),
}

def run(task: str, prompt: str):
    model, level, cap = ROUTES[task]
    resp = client.models.generate_content(
        model=model,
        contents=prompt,
        config=types.GenerateContentConfig(
            thinking_config=types.ThinkingConfig(thinking_level=level),
            max_output_tokens=cap,
        ),
    )
    u = resp.usage_metadata
    print(f"{task}: in={u.prompt_token_count} out={u.candidates_token_count} "
          f"thinking={getattr(u, 'thoughts_token_count', 0)}")
    return resp.text

Log thoughts_token_count per route from day one. That single number is the difference between knowing your 3.8 upgrade cost you 12% and finding out from the invoice that it cost you 80%.

Node.js: OpenAI-compatible endpoint

Google exposes an OpenAI-compatible surface, so if your code already speaks the OpenAI SDK you don't need a second client. This is also the shape that lets you point the same code at a gateway like KissAPI and route Gemini, GPT-5.6, and Claude requests through one key with one billing view.

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.GEMINI_API_KEY,
  baseURL: "https://generativelanguage.googleapis.com/v1beta/openai/",
});

export async function reviewDiff(diff) {
  const res = await client.chat.completions.create({
    model: "gemini-3.8-flash",
    max_tokens: 4096,
    messages: [
      { role: "system", content: "You are a senior reviewer. Flag security issues first." },
      { role: "user", content: diff },
    ],
  });
  console.log("usage", res.usage);
  return res.choices[0].message.content;
}

Where 3.8 Flash Pays Off, and Where It Doesn't

Upgrade these:

Leave on 3.7 Flash:

A clean rollout: shadow 5% of 3.7 Flash traffic to 3.8 Flash at low effort for a week, compare pass rate and thoughts_token_count per route, then promote only the routes where quality moved. Use the cost calculator with your measured token counts, not Google's rate card, to decide.

The Cyber Variant, Briefly

Gemini 3.8 Flash Cyber isn't something most readers can call. It's distributed through Google's Fairwind Program to government authorities, critical infrastructure operators, and software maintainers, and it ships with looser cyber mitigations than the general model. The numbers are strong: frontier-level on CyberGym, a success rate above 70% on Google's internal 20-language vulnerability benchmark, and that 47.2% CWE-Bench pass@1 within 0.6 points of the leading frontier model at far lower cost. If you maintain open-source infrastructure, applying is worth an afternoon. If you don't, the takeaway is that the same training pushed the general 3.8 Flash's coding ability, and that part you get today.

FAQ

Does Gemini 3.8 Flash cost more than Gemini 3.7 Flash?

No. Both are $0.75 per million input tokens and $3.75 per million output tokens (thinking included) through December 31, 2026, then $1.50 and $7.50 from January 1, 2027. The rate is identical, but Google says 3.8 Flash may use more tokens per task, especially at higher effort levels, so the bill per task can be higher.

What is the context window of Gemini 3.8 Flash?

1,048,576 input tokens and 65,536 output tokens. It accepts text, image, video, audio, and PDF input and supports context caching, code execution, function calling, file search, and computer use in preview.

Should I migrate from Gemini 3.7 Flash to Gemini 3.8 Flash?

Migrate long-horizon coding agents, multi-step reasoning, and finance or legal analysis, where Google reports the biggest gains. Keep 3.7 Flash for high-volume classification and extraction; Google says it remains fully supported for efficiency-first workloads.

Run Gemini 3.8 Flash, 3.7 Flash, and GPT-5.6 Through One Endpoint

KissAPI gives you an OpenAI-compatible key for Gemini, GPT, Claude, and more, with one billing view so effort-level experiments show up in cost per route, not in a surprise invoice.

Start Free