Gemini 3.8 Flash (2026): Pricing, API Code and Comparisons
Unicorn API Team · · 11 min read
Gemini 3.8 Flash is Google’s fast, lower-cost reasoning model, built for software engineering, autonomous agents and multi-step work that used to need a bigger, slower model. This post covers what it is, what changed from 3.7 Flash, what it costs per task in practice, how it compares with GPT 6 and Claude Opus 5.5, and the code to start calling it in a few minutes.
What is Gemini 3.8 Flash?
Google sorts its Gemini models into tiers. “Pro” and its relatives are the high-compute models for the hardest tasks. “Flash” models are the affordable, high-throughput tier: quicker to answer and much cheaper per token, aimed at work you run thousands of times a day. “Flash Lite” goes further down in size and price.
Google announced Gemini 3.8 Flash on 2 September 2026 and described it as its most capable Flash model so far. It also made it the recommended default for three kinds of work:
- Software engineering: reading a codebase, writing and editing code, fixing failing tests.
- Agentic workflows: an agent is a model running in a loop, calling tools (functions you define, such as “search the docs” or “run the tests”), reading the results and deciding the next step.
- Multi-step reasoning: problems where the model has to plan, keep track of intermediate results and not lose the thread halfway through.
The interesting part is where it sits. Gemini 3.8 Flash is pitched as taking on larger models on these tasks while keeping Flash-tier pricing. Whether that holds for your workload is something you should test, and the rest of this post shows how to do that cheaply.
Alongside the main model, Google also released a variant called Flash Cyber, tuned for security work such as finding and patching vulnerabilities. It is a separate model. Unicorn API currently offers the standard Gemini 3.8 Flash; check the model catalog for anything else.
One search-result oddity worth clearing up: if you searched for “Stellaris 3.8 Gemini”, that refers to a version of the strategy game Stellaris, which also used the name Gemini for one of its updates. It has nothing to do with Google’s model.
Gemini 3.8 vs 3.7 Flash: what changed
The headline claim from launch coverage is reliability rather than raw speed. Reviewers described 3.8 Flash as a “diligent” model: better accuracy than 3.7 Flash and more consistent behaviour, especially on long-horizon software engineering. “Long-horizon” means tasks that take many steps to finish, like a refactor that touches a dozen files, or an agent that has to run tests, read errors and try again several times.
That matters more than it sounds. On a single question, a small accuracy gain is barely noticeable. On a 30-step agent run, a model that drifts off task once every ten steps will almost never finish, while one that stays on track most of the time finishes most runs. Small per-step gains compound over long tasks.
What did not change in spirit: it is still a Flash model. It is designed to be cheap enough to run at volume and quick enough to sit inside interactive tools. Google also launched it at the same introductory price as 3.7 Flash, so upgrading was not meant to cost more per token.
What to watch for when you migrate:
- Prompts tuned around old weaknesses. If you added long “do not forget to...” instructions to compensate for 3.7 Flash dropping steps, try removing them. They cost tokens and may no longer help.
- Output length. A more thorough model can also be a wordier one. Set
max_tokensand check your average output size before and after. - Your own evaluation set. Keep 20 to 50 real tasks with known good answers and run both models on them. Launch claims describe averages; your data is what counts.

