Model API

Gemini 3.5 Flash API

Google's latest agentic Flash model for coding, tool use, long-context reasoning, and multimodal chat.

Model ID

gemini-3.5-flash

Provider

google

Capability

chat

Status

Available

Pricing and limits

tokens in

$1.50 / 1M input tokens

tokens out

$9.00 / 1M output tokens

Context length
1,048,576
Max output
65,536
Release date
2026-05
Knowledge cutoff
2025-01

Use this model

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.AIDUCT_API_KEY,
  baseURL: "https://api.aiduct.ai/v1",
});

const response = await client.chat.completions.create({
  model: "gemini-3.5-flash",
  messages: [{ role: "user", content: "Say hello in one sentence." }],
});

Supported parameters

messagestemperaturetop_pmax_tokensstreamstoptoolstool_choiceresponse_formatuser

What is Gemini 3.5 Flash?

Gemini 3.5 Flash is Google's latest agentic Flash model, released in May 2026 with a January 2025 knowledge cutoff. It's designed for developers who need fast, cost-effective inference across coding, tool use, long-context reasoning, and multimodal chat. The model accepts text, images, audio, and video as input and generates text output, making it suitable for applications ranging from code generation to complex document analysis and multimodal assistants.

With a 1,048,576-token context window and support for up to 65,536 output tokens, Gemini 3.5 Flash handles extremely long documents, large codebases, and extended conversations without truncation. It supports structured output, function calling, and extended thinking capabilities, positioning it as a strong choice for agentic workflows where the model must reason, plan, and interact with external tools.

What Gemini 3.5 Flash Excels At

Gemini 3.5 Flash is optimized for several key use cases:

Coding and code generation: The model understands multiple programming languages and can generate, debug, and refactor code. Its long context window allows it to work with entire repositories or large files in a single prompt.

Tool use and function calling: Native support for structured function calling makes it straightforward to build agents that interact with APIs, databases, and external systems. The model can decide when to call tools, format arguments correctly, and interpret results.

Long-context reasoning: With over 1 million tokens of context, Gemini 3.5 Flash can analyze lengthy documents, transcripts, or logs without summarization. This is useful for legal document review, research synthesis, and troubleshooting from verbose logs.

Multimodal understanding: The model processes images, audio, and video alongside text. You can ask it to describe screenshots, transcribe and reason about audio, or analyze video frames—all in the same request.

Structured output: When you need JSON, XML, or other structured formats, Gemini 3.5 Flash can be constrained to follow a schema, reducing the need for brittle post-processing.

Extended thinking: The model supports a thinking mode where it can reason through complex problems step-by-step before generating a final answer, improving accuracy on multi-step tasks.

Who Should Use Gemini 3.5 Flash?

Gemini 3.5 Flash is a good fit for:

  • Backend engineers building agentic systems that require reliable tool calling and structured output.
  • Full-stack developers integrating multimodal AI into applications where users upload images, audio, or video.
  • DevOps and SRE teams analyzing long log files, traces, or configuration files in a single context.
  • Data engineers extracting structured data from unstructured or semi-structured sources at scale.
  • Researchers and analysts working with large documents, transcripts, or codebases that exceed the context limits of smaller models.

If you need a balance of speed, cost, and capability—especially for agentic or multimodal workflows—Gemini 3.5 Flash is worth evaluating against other Flash-tier models like GPT-4o mini or Claude 3.5 Haiku.

How to Call Gemini 3.5 Flash via Aiduct

Aiduct provides a unified API at https://api.aiduct.ai/v1 that is OpenAI-compatible. You can use the OpenAI SDK, Anthropic SDK, or raw HTTP with the same API key. The model identifier is gemini-3.5-flash.

Python Example with OpenAI SDK

from openai import OpenAI

client = OpenAI(
    api_key="your_aiduct_api_key",
    base_url="https://api.aiduct.ai/v1"
)

response = client.chat.completions.create(
    model="gemini-3.5-flash",
    messages=[
        {"role": "user", "content": "Explain how to use async/await in Rust."}
    ],
    max_tokens=2048,
    temperature=0.7
)

print(response.choices[0].message.content)

curl Example

curl https://api.aiduct.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your_aiduct_api_key" \
  -d '{
    "model": "gemini-3.5-flash",
    "messages": [
      {"role": "user", "content": "Write a Python function to parse ISO 8601 dates."}
    ],
    "max_tokens": 1024
  }'

Multimodal Input Example

To send an image, encode it as a base64 data URI or provide a URL:

response = client.chat.completions.create(
    model="gemini-3.5-flash",
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "What is in this image?"},
                {"type": "image_url", "image_url": {"url": "https://example.com/image.jpg"}}
            ]
        }
    ]
)

Aiduct handles protocol translation, so you can use the same patterns you're familiar with from OpenAI or Anthropic clients.

Pricing and Rate Limits

Gemini 3.5 Flash is priced per token, with separate rates for prompt tokens, completion tokens, and cached prompt tokens. Because pricing can change, always check the Aiduct pricing page for current rates and any volume discounts.

