gemini-3.1-flash-lite-preview API
Run Google Gemini text generation on Openrouter API with a lightweight preview model and OpenAI-compatible requests.
gemini-3.1-flash-lite-previewgemini-3.1-flash-lite-preview API pricing
All prices in USD. Openrouter API rates compared with the official list price for the same unit.
| Token type | Openrouter API | Official | Save |
|---|---|---|---|
| Input per 1M tokens | $0.22 | $0.25 | −12% |
| Output per 1M tokens | $1.32 | $1.50 | −12% |
What is gemini-3.1-flash-lite-preview?
Google's gemini-3.1-flash-lite-preview is a Gemini chat model available through Openrouter API. Its Flash Lite name positions it as a lighter, faster, lower-cost tier, suited to everyday text-generation workflows rather than a guaranteed performance level. Developers can evaluate it for conversational assistants, document summaries, and drafting tasks. It accepts conversation messages with role and content fields and generates text responses, with maximum input of 1,048,576 tokens and maximum output of 65,536 tokens.
Use Openrouter API's OpenAI-compatible base URL, https://openrouterapi.ru/v1, and select the exact model ID in a Chat Completions request. The documented interface offers streaming, output-length controls, and sampling parameters such as temperature and top_p. Openrouter API charges pay-as-you-go rates of $0.22 per 1M input tokens and $1.32 per 1M output tokens, billing only successful requests. The default configuration is about 12% below the developer's list price. As a preview model, it may change.
gemini-3.1-flash-lite-preview highlights
Large Input Budget
The model supports up to 1,048,576 input tokens, allowing substantial text context in a request.
Controlled Output Length
Maximum output is 65,536 tokens. Use max_tokens to set a smaller generation budget for your application.
Streaming Chat Responses
The documented Chat Completions interface supports streaming responses in SSE format or a complete response at once.
Below List Pricing
Openrouter API input costs $0.22 per 1M tokens; output costs $1.32 per 1M tokens. The default configuration is about 12% below the developer's list price.
How to call the gemini-3.1-flash-lite-preview API in 4 steps
- 01
Get an API key
Sign in to Openrouter API, top up from $50, and create an sk-ora key in the console.
- 02
Set the base URL
Use https://openrouterapi.ru/v1 as the base URL in your SDK or HTTP client.
- 03
Send the request
Call POST /v1/chat/completions with "model": "gemini-3.1-flash-lite-preview" and the parameters below.
- 04
Handle the response
Read the response (or stream tokens with stream: true). Usage and cost appear in your console.
Request examples
Documentation: General Chat API (Default Streaming)curl https://openrouterapi.ru/v1/chat/completions \
-H "Authorization: Bearer $OPENROUTERAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-3.1-flash-lite-preview",
"messages": [
{"role": "system", "content": "You are a concise assistant."},
{"role": "user", "content": "Explain what an AI API gateway does in two sentences."}
],
"stream": false
}'Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Required | gpt-5 | Model name |
messages | array | Required | — | List of conversation messages |
role | string | Required | user | Role type |
content | string | Required | — | Message content |
temperature | number | Optional | — | Controls output randomness, range 0-2 |
max_tokens | integer | Optional | — | Maximum number of tokens to generate |
stream | boolean | Optional | — | Whether to use streaming output |
top_p | number | Optional | — | Nucleus sampling parameter, range 0-1 |
frequency_penalty | number | Optional | — | Frequency penalty, range -2.0 to 2.0 |
presence_penalty | number | Optional | — | Presence penalty, range -2.0 to 2.0 |
stop | string or array | Optional | — | Stop sequences |
n | integer | Optional | — | Number of completions to generate |
What you can build with gemini-3.1-flash-lite-preview
Conversational Assistants
Build text-based assistants using system instructions and user messages. Include previous assistant responses to supply multi-turn conversation context.
Document Summaries
Provide long text inputs and request concise summaries with a defined format and output budget. Validate important details against the source.
Content Drafting
Evaluate this lightweight-positioned tier for drafting emails, support replies, or internal documentation from supplied instructions.
Text Review Workflows
Ask the model to review supplied text for clarity or suggest revisions. Set explicit criteria in the system prompt and review the generated recommendations.
Tips for better results
- 01
Select the Exact Model
Set the model parameter to
gemini-3.1-flash-lite-previewrather than relying on the API's default model. Authenticate with your Openrouter API key using a Bearer token. - 02
Budget Generated Tokens
Set max_tokens to the length your task needs, within the 65,536-token output maximum. Input and output tokens have separate prices, so account for both when estimating costs.
- 03
Tune One Sampling Control
Use a lower temperature, such as 0.2, for more deterministic output. The documentation recommends adjusting either temperature or top_p rather than both.
- 04
Choose Response Delivery
Set stream explicitly: true for SSE output or false to receive the complete response at once. This avoids depending on endpoint defaults.
Limits and things to know
Maximum input is 1,048,576 tokens per request.
Maximum output is 65,536 tokens per request.
The preview name indicates that the model may change.
gemini-3.1-flash-lite-preview API FAQ
How much does gemini-3.1-flash-lite-preview cost on Openrouter API?
Openrouter API charges $0.22 per 1M input tokens and $1.32 per 1M output tokens. Developer list prices are $0.25 per 1M input tokens and $1.50 per 1M output tokens; the default configuration is about 12% below list price. Billing is pay-as-you-go and only for successful requests.
How do I call this model through Openrouter API?
Use https://openrouterapi.ru/v1 as your OpenAI-compatible base URL and send a POST request to /chat/completions. Set model to gemini-3.1-flash-lite-preview, include a messages array, and authenticate with an Openrouter API Bearer token.
Which generation parameters can I use?
The documented chat interface includes temperature, top_p, max_tokens, stream, frequency_penalty, presence_penalty, stop, and n. Messages contain role and content fields, with user, assistant, and system roles.
What are the input and output token limits?
Maximum input is 1,048,576 tokens and maximum output is 65,536 tokens. Set max_tokens to limit generation to your application's required length.
Can I use this model commercially?
Commercial use is subject to the model developer's terms. Review the applicable Google terms and Openrouter API documentation before deploying it in a commercial product.
How does Flash Lite Preview compare with Gemini Pro models?
By naming convention, Flash Lite is positioned as a lighter, faster, lower-cost tier, while Pro is positioned as a higher-capability tier. No comparative benchmarks are provided here, and the preview designation means the model may change.
Related models
gemini-3-flash-preview
gemini-3-flash-preview-nothinking
gemini-3-flash-preview-thinking
gemini-3-pro-preview
gemini-3-pro-preview-thinking
gemini-3.1-pro-preview
gemini-3.1-pro-preview-thinking
gemini-3.5-flash
Start building with gemini-3.1-flash-lite-preview
One key, pay as you go from $50, billed only for successful requests.