Gemini 3.8 Flash pricing on Unicorn API
On Unicorn API the model id is gemini-3-8-flash-openai. It is billed per token, in credits:
| Token type | Credits per 1M tokens | On a monthly plan ($0.01/credit) | With top-up credits ($0.015/credit) |
|---|---|---|---|
| Input | 45 | $0.45 | $0.675 |
| Output | 225 | $2.25 | $3.375 |
Monthly plans are Starter ($25), Creator ($50), Studio ($100) and Pro ($200), each giving credits at $0.01. Top-ups cost $0.015 per credit and never expire, which suits bursty or experimental usage. Full details are on the pricing page.
You pay for exactly the tokens the model reports using in the response, nothing for an unfinished budget. You can also ask for the price of a request before you run it with POST /v1/models/price; the request shape is in the API documentation.
A worked example: what one agent task costs
Per-million prices are hard to reason about, so take a realistic coding-agent task: the agent reads some files, a failing test log and your instructions (about 30,000 input tokens across its turns), then writes a patch and an explanation (about 4,000 output tokens).
- Input: 0.03M tokens × 45 credits = 1.35 credits
- Output: 0.004M tokens × 225 credits = 0.90 credits
- Total: 2.25 credits, which is about $0.0225 on a monthly plan
A thousand of those tasks cost 2,250 credits, or $22.50 at the plan rate. The Starter plan would cover roughly 1,100 such runs a month. Notice that output tokens are five times the price of input tokens, so long answers and heavy reasoning are where costs grow, not long prompts.
How to use Gemini 3.8 Flash through the API
Gemini 3.8 Flash on Unicorn API uses the OpenAI-compatible chat completions format, so any code or SDK that talks to OpenAI-style endpoints works by changing the base URL and model name. You need an API key first: create one on the keys page and export it as UNICORN_API_KEY. If you want to try prompts before writing code, the browser playground runs the same models.
The smallest request: curl
curl https://api.unicornapi.net/v1/chat/completions \
-H "Authorization: Bearer $UNICORN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-3-8-flash-openai",
"messages": [
{"role": "user", "content": "Write one sentence about unicorns."}
],
"max_tokens": 200
}'
The reply follows the familiar shape: the text is in choices[0].message.content and token counts are in usage, which is what your bill is based on.
Python with the OpenAI SDK
Because the endpoint is OpenAI-compatible, the official openai Python package works as-is. The SDK sends your key as a Bearer token automatically.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.unicornapi.net/v1",
api_key=os.environ["UNICORN_API_KEY"],
)
resp = client.chat.completions.create(
model="gemini-3-8-flash-openai",
messages=[
{"role": "system", "content": "You are a careful senior Python reviewer. Be concise."},
{"role": "user", "content": "Review this function:\n\ndef avg(xs):\n return sum(xs) / len(xs)"},
],
max_tokens=600,
temperature=0.2,
reasoning_effort="low",
)
print(resp.choices[0].message.content)
u = resp.usage
cost = u.prompt_tokens / 1e6 * 45 + u.completion_tokens / 1e6 * 225
print(f"{u.prompt_tokens} in, {u.completion_tokens} out, about {cost:.4f} credits")
The last two lines turn the reported usage into credits, which is handy for logging cost per request from day one. Supported values for reasoning_effort are listed in the docs.
Tool calling in JavaScript
Agent work is where Gemini 3.8 Flash is meant to shine, and agents run on tool calls. Here the model is given one tool, decides to call it, and you send the result back so it can finish the answer. This runs on Node 18 or later with no dependencies.
const API = "https://api.unicornapi.net/v1/chat/completions";
const headers = {
"Authorization": `Bearer ${process.env.UNICORN_API_KEY}`,
"Content-Type": "application/json",
};
const tools = [{
type: "function",
function: {
name: "run_tests",
description: "Run the project's test suite and return failing test names and errors.",
parameters: { type: "object", properties: {}, required: [] },
},
}];
// Stand-in for a real test runner.
function runTests() {
return JSON.stringify({
failing: ["test_avg_empty_list"],
error: "ZeroDivisionError: division by zero in avg()",
});
}
async function chat(messages) {
const res = await fetch(API, {
method: "POST",
headers,
body: JSON.stringify({
model: "gemini-3-8-flash-openai",
messages,
tools,
tool_choice: "auto",
max_tokens: 800,
}),
});
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
return res.json();
}
const messages = [
{ role: "user", content: "Our tests are failing. Find out why and propose a fix." },
];
for (let step = 0; step < 5; step++) {
const data = await chat(messages);
const msg = data.choices[0].message;
messages.push(msg);
if (!msg.tool_calls || msg.tool_calls.length === 0) {
console.log(msg.content);
break;
}
for (const call of msg.tool_calls) {
const result = call.function.name === "run_tests" ? runTests() : "Unknown tool";
messages.push({ role: "tool", tool_call_id: call.id, content: result });
}
}
Two details make this loop safe in production: the hard cap of five steps, and a fixed max_tokens on each call. Without both, a confused agent can loop and spend credits on nothing. Save it as agent.mjs so top-level await works.
If you would rather use the model inside Cursor, Claude Code or another coding agent, the agents guide shows how to connect Unicorn API over MCP.
Gemini 3.8 Flash vs GPT 6, Claude Opus 5.5 and DeepSeek
The most common follow-up search is some version of “Gemini 3.8 Flash vs GPT 6”. There is no single GPT 6 to compare against: OpenAI’s line includes a frontier model and a budget one, and they sit on opposite sides of Gemini on price. Here are the chat models on Unicorn API you are most likely weighing, with the same 30,000-in, 4,000-out agent task from earlier priced for each.
| Model | Input (credits / 1M) | Output (credits / 1M) | Example agent task (credits) | Relative to Gemini 3.8 Flash |
|---|---|---|---|---|
| GPT 6 Luna | 6 | 30 | 0.30 | about 7.5x cheaper |
| DeepSeek V4.1 Flash | 24 | 95 | 1.10 | about 2x cheaper |
| Gemini 3.8 Flash | 45 | 225 | 2.25 | baseline |
| Claude Opus 5.5 | 320 | 1,600 | 16.00 | about 7x more |
| GPT 6 Astra | 560 | 2,800 | 28.00 | about 12x more |
Some of these models also have discounted cached-input pricing, which matters when you resend the same long system prompt or codebase context on every call. GPT 6 Luna charges 0.6 credits per million cached input tokens, DeepSeek V4.1 Flash 0.5, Claude Opus 5.5 32 and GPT 6 Astra 56. Check each model page for details.
Gemini 3.8 Flash vs GPT 6 Astra
GPT 6 Astra is OpenAI’s frontier-priced model, at roughly 12 times the per-token cost. The sensible pattern is not either/or. Route most traffic to Gemini 3.8 Flash and escalate to Astra only when a task fails your checks, such as tests still failing after the agent’s patch. If the cheaper model succeeds on most tasks, you pay frontier prices only on the hard minority.
Gemini 3.8 Flash vs GPT 6 Luna
GPT 6 Luna goes the other direction: about 7.5 times cheaper. For classification, extraction, short rewrites and routing decisions, a budget model is often enough, and the savings at volume are large. For long agent runs, the per-step reliability that Google emphasises for 3.8 Flash is the thing you are paying the difference for. Run the same evaluation set through both and compare cost per successful task, not cost per token.
Against Claude Opus 5.5 and DeepSeek V4.1 Flash
Claude Opus 5.5 sits at the top-end price tier alongside Astra, so the same escalation logic applies. DeepSeek V4.1 Flash is the closest peer in spirit: another fast, low-cost model at about half the price of Gemini 3.8 Flash. If your workload is cost-sensitive, it is the first alternative worth benchmarking.
Because every model here uses the same endpoint and request shape, switching is a one-line change to the model field, so testing all five on your own prompts takes an afternoon rather than a week of integration work.
Choosing reasoning effort and keeping costs predictable
Gemini 3.8 Flash accepts a reasoning_effort field. Reasoning models can “think” before answering, generating intermediate work that improves accuracy on hard problems. More effort usually means more generated tokens, and since you pay for the usage the model reports, effort is effectively a dial between quality, latency and cost.
A practical way to set it:
- Start low for simple, well-defined requests: summaries, formatting, short code edits, tool routing.
- Raise it for planning steps, debugging with unclear causes, or anything where a wrong answer is expensive downstream.
- Measure both success rate and
usage.completion_tokensat each level on your evaluation set. Pick the lowest level where success stops improving.
Other levers that keep the bill flat:
- Set
max_tokenson every call. It caps the worst case, which is what budgets care about. - Trim context. Send the relevant files, not the whole repository. Input is the cheaper side, but agents resend context on every turn, so it adds up.
- Use
response_formatwhen you need structured output. Asking for JSON in the request is more dependable than parsing free text, and failed parses mean paid retries. - Stream long answers with
stream: trueso users see output immediately. It does not change price but greatly improves perceived speed. - Price before you scale. Run
POST /v1/models/priceon a representative request before launching a batch job.
Common mistakes with Gemini 3.8 Flash
Most problems people hit with a new model come from habits carried over from the old one. These are the ones to avoid.
- Judging it on one prompt. A single impressive or disappointing answer tells you little. The claimed gains for Gemini 3.8 Flash are about consistency over many steps and many runs, so evaluate on many tasks.
- Comparing price per token instead of price per result. A cheaper model that needs three retries can cost more than a pricier one that succeeds first time. Track successful tasks per credit.
- Uncapped agent loops. Always limit steps and tokens. An agent stuck in a tool-call loop is the fastest way to waste credits on any model.
- Expecting it to speak. Gemini 3.8 Flash as offered here is a text chat model. If you searched “how to use Gemini 3.8 TTS”, the workflow is: have the model write the script, then pass it to a speech model. The text to speech guide covers that second step.
- Assuming the Cyber variant is the same model. Flash Cyber is a separate release for security work. Do not assume the standard model behaves identically on vulnerability tasks, and confirm availability before building around it.
- Hard-coding one provider. Model rankings change every few months. Keep the model name in config so you can move traffic to whatever wins your next evaluation, whether that is Gemini 3.8 Flash, a newer Gemini, or something else entirely.
Is Gemini 3.8 Flash the right default?
For most teams building coding tools or agents, Gemini 3.8 Flash is a strong default to test first: it is priced well below frontier models, it is explicitly aimed at long, multi-step work, and it runs through the same OpenAI-style requests you already know. Pair it with a budget model like GPT 6 Luna for trivial requests and a frontier model like GPT 6 Astra or Claude Opus 5.5 for the hardest cases, and you get most of the quality for a fraction of the frontier price.
The fastest way to know is to measure. Create a key, run your own twenty hardest prompts through the models in the table above, and compare cost per successful task. With one API key and one bill, the comparison is a loop over model names, not five separate integrations.
Frequently asked questions
When was Gemini 3.8 Flash released?
Google announced Gemini 3.8 Flash on 2 September 2026 and positioned it as its recommended model for software engineering, autonomous agents and multi-step reasoning. On Unicorn API it became available on 11 November 2026 under the model id gemini-3-8-flash-openai, callable through the standard OpenAI-compatible chat completions endpoint with the same API key you use for every other model.
How much does Gemini 3.8 Flash cost on Unicorn API?
It costs 45 credits per million input tokens and 225 credits per million output tokens. On a monthly plan a credit is $0.01, so that is $0.45 and $2.25 per million tokens. Top-up credits cost $0.015 each and never expire. You pay only for the tokens the model reports using, and you can check the exact price of a request before running it.
Is Gemini 3.8 Flash better than GPT 6?
It depends on which GPT 6 model and which task. GPT 6 Astra costs about 12 times more per token than Gemini 3.8 Flash and is the one to test for your hardest problems. GPT 6 Luna costs about 7.5 times less and suits high-volume simple work. The honest answer is to run your own prompts through each model and compare quality against cost per task.
What is Gemini 3.8 Flash Cyber?
Google released a companion variant called Flash Cyber alongside Gemini 3.8 Flash, aimed at security work such as finding and patching vulnerabilities. It is a separate model from the standard Gemini 3.8 Flash. Unicorn API currently lists the standard model only, so check the model catalog for availability before planning a security workflow around the Cyber variant.
Can Gemini 3.8 Flash do text to speech?
No, not on its own as offered here. Gemini 3.8 Flash is a chat model: text and tool calls in, text out. To produce audio, have the model write or clean up the script, then send that text to a dedicated text-to-speech model. With one API key you can chain both steps in the same script without managing two providers.
How fast is Gemini 3.8 Flash?
Flash models are Google's speed and cost tier, built for high throughput rather than maximum compute per answer. Real latency depends on prompt length, output length and the reasoning effort you set. Lower reasoning effort and a tight max_tokens give the quickest responses. Enable streaming so users see tokens as soon as they are generated instead of waiting for the full reply.