Key points:

  • Prompt tokens are charged at a lower rate than completion tokens.
  • Cache reads are significantly cheaper than fresh prompt tokens if you're sending repeated context (e.g., a large codebase preamble).
  • Completion tokens are the most expensive component, so tune max_tokens to avoid generating more output than you need.

Aiduct applies the same pricing structure as Google's direct API, with no markup. You pay only for what you use, and you can monitor usage in the Aiduct dashboard.

Comparing Aiduct Access to Direct Google API

Using Gemini 3.5 Flash through Aiduct offers several advantages over calling Google's Vertex AI or AI Studio APIs directly:

Unified interface: If you're already using OpenAI or Anthropic models, you can call Gemini 3.5 Flash with the same client library and request format. No need to learn a new SDK or refactor your code.

Single API key: Aiduct consolidates billing and authentication across providers. You don't need separate Google Cloud projects, service accounts, or OAuth flows.

Consistent error handling: Aiduct normalizes error codes and rate limit headers, so your retry logic works the same way across models.

No vendor lock-in: Switching between models—or A/B testing multiple models—is a one-line change to the model parameter.

Simplified compliance: If you're already auditing or logging API calls through Aiduct, adding Gemini 3.5 Flash doesn't introduce a new integration point.

The trade-off is that you're routing requests through Aiduct's infrastructure. Latency is typically within a few milliseconds of direct access, and Aiduct does not log or train on your data.

Common Gotchas and Best Practices

Context window != output limit: Gemini 3.5 Flash supports 1,048,576 input tokens and up to 65,536 output tokens. If your prompt is very long, you may hit the output limit before exhausting the context window. Plan your prompts accordingly.

Multimodal tokens are expensive: Images, audio, and video consume many tokens. A single high-resolution image can be thousands of tokens. Use the smallest resolution that meets your needs, and consider downsampling or cropping images before sending them.

Function calling requires explicit schemas: When using tool calling, define your function schemas carefully. Gemini 3.5 Flash will attempt to call functions that match the user's intent, but ambiguous or overlapping schemas can lead to incorrect tool selection.

Thinking mode adds latency: If you enable extended thinking, the model will generate internal reasoning tokens before producing the final answer. This improves accuracy but increases both latency and cost. Use it selectively for complex tasks.

Caching is not automatic: To benefit from prompt caching, you must structure your requests so that repeated context appears at the beginning of the prompt. Aiduct and Google's API will cache prefixes, but you need to design prompts to take advantage of this.

Structured output is strict: When you specify a JSON schema for structured output, the model will refuse to generate invalid JSON. If your schema is too rigid, you may get errors or empty responses. Test schemas thoroughly with representative inputs.

Rate limits vary by region and tier: Aiduct inherits Google's rate limits. If you're building a high-throughput application, check the rate limits for your account tier and consider batching requests or implementing exponential backoff.

Getting Started

To start using Gemini 3.5 Flash:

  1. Sign up for an Aiduct account and generate an API key.
  2. Install the OpenAI or Anthropic SDK in your language of choice.
  3. Point the client to https://api.aiduct.ai/v1 and set the model to gemini-3.5-flash.
  4. Send a test request and verify the response format.
  5. Monitor usage and latency in the Aiduct dashboard.

Gemini 3.5 Flash is a strong general-purpose model for agentic and multimodal workloads. Its combination of long context, tool calling, and multimodal input makes it a versatile choice for modern backend systems. If you're evaluating Flash-tier models, test it alongside GPT-4o mini and Claude 3.5 Haiku to see which best fits your latency, cost, and accuracy requirements.

FAQ

Can I send video or audio directly to Gemini 3.5 Flash?+

Yes. Gemini 3.5 Flash accepts text, images, audio, and video as input. Encode media as base64 data URIs or provide public URLs. Be aware that video and audio consume many tokens.

How does prompt caching work with Gemini 3.5 Flash?+

Google caches the prefix of your prompt automatically if it's repeated across requests. Structure prompts so shared context appears first. Cached tokens are billed at a lower rate than fresh prompt tokens.

Does Gemini 3.5 Flash support JSON mode or structured output?+

Yes. You can constrain the model to output valid JSON by specifying a schema. This is useful for extracting structured data or ensuring parseable responses without post-processing.

What's the difference between Gemini 3.5 Flash and Gemini 3.5 Pro?+

Flash is optimized for speed and cost, while Pro prioritizes accuracy and reasoning depth. Flash has a larger context window and is better for agentic workflows. Pro is better for complex reasoning tasks.

Can I use Gemini 3.5 Flash for function calling?+

Yes. Gemini 3.5 Flash has native support for function calling. Define your tools in the OpenAI function schema format, and the model will decide when to call them and format arguments correctly.

How many tokens does an image consume in Gemini 3.5 Flash?+

Token count depends on image resolution. A high-resolution image can consume several thousand tokens. Use the smallest resolution that meets your needs to control costs and stay within context limits.

Last refreshed Jul 9, 2026