NinjaChat
ModelsAPIMCPPricingDocs
Sign inCreate free key →
ModelsAPIMCPPricingDocs
  1. Home›
  2. API models›
  3. Gemini 2.5 Flash-Lite

Gemini 2.5 Flash-Lite

Atlas Cloud/
StreamingJSON mode

Google's efficient million-context multimodal model for high-volume classification, extraction, and lightweight agents.

Modalities
textimage→text
Price
$0.10 / $0.40/M tok
Context
1M
Providers
Live
PlaygroundProvidersAPIRecipesPricingFAQRequest logs

Playground

Preparing playground
NinjaChat

Every AI. One app.

Download on the App Store

Product

  • Dashboard
  • ninja for iMessage
  • Pricing
  • Free AI Tools
  • Affiliate Program
  • iOS App

Developers

  • API
  • API Models
  • Router
  • MCP / Agents
  • Search API
  • API Pricing
  • Migration Guides
  • API Docs

Models

  • Model Council
  • Seed 1.8
  • Gemini 2.5 Flash
  • Gemini 2.5 Pro
  • Gemini 3 Flash Preview
  • View All Models

Company

  • Blog
  • Uncensored AI
  • Community
  • Careers
  • Support
  • Privacy Policy
  • Terms of Service

Copyright © 2026 NinjaChat AI. Product of Bloon All Rights Reserved.

Tool calling
Vision
Reasoning
Long context
Multilingual
Get an API key

Providers

API

POST/api/v1/chat/completionsOpenAI-compatible
gemini-2.5-flash-lite
curl https://www.ninjachat.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $NINJACHAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-2.5-flash-lite",
    "messages": [{ "role": "user", "content": "Hello!" }],
    "stream": true
  }'
messagestemperaturemax_completion_tokenstop_pstopfrequency_penaltypresence_penaltyseedstreamuserroutingtoolstool_choiceresponse_formatimage_url content partsreasoningreasoning_effort

Recipes for Gemini 2.5 Flash-Lite

Each request below is generated from what Gemini 2.5 Flash-Lite serves on NinjaChat today — the same capabilities and parameters that GET /models reports — so it runs as written with your key.

Stream tokens

Show text as it is generated instead of waiting for the whole completion.

gemini-2.5-flash-lite· stream tokens
# export NINJACHAT_API_KEY="nj_sk_..."   (Developers → Keys)
curl -N https://www.ninjachat.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $NINJACHAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-2.5-flash-lite",
    "messages": [{ "role": "user", "content": "Write a haiku about deploy day." }],
    "stream": true,
    "stream_options": { "include_usage": true }
  }'
  • The response is Server-Sent Events: each data: line carries one chat.completion.chunk and the stream ends with data: [DONE]. Both SDKs parse that for you and stop at the sentinel.
  • With stream_options.include_usage the last chunk before [DONE] has an empty choices array and a usage object with the billed token counts, so guard on choices.length before reading a delta.
  • Keep curl -N so the buffer is not held back; the final usage chunk also carries cost_usd for this request.

Call a tool

Let the model decide when to call your function and hand you typed arguments.

gemini-2.5-flash-lite· call a tool
# export NINJACHAT_API_KEY="nj_sk_..."   (Developers → Keys)
curl https://www.ninjachat.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $NINJACHAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-2.5-flash-lite",
    "messages": [{ "role": "user", "content": "Do I need an umbrella in Lisbon today?" }],
    "tools": [{
      "type": "function",
      "function": {
        "name": "get_weather",
        "description": "Current weather for a city",
        "parameters": {
          "type": "object",
          "properties": { "city": { "type": "string" } },
          "required": ["city"]
        }
      }
    }],
    "tool_choice": "auto"
  }'

Send an image

Ask questions about a photo, screenshot, or chart in the same chat request.

gemini-2.5-flash-lite· send an image
# export NINJACHAT_API_KEY="nj_sk_..."   (Developers → Keys)
curl https://www.ninjachat.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $NINJACHAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-2.5-flash-lite",
    "messages": [{
      "role": "user",
      "content": [
        { "type": "text", "text": "What is wrong with this dashboard?" },
        { "type": "image_url", "image_url": { "url": "https://example.com/dashboard.png", "detail": "high" } }
      ]
    }],
    "max_completion_tokens": 400
  }'
  • content becomes an array of parts: text parts and image_url parts (up to 20 per message). The URL can be public HTTPS or a data:image/...;base64, URL of up to 7 MB.

Get strict JSON

Have the model return an object that matches your schema, so you can parse it without cleanup.

