Gemini 2.5 Flash API

Gemini 2.5 Flash is a powerful AI model developed by Google, designed to handle complex tasks with high accuracy and efficiency and has thinking capabilities.

Modalities
Text, ImageText
In / Out price
$0.3/$2.5per 1M
Context window
1M tokens
Released
Sep 9, 2025

Gemini 2.5 Flash overview

The pelican test: one prompt, every text model, unedited SVG output from Nov 3, 2026.

SVG of a pelican riding a bicycle, written by Gemini 2.5 Flash through AI/ML API

Gemini 2.5 Flash by Google

Google DeepMind’s Gemini 2.5 Flash offers hybrid reasoning, supporting text, images, video, and audio.

Gemini 2.5 Flash specs

Model ID
google/gemini-2.5-flash
Developer
Google
Context window
1,000,000 tokens
Max output
65,536 tokens
Input
Text, Image
Output
Text
API
OpenAI-compatible, base URL https://api.aimlapi.com/v1

Gemini 2.5 Flash Description

Gemini 2.5 Flash, developed by Google DeepMind, is a fast, cost-effective multimodal AI model designed for reasoning and coding tasks. With a 1-million-token context window, it excels in web development, math, and scientific analysis. Available via Google AI Studio and Vertex AI (preview), it balances quality, cost, and speed for developers and enterprises.

Performance Benchmarks

Gemini 2.5 Flash is a hybrid reasoning model with a Transformer-based architecture, allowing developers to adjust "thinking" depth for optimized performance. It supports text, image, video, and audio inputs, with enhanced post-training for superior reasoning.

  • Context Window: 1 million tokens, expanding to 2 million soon.
  • Output Capacity: Up to 32,768 tokens per response.
  • Benchmarks:
    • AIME 2025 (math): 78.3% (with thinking), 72.1% (without thinking)
    • GPQA Diamond (science): 76.5% (with thinking)
    • SWE-Bench Verified (coding): 58.2% (with thinking)
  • Performance: 180 tokens/second output speed, 0.8s latency (TTFT without thinking).

Key Capabilities

Gemini 2.5 Pro Experimental is a reasoning-focused model, methodically analyzing tasks for accurate, nuanced outputs. Its multimodal capabilities enable seamless integration of text, images, video, and audio, making it versatile for complex workflows.

  • Advanced Coding: Tops WebDev Arena, generating functional web apps with aesthetic UI (e.g., video players, dictation apps). Supports 40+ languages and agentic coding with minimal supervision.
  • Reasoning and Problem-Solving: Excels in math (AIME 2025: 86.7%) and science (GPQA: 84%), with built-in thinking for logical conclusions.
  • Multimodal Processing: Scores 84.8% on VideoMME, enabling video-to-code workflows (e.g., learning apps from YouTube videos).
  • Tool Utilization: Supports function calling, JSON structuring, and external tool integration for multi-step tasks and API interactions.
  • Web Development: Generates responsive, visually appealing web apps with features like wavelength animations and hover effects.
  • Interactive Simulations: Creates executable code for games (e.g., endless runner) and visualizations (e.g., Mandelbrot fractals, boid animations).
  • API Features: Offers streaming, function calling, and multilingual support for real-time, scalable applications.

Optimal Use Cases

  • Web Development: Creating interactive apps with responsive design.
  • Code Generation: Autonomous coding for simulations and large codebases.
  • Scientific Research: Data analysis in math and science.
  • Multimodal Applications: Learning apps from videos and visualizations.
  • Business Automation: Streamlining tasks with API integration.

Comparison with Other Models

  • vs. Claude 3.7 Sonnet: Lower SWE-Bench score (58.2% vs. ~65%), but faster and cheaper.
  • vs. DeepSeek R1: Lower AIME score (78.3% vs. 93.3%), but better in multimodality.
  • vs. Qwen3-235B-A22B: Higher output speed (180 vs. 40.1 tokens/second) and lower cost.

Limitations

  • High latency (0.8s TTFT) with thinking for real-time use.
  • Experimental status may affect stability.
  • Thinking mode increases costs.

Use cases

  • Mobile and web-based chatbots requiring real-time responses
  • Lightweight AI applications and assistants for fast text generation
  • Enterprise workflows requiring long context understanding with speed
  • Quick summarization and information extraction tasks
  • On-the-fly coding help and developer productivity tools

Capabilities

  • Function calling
  • Streaming
  • Structured outputs
  • Reasoning

Gemini 2.5 Flash benchmarks by Artificial Analysis

See how Gemini 2.5 Flash compares in generation speed and latency. Data retrieved Nov 3, 2026.

Speed

Output tokens / second

Benchmark results

Compare 14 models available on AI/ML API across 5 independent benchmarks.

Humanity's Last Exam

Expert-written questions across academic subjects.

Gemini 2.5 Flash API pricing

Gemini 2.5 Flash pricing in US dollars
UsagePriceUnit
Input$0.31M tokens
Output$2.51M tokens
Cached input$0.31M tokens

Prices from the AI/ML API price list, checked on Nov 4, 2026.

Gemini 2.5 Flash vs other models: token prices

AI/ML API input and output rates for 5 models, per million tokens.

AI/ML API model prices in USD per million tokens
ModelInputOutput
Gemini 2.5 Flash$0.3$2.5
Gemini 3.5 Flash Lite$0.3$2.5
Gemini 3.8 Flash$0.75$3.75
Gemini 3.7 Flash$0.75$3.75
Gemini 4 Argon$2$10

How to use the Gemini 2.5 Flash API

View docs

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"

2Make your first request

curl 'https://api.aimlapi.com/v1/chat/completions' \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "google/gemini-2.5-flash",
  "messages": [
    {
      "role": "user",
      "content": "Write a haiku about the ocean."
    }
  ]
}'

Related articles

All posts

Gemini 2.5 Flash FAQ

What is the context window of Gemini 2.5 Flash?

Gemini 2.5 Flash has a 1,000,000 tokens context window and can return up to 65,536 tokens.

What inputs and outputs does Gemini 2.5 Flash support?

Gemini 2.5 Flash takes image, text as input and returns text.

What is the model ID for Gemini 2.5 Flash?

Use google/gemini-2.5-flash as the model id. Requests go to https://api.aimlapi.com/v1/chat/completions.

When was Gemini 2.5 Flash released?

Gemini 2.5 Flash became available on September 9, 2025.

How much does Gemini 2.5 Flash cost?

Gemini 2.5 Flash costs $0.3 input and $2.5 output per 1M tokens on AI/ML API, billed as you go with no subscription.

Does Gemini 2.5 Flash support streaming?

Yes, Gemini 2.5 Flash can stream responses as they are generated.

Can Gemini 2.5 Flash read images?

Yes, Gemini 2.5 Flash accepts image input alongside text.

Who created Gemini 2.5 Flash?

Gemini 2.5 Flash was built by Google.

Can Gemini 2.5 Flash call external tools or functions?

Yes, it supports function calling, including parallel tool calls.

Does Gemini 2.5 Flash return structured output formats?

Yes, it supports structured output generation.

Start building with Gemini 2.5 Flash

Gemini 2.5 Flash API

google/gemini-2.5-flash

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"

2Make your first request

curl 'https://api.aimlapi.com/v1/chat/completions' \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "google/gemini-2.5-flash",
  "messages": [
    {
      "role": "user",
      "content": "Write a haiku about the ocean."
    }
  ]
}'