Introduction
OpenAI-compatible chat for Gemini 3 Flash Preview. A 256,000-token read window, three reasoning-effort levels, 128 tool schemas and JSON output on one synchronous call, with SSE streaming when you ask for it.
Gemini 3 Flash Preview is Google's lightweight chat model, published here as a single OpenAI-compatible endpoint. A low unit price and a fast first token make it the one to reach for in turn-by-turn roleplay and interactive fiction: it reads up to 256,000 tokens, answers in up to 65,536, and offers three reasoning-effort levels, tool calling and JSON output.
Key features & highlights
The lane for high-frequency short turns
In a scene that runs hundreds of turns an hour, what people feel is the unit price and the time to first token, not the model's peak ability. That is the job this one is here for: cheap enough that every line from every player can go through a model, fast enough that the conversation never stalls on a spinner.
Decide per turn whether to think twice
low, medium and high, with medium as the default. Keep the routine exchange on low for a faster first token and raise the one turn that has to tie off a thread to high. It is a string on the same request body, so switching costs nothing in integration.
It can change under you
A preview model's lifecycle belongs to Google, and behaviour or availability can shift without notice. Decide which model this one falls back to before the day it is withdrawn.
Request parameters
| Parameter | Required | Description |
|---|---|---|
messages | Yes | Ordered turns, oldest first. Content is a string, or an array of text, |
max_tokens | No | Caps the reply at 65,536; the default is 16,384. For turn-by-turn play, 300 to 800 stops the model from answering with a whole chapter. |
reasoning_effort | No | minimal, low, medium or high; medium is the default. Routine turns run fine on low, and the turn that has to land can be raised to high on its own. |
stop | No | Up to 4 sequences, as a string or an array. The reply ends as soon as the model writes one of them, and the matched text itself is left out. at least 1 characters · at least 1 items · at most 4 items |
seed | No | Any integer. |
temperature | No | 0 to 2, default 1. |
top_p | No | 0.01 to 1. Adjust this or temperature, never both in the same comparison. |
tools | No | Up to 128 function definitions per request. at most 128 items |
tool_choice | No | auto, none, required, or an object naming one function. |
response_format | No | Ask for a JSON object and name every key in the system message - this is how branching options come back parseable. |
Pricing
Input $0.45 / Output $2.70 per 1 million tokens
Use cases
Turn-by-turn roleplay
Keep the character sheet, the world rules and the tone in one system message and send only the new line each turn. At hundreds of turns an hour, the unit price and the time to first token decide how the scene feels far more than the model's ceiling does.
Narration and branching options
Ask for the next beat plus three choices, request a JSON object with response_format and name every key in the system message so the shape of the options stays stable. Every screen of a text adventure is this one call.
Tiering a long session
Send the routine exchanges here and send the turns that matter - a reveal, a confrontation, forty turns folded into a paragraph - to a more expensive model. Both are OpenAI-shaped, so only the model id changes.
Bulk labelling and cleanup
Tagging chat logs, rewriting summaries, folding free text into fixed fields. These are jobs where the price per call, not peak reasoning, decides whether they are worth running at all.
Prompt guide & pro tips
Character in system, scene in user
The character sheet, the world rules and the narration style belong in one system message; each turn only appends the new user line and the assistant's reply. Holding the system message steady is what lets you tell which line changed the voice.
Switch effort per turn, not per integration
Run the routine back-and-forth on low for a faster first token, then send the turn that resolves something at high. Same endpoint, same body, one string different.
Limits to plan around
The reply ceiling is 65,536 tokens and a max_tokens above it fails validation outright. Message content is text, images, video and audio. Uploaded video and audio can total 14 MB per request. A JSON response_format shapes the reply but your application still parses and validates it. This is a preview model - Google can change or withdraw it, so pick the model you would fall back to before it carries production traffic.
API quick start
curl --fail-with-body -sN https://api.spicyapi.ai/v1/chat/completions \
-H "Authorization: Bearer $SPICY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "google/gemini-3-flash-preview/chat",
"messages": [
{
"role": "user",
"content": "Summarise the following release notes into three bullet points."
}
],
"stream": true
}' \
| jq --unbuffered -Rrj 'select(startswith("data: ")) | .[6:] | select(. != "[DONE]") | fromjson | if .error then "\n[error] \(.error.message)\n" else (.choices[0].delta.content? // empty) end'
See the API reference for authentication, the complete schema, polling, and error handling.












