altrouter.ai
Models/Google/Gemini 3.1 Flash Lite
GM

Google: Gemini 3.1 Flash Lite

Textgemini-3.1-flash-lite

The cheapest, fastest Gemini for high-volume tasks, 1M context.

API docs
Playgroundgemini-3.1-flash-lite
Temperature
Top-p
Max tokens
Seed
Frequency penalty
Presence penalty
Throughput161 tok/s
24hnow
Latency1.18 s
24hnow
Specifications
Authorgoogle
ModalityText
Context1M tokens
Input$0.22/M tokens$0.25/M tokens
Output$1.35/M tokens$1.50/M tokens
Savings10%
Capabilitiestool calling, image input
Quick start
from openai import OpenAI

client = OpenAI(
    base_url="https://api.altrouter.ai/v1",
    api_key="ar-...",
)

resp = client.chat.completions.create(
    model="gemini-3.1-flash-lite",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)

Same OpenAI-compatible endpoint — just swap base_url and key.

API

OpenAI-compatible chat completions endpoint, with SSE streaming.

POST/v1/chat/completions
Body parameters
modelstringrequired"gemini-3.1-flash-lite"
The model id.
messagesarrayrequired
The conversation: [{ role, content }].
streambooleandefault false
Stream the response over SSE.
temperaturenumber0–2default 1
Sampling randomness: lower is more deterministic, higher more creative.
top_pnumber0–1default 1
Nucleus sampling — the probability mass to sample from.
max_tokensnumber1–32000
Maximum tokens to generate.
seednumber0–2147483647
Seed for reproducibility.
frequency_penaltynumber-2–2
Penalizes tokens by their existing frequency.
presence_penaltynumber-2–2
Penalizes tokens that have already appeared.

Structured fields (tools, response_format, stop and more) are in the full parameter reference.

Response
idstring
Completion id.
choicesarray
Completions. Each: index, message { role, content, reasoning_content, tool_calls }, finish_reason.
usageobject
Tokens: prompt_tokens, completion_tokens, total_tokens.
Example
cURLPythonJSON
curl https://api.altrouter.ai/v1/chat/completions \
  -H "Authorization: Bearer ar-..." \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gemini-3.1-flash-lite",
  "messages": [
    {
      "role": "user",
      "content": "Hello!"
    }
  ]
}'
Errors
400Invalid request.
401Missing or invalid API key.
402Insufficient credits, or the key’s spending cap is exhausted.
404Model not found.
429Rate limit exceeded.
More from Google
Gemini 2.5 Flash
gemini-2.5-flash
Gemini 3 Flash
gemini-3-flash
Gemini 3.5 Flash
gemini-3.5-flash
Gemini 2.5 Pro
gemini-2.5-pro
Gemini 3.1 Pro
gemini-3.1-pro
Gemini 3 Pro
gemini-3-pro
Nano Banana Fast
nano-banana-fast
Nano Banana
nano-banana
Nano Banana 2
nano-banana-2
Nano Banana Pro
nano-banana-pro
Veo 3.1
veo-3.1
Veo 3.1 Fast
veo-3.1-fast