Gemini 3.5 Flash Lite
Fast, low-cost model with optional reasoning (off by default).
- by Google
- Text
- $0.30 / $2.50 per M
- ChatStreamingReasoning
On this page
1.Call
OpenAI-compatible chat completions; works with the official OpenAI SDKs. Every response carries an x-request-id trace ID.
curl https://api.ewest.ai/v1/chat/completions \
-H "Authorization: Bearer $EWEST_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "ewest/gemini-flash", "stream": true,
"messages": [{"role": "user", "content": "Hello!"}]}'2.Authentication
Send your API key in the Authorization: Bearer header, as the examples above do (clients built for the Anthropic API can use x-api-key). Create keys under API keys. Keep the key on your server, never in browser code. More in the authentication guide.
3.Files
Put files in the request: an image as a public https URL or a base64 data URI in an image_url message part, a PDF as a data URI in a file part, audio as an input_audio part. There is no separate upload endpoint. See Files for limits and formats.
4.Schema
What you send and what comes back, for ewest/gemini-flash. The output tables are read from the API's OpenAPI description.
Input
POST /v1/chat/completions- The model id,
modelstringRequiredewest/gemini-flash. - The conversation so far: objects with
messagesarrayRequiredrole(system, user, assistant) andcontent. - Send the answer as Server-Sent Events while it is written.
streambooleanOptionaldefaultfalse - Most tokens to generate. The context window is 1,048,576 tokens.
max_tokensintegerOptional - Randomness, 0 to 2. Lower is more focused.
temperaturenumberOptional - Functions the model may call (OpenAI tool format).
toolsarrayOptional
Output
Returns text. POST /v1/chat/completions answers 200: The completion (JSON), or with stream: true a stream of chat.completion.chunk events ending with data: [DONE].
- Unique id of the completion.
idstringAlways - Always
objectstringAlwayschat.completion. Alwayschat.completion. - Unix seconds when the completion was created.
createdintegerAlways - The model that answered (a fallback, if one did).
modelstringAlways - The answers, one per requested choice.
choicesarray of objectAlways - Position of this choice.
choices[].indexintegerAlways - Why the model stopped:
choices[].finish_reasonstring or nullSometimesstop,length,tool_calls,content_filter. - The assistant's answer.
choices[].messageobjectAlways - Always
choices[].message.rolestringAlwaysassistant. - The text of the answer; null when the model answered with tool calls only.
choices[].message.contentstring or nullSometimes - The model's refusal text, when it declined to answer.
choices[].message.refusalstring or nullSometimes - Tools the model asks you to run.
choices[].message.tool_callsarray of object or nullSometimes - Id of the call; send it back as
choices[].message.tool_calls[].idstringSometimestool_call_idin the tool's result message. - Position of the call in the list.
choices[].message.tool_calls[].indexintegerSometimes - Always
choices[].message.tool_calls[].typestringSometimesfunction. The kind of tool; only functions exist. - The function to run.
choices[].message.tool_calls[].functionobjectAlways (when set) - Name of the function.
choices[].message.tool_calls[].function.namestringSometimes - JSON-encoded arguments.
choices[].message.tool_calls[].function.argumentsstringSometimes - The call of a legacy
choices[].message.function_callobject or nullSometimesfunctionsrequest; newer requests usetool_calls. - Name of the function.
choices[].message.function_call.namestringSometimes - JSON-encoded arguments.
choices[].message.function_call.argumentsstringSometimes - Spoken answer, for models that can reply with audio.
choices[].message.audioobject or nullSometimes - Id of the audio.
choices[].message.audio.idstringSometimes - Base64-encoded audio bytes.
choices[].message.audio.datastringSometimes - Unix seconds after which the audio can no longer be referenced.
choices[].message.audio.expires_atintegerSometimes - Text of the spoken answer.
choices[].message.audio.transcriptstringSometimes - The model's reasoning text, for models that return it.
choices[].message.reasoning_contentstring or nullSometimes - Reasoning blocks, for models that return them.
choices[].message.thinking_blocksarray of object or nullSometimes - Annotations on the text, such as URL citations, where the model gives them.
choices[].message.annotationsarray of object or nullSometimes - Images the model generated, for models with image output.
choices[].message.imagesarray of object or nullSometimes - Token log probabilities, when requested.
choices[].logprobsobject or nullSometimes - Token usage of the request.
usageobjectSometimes - Tokens in the input.
usage.prompt_tokensintegerSometimes - Tokens in the output, reasoning tokens included.
usage.completion_tokensintegerSometimes usage.total_tokensintegerSometimesprompt_tokenspluscompletion_tokens.- Breakdown of the input tokens (for example cached or audio tokens), where the model reports one.
usage.prompt_tokens_detailsobject or nullSometimes - Breakdown of the output tokens (for example reasoning tokens), where the model reports one.
usage.completion_tokens_detailsobject or nullSometimes - Input tokens written to the prompt cache, for models with prompt caching.
usage.cache_creation_input_tokensinteger or nullSometimes - Input tokens read from the prompt cache, for models with prompt caching.
usage.cache_read_input_tokensinteger or nullSometimes - Identifies the model configuration that answered, when the model reports one.
system_fingerprintstring or nullSometimes - The service tier that handled the request, when the model reports one.
service_tierstring or nullSometimes
Sample response
{
"id": "chatcmpl-0000",
"object": "chat.completion",
"created": 1793530277,
"model": "ewest/gemini-flash",
"choices": [
{
"index": 0,
"finish_reason": "stop",
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
}
}
],
"usage": {
"prompt_tokens": 9,
"completion_tokens": 9,
"total_tokens": 18
}
}5.Details
- Context window
- 1,048,576 tokens
- API
- OpenAI-compatible chat completions, streaming