gemini-2.5-flash-lite· get strict json
# export NINJACHAT_API_KEY="nj_sk_..."   (Developers → Keys)
curl https://www.ninjachat.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $NINJACHAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-2.5-flash-lite",
    "messages": [{ "role": "user", "content": "Extract the invoice: ACME Ltd billed 1,240.50 EUR." }],
    "response_format": {
      "type": "json_schema",
      "json_schema": {
        "name": "invoice",
        "strict": true,
        "schema": {
          "type": "object",
          "properties": {
            "vendor": { "type": "string" },
            "total": { "type": "number" },
            "currency": { "type": "string" }
          },
          "required": ["vendor", "total", "currency"],
          "additionalProperties": false
        }
      }
    }
  }'

Long context

Put a whole document in the prompt — the window is 1,048,576 tokens — and cap the answer.

gemini-2.5-flash-lite· long context
# export NINJACHAT_API_KEY="nj_sk_..."   (Developers → Keys)
DOC=$(jq -Rs . < contract.txt)      # the whole file as one JSON string
curl https://www.ninjachat.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $NINJACHAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"model\": \"gemini-2.5-flash-lite\",
    \"messages\": [
      { \"role\": \"system\", \"content\": \"Answer only from the document.\" },
      { \"role\": \"user\", \"content\": $DOC },
      { \"role\": \"user\", \"content\": \"List every termination clause with its section number.\" }
    ],
    \"max_completion_tokens\": 1200,
    \"routing\": { \"caching\": \"auto\" }
  }"
  • The context window is 1,048,576 tokens, shared between everything you send and the answer; keep the document first and the question last, and set max_completion_tokens so a long input cannot run up an unbounded output.

Pricing

Input
$0.10/M tokens
Cached input
$0.01/M tokens
Output
$0.40/M tokens

More from Gemini

Model
ProvidersContextLatencyUptime30d volumePrice · in / out
Gemini 2.5 Flash
gemini-2.5-flash
1M$0.30/$2.50
Gemini 2.5 Pro
gemini-2.5-pro
1M$1.25/$10.00
Gemini 3 Flash
gemini-3-flash
1M$0.50/$3.00
Gemini 3 Pro
gemini-3-pro
1M$2.00/$12.00
Gemini 3.1 Flash Lite
gemini-3.1-flash-lite
1M$0.25/$1.50
Gemini 3.1 ProNew
gemini-3.1-pro
1M$2.00/$12.00

FAQ

How much does the Gemini 2.5 Flash-Lite API cost?

Gemini 2.5 Flash-Lite costs $0.1 per 1M input tokens and $0.4 per 1M output tokens on NinjaChat, billed per token with no subscription. Cached input is $0.01 per 1M tokens.

What is the context window of Gemini 2.5 Flash-Lite?

Gemini 2.5 Flash-Lite accepts up to 1M tokens of context per request and returns up to 33K output tokens.

Which providers serve Gemini 2.5 Flash-Lite on NinjaChat?

Gemini 2.5 Flash-Lite is served through Atlas Cloud. Requests use one NinjaChat key and one balance.

What does Gemini 2.5 Flash-Lite support?

Gemini 2.5 Flash-Lite supports streaming, JSON mode, tool calling, image input, reasoning, long context, and multilingual use. It is suited to cost- and latency-sensitive applications, multi-step reasoning and analysis, tool-calling agents and workflows, and image and document understanding.

How do I call Gemini 2.5 Flash-Lite through the API?

Send a POST to /api/v1/chat/completions with model "gemini-2.5-flash-lite" in the body. The endpoint is OpenAI-compatible, so the official OpenAI SDKs work after changing the base URL and key.

  • tool_choice: "auto" lets the model answer directly when no tool is needed; "required" forces at least one call, and { "type": "function", "function": { "name": "get_weather" } } pins a specific one.
  • Arguments arrive as a JSON string in function.arguments, never as an object — parse before use. Send your result back as a tool message with the same tool_call_id, then call again for the natural-language answer.
  • Up to 32 tools per request; set parallel_tool_calls: false when your functions must run one at a time.
detail: "low"
sends a downscaled image for cheaper, faster answers;
"high"
keeps the resolution for reading small text and charts. Image input is billed as input tokens on this model's rates.
  • json_schema with strict: true constrains the output to your schema; mark every property required and set additionalProperties: false so the object is exactly what you parse.
  • { "type": "json_object" } is the looser form — valid JSON with no schema. Whichever you use, message.content is the JSON string; parse it, do not regex it.
  • routing.caching: "auto"
    turns on provider-native prompt caching for a stable prefix. When you ask several questions over the same document, cache reads are billed at this model's cached-input rate and show up separately in
    usage
    .
  • Each message part is capped at 100,000 characters; split a larger document across consecutive user messages.