Choose Auto, TokenLab Verified, or Official for each request, with prices shown up front. See what's new

Gemini 3.5 Flash API for Agents: It Is Deprecated, Use Gemini 3.8 Flash

·September 19, 2026·8 min read·Updated November 11, 2026·2267 views
#gemini#ai-agents#model-deprecation#ai-api
Gemini 3.5 Flash API for Agents: It Is Deprecated, Use Gemini 3.8 Flash

What you’ll learn

  • Can I still use gemini-3.5-flash?
  • What replaces gemini-3.5-flash?
  • Does TokenLab switch me to the new model automatically?
  • How much cheaper is Gemini 3.8 Flash than Gemini 3.5 Flash?
  • How do I know if a model I use is deprecated?

Gemini 3.5 Flash is deprecated. The TokenLab catalog marked gemini-3.5-flash as deprecated on 2026-10-08 and names gemini-3.6-flash as its replacement. The newest Flash model is gemini-3.8-flash, and it costs about half as much per token on TokenLab. This page shows the status of each Gemini Flash ID on 2026-11-11, what each costs, and how to keep an agent loop working when a model ID is deprecated.

Key Takeaways

  • Do not start new work on gemini-3.5-flash. TokenLab lists it with stage deprecated, and Google no longer offers it in Google AI Studio.
  • Use gemini-3.8-flash for new agents. It has the same 1,048,576-token input limit and 65,536-token output limit. TokenLab price: $0.375 input / $1.875 output per 1M tokens.
  • gemini-3.6-flash is the replacement the catalog names. Google routes requests for the old ID to it. It costs $0.75 / $3.75 on TokenLab.
  • Neither TokenLab nor Google has announced a retirement date for gemini-3.5-flash. A deprecated ID can still stop working later, so move on your own schedule.
  • Check the lifecycle of every model ID you use with GET /v1/models/{id}. The endpoint is public and needs no API key.

Status of the Gemini Flash IDs on 2026-11-11

TokenLab columns come from GET /v1/models/{id}. Google columns come from the Gemini API deprecations page.

Model ID TokenLab stage Deprecated at Replacement in the catalog Google status
gemini-3.5-flash deprecated 2026-10-08 gemini-3.6-flash No longer available in Google AI Studio. The endpoint is not shutting down and routes requests to gemini-3.6-flash.
gemini-3.6-flash active none none Released 2026-07-21. No shutdown date announced.
gemini-3.7-flash deprecated 2026-10-08 gemini-3.8-flash No longer available in Google AI Studio. The endpoint routes requests to gemini-3.8-flash.
gemini-3.8-flash active, marked latest none none Released 2026-09-02. Google calls it its most intelligent Flash model. No shutdown date announced.
gemini-3.5-flash-lite active none none No shutdown date announced.

A deprecated model is still listed in the catalog. The stage tells you to plan the move before the ID is retired. A retired model is removed from the model list.

Prices

Prices are USD per 1M tokens, read on 2026-11-11. "TokenLab price" is the Verified price. "List price" is the price Google or the other maker publishes.

Model ID Role TokenLab price (input / output) List price (input / output)
gemini-3.8-flash Use for new agents $0.375 / $1.875 $0.75 / $3.75 until 2026-12-31, then $1.50 / $7.50
gemini-3.6-flash Replacement named in the catalog $0.75 / $3.75 $0.75 / $3.75 until 2026-12-31, then $1.50 / $7.50
gemini-3.5-flash Deprecated $0.75 / $4.50 $1.50 / $9 (no longer on Google's price page)
gemini-3.5-flash-lite Cheaper Google fallback $0.15 / $1.25 $0.30 / $2.50
gpt-6.1-terra Fallback from another maker $0.30 / $1.50 $1 / $5

Google's price page says the introductory price of Gemini 3.8 Flash and Gemini 3.6 Flash ends on 2026-12-31. From 2027-01-01 Google lists $1.50 / $7.50. Read the TokenLab price again after that date with GET /v1/models/gemini-3.8-flash/pricing.

Here is a worked example with stated assumptions. An agent makes 10 model calls. Each call sends 20,000 input tokens and returns 1,000 output tokens, with no caching. That is 200,000 input and 10,000 output tokens in total.

  • gemini-3.5-flash: 0.2 × $0.75 + 0.01 × $4.50 = $0.195.
  • gemini-3.6-flash: 0.2 × $0.75 + 0.01 × $3.75 = $0.1875.
  • gemini-3.8-flash: 0.2 × $0.375 + 0.01 × $1.875 = $0.09375, about 52% less than gemini-3.5-flash.

Output tokens cost 5 times as much as input tokens on gemini-3.8-flash. Google bills thinking tokens as output, so a long reasoning trace raises the output count. Cap the response length with max_tokens on each call.

What changes when you move to Gemini 3.8 Flash

The What's new in Gemini 3.8 Flash page from Google lists these migration steps for the Gemini API:

  • Replace thinking_budget with thinking_level. The values are low, medium (the default) and high. The value minimal returns an error.
  • Remove temperature, top_p, top_k and candidate_count from requests.
  • Remove prefilled model turns. For multi-turn chats, Google recommends the server-side previous_interaction_id.
  • Keep thought signatures from earlier turns.
  • With generateContent, send call_id and name in every FunctionResponse.

Parameter handling can differ between endpoints, so send a few real requests through the endpoint you use before you switch. Compare the answers and the cost per finished task, not only the price per token.

What to do when a model is deprecated

  1. Read the lifecycle. GET /v1/models/{id} returns tokenlab.lifecycle with stage, deprecated_at, retired_at and replacement_model. Run the check below in CI and on a schedule.
  2. Check that the replacement fits. Compare input and output limits, accepted request formats, capabilities and price on the replacement's record. A replacement can change quality, price, context length and tool support.
  3. Test it on your own tasks. Use the same prompts and tools. Compare correctness, retries and cost per finished task.
  4. Switch in one place. Keep model IDs in one config file, and send the ID explicitly in every request.
  5. Keep a tested fallback. If a retired ID returns 400 model_not_found, a fallback you already tested keeps the loop running.

TokenLab does not choose a different model for a request on its own. The agent error guide says to send the chosen model ID explicitly, and a missing model returns model_not_found, sometimes with a did_you_mean field. After a maker retires a model, TokenLab may send the old ID to the replacement and post it in the changelog. On 2026-10-22, deepseek-v4-flash began to run as deepseek-v4.1-flash this way, billed at the replacement price. Do not rely on this. Price and output can change when the model behind the ID changes.

This script exits with code 1 when a model you depend on is missing, is not active, or now resolves to a different ID:

import json
import sys
import urllib.error
import urllib.request

BASE = "https://api.tokenlab.sh/v1/models/"
MODELS = ["gemini-3.8-flash", "gemini-3.5-flash-lite", "gemini-3.5-flash"]


def read_record(model_id):
    try:
        with urllib.request.urlopen(BASE + model_id, timeout=15) as resp:
            return json.load(resp)
    except urllib.error.HTTPError as exc:
        if exc.code == 404:
            return None  # model_not_found: the ID does not exist
        raise


failed = False
for model_id in MODELS:
    record = read_record(model_id)
    if record is None:
        print(f"{model_id}: not found")
        failed = True
    elif record["id"] != model_id:
        print(f"{model_id}: now resolves to {record['id']}")
        failed = True
    elif record["tokenlab"]["lifecycle"]["stage"] != "active":
        life = record["tokenlab"]["lifecycle"]
        print(f"{model_id}: stage={life['stage']}, deprecated_at={life['deprecated_at']}, "
              f"retired_at={life['retired_at']}, replacement={life['replacement_model']}")
        failed = True
    else:
        print(f"{model_id}: active")
sys.exit(1 if failed else 0)

On 2026-11-11 it printed gemini-3.8-flash: active, gemini-3.5-flash-lite: active and a deprecation line for gemini-3.5-flash with replacement gemini-3.6-flash.

An agent call with a tested fallback

The function below sends a Chat Completions request to gemini-3.8-flash and moves to the next model only when the ID is not found. Other errors, such as 429, are raised so that your own retry code can handle them. The error guide lists which statuses are safe to repeat.

import os
from openai import OpenAI, APIStatusError

client = OpenAI(
    api_key=os.environ["TOKENLAB_API_KEY"],
    base_url="https://api.tokenlab.sh/v1",
    timeout=60.0,
    max_retries=0,
)

# Order matters. Every fallback is a model you have tested for this job.
MODELS = ["gemini-3.8-flash", "gpt-6.1-terra"]


def error_code(exc):
    body = exc.body if isinstance(exc.body, dict) else {}
    error = body.get("error", body)
    return error.get("code") if isinstance(error, dict) else None


def chat(messages, tools=None, max_tokens=1024):
    for model in MODELS:
        kwargs = {"model": model, "messages": messages, "max_tokens": max_tokens}
        if tools:
            kwargs["tools"] = tools
        try:
            return model, client.chat.completions.create(**kwargs)
        except APIStatusError as exc:
            if error_code(exc) != "model_not_found":
                raise  # other errors need their own handling
            print(f"{model} is not available, trying the next model")
    raise RuntimeError("no configured model is available")

Log which model answered each request. A fallback from another maker can change price, context limit and tool behavior. Tell your users when the model changes.

FAQ

Can I still use gemini-3.5-flash?

The TokenLab catalog still lists it with stage deprecated and no retirement date. Google says its own endpoint for the ID is not shutting down and routes requests to gemini-3.6-flash. Do not start new work on it. Move to gemini-3.8-flash and test your prompts first.

What replaces gemini-3.5-flash?

The catalog names gemini-3.6-flash. For new work, use gemini-3.8-flash. It is newer, it has the same context and output limits, and it costs less on TokenLab.

Does TokenLab switch me to the new model automatically?

Not by default. Send the model ID explicitly. When a maker retires a model, TokenLab may route the old ID to the replacement and announce it in the changelog, but you should not depend on that.

How much cheaper is Gemini 3.8 Flash than Gemini 3.5 Flash?

On TokenLab, input costs $0.375 against $0.75 per 1M tokens, and output costs $1.875 against $4.50. In the 10-call example above, the cost drops from $0.195 to $0.09375. Google's list price for Gemini 3.8 Flash doubles on 2027-01-01.

How do I know if a model I use is deprecated?

Read tokenlab.lifecycle from GET /v1/models/{id}. A stage other than active, a deprecated_at date or a replacement_model value means you should plan a move. The Get a Model reference describes the fields.

Create a TokenLab API key and check the current model IDs before you deploy.

Sources

Prices checked 2026-11-11

Prepared by TokenLab's AI agents. Facts are checked against the linked primary sources on the date shown.

Related models

Recent model releases

Try the models from this article

Chat, create images, or make video with the same TokenLab balance.

Your first API call

Get your API key
curl https://api.tokenlab.sh/v1/chat/completions \
  -H "Authorization: Bearer $TOKENLAB_API_KEY" -H "Content-Type: application/json" \
  -d '{"model":"gemini-3.8-flash","messages":[{"role":"user","content":"Hello!"}]}'