Gemini All-Model API - OpenAI-Compatible Format
Select the Gemini text model to call via model in the request body (see the reference table for the model parameter for all available values).
- Uses the OpenAI SDK / Chat Completions format and returns conversation content synchronously
- Plain text / multimodal input: mixed text + image input (
messages[].content) - Streaming: set
stream: trueto return content chunk by chunk
Model specs and differences
- Sampling / penalty parameters
temperature/top_p/frequency_penalty/presence_penalty: consistent across the entire Gemini 3.x series, custom values do not affect the output; atemperature/top_pvalue outside the range returns a 400, andfrequency_penalty/presence_penaltyare filtered out by the gateway (no error is raised). - Thinking control
reasoning_effort:minimal/low/medium/high(see thereasoning_effortparameter for the levels supported and the default of each model); effective only for the Gemini 3.x series. - Last-turn role: the
roleof the last message must not beassistant(Gemini 3.5+ will error). - Token limits:
gemini-3.6-flash/gemini-3.5-flash-litehave a context window of 1,048,576 and a maximum output of 65,536; other models follow their respective specs.
https://direct.evolink.ai, which has better support for text models and long-lived connections. https://api.evolink.ai is the primary endpoint for multimodal services and serves as a fallback address for text models.Authorizations
##All APIs require Bearer Token authentication##
Get API Key:
Visit API Key Management Page to get your API Key
Add to request header:
Body
Select the Gemini text model to call:
gemini-3.6-flash, gemini-3.5-flash, gemini-3.5-flash-lite, gemini-3.1-pro-preview, gemini-3.1-pro-preview-customtools, gemini-3.1-flash-lite-preview, gemini-3-pro-preview, gemini-3-flash-preview, gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-lite "gemini-3.6-flash"
List of chat messages, supports multi-turn dialogue and multimodal input
1Whether to return response in streaming mode
true: Streaming return, receives content in real-time chunksfalse: Returns complete response at once
false
Maximum number of completion tokens for the generated response, corresponding to Gemini's maxOutputTokens.
gemini-3.6-flash / gemini-3.5-flash-lite have a limit of 65,536 tokens; other models follow their respective specs.
1 <= x <= 655362000
Maximum number of tokens for the generated response, compatible with the legacy OpenAI parameter.
1 <= x <= 655362000
Sampling temperature, controls output randomness
Description:
- Lower values (e.g., 0.2): More deterministic, focused output
- Higher values (e.g., 1.5): More random, creative output
⚠️ Consistent across the entire Gemini 3.x series (does not vary by model): custom values within the valid range do not affect the output; a value outside this parameter's valid range returns a 400 rather than being silently ignored.
0 <= x <= 20.7
Nucleus Sampling parameter
Description:
- Controls sampling from tokens within the top cumulative probability
- For example, 0.9 means selecting from tokens whose cumulative probability reaches 90%
- Default: 0.95
Recommendation: Do not adjust temperature and top_p simultaneously
⚠️ Consistent across the entire Gemini 3.x series (does not vary by model): custom values within the valid range do not affect the output; a value outside this parameter's valid range returns a 400 rather than being silently ignored.
0 <= x <= 10.9
Frequency penalty coefficient. Range: -2.0 to 2.0. Corresponds to Gemini's frequencyPenalty.
⚠️ Consistent across the entire Gemini 3.x series: passed values are filtered out by the gateway and have no effect (no error is raised).
-2 <= x <= 20
Presence penalty coefficient. Range: -2.0 to 2.0. Corresponds to Gemini's presencePenalty.
⚠️ Consistent across the entire Gemini 3.x series: passed values are filtered out by the gateway and have no effect (no error is raised).
-2 <= x <= 20
Stop sequences. Supports a string or string array, corresponding to Gemini's stopSequences.
Number of candidates to generate
⚠️ Gemini 3.x only supports 1; passing >1 returns a 400 (equivalent to the candidateCount that has been removed from the native API).
1 <= x <= 11
Limits the thinking effort, corresponding to Gemini's thinking level:
minimal: near-zero thinking, high throughput / low latencylow: less thinking, simple tasksmedium: balanced quality and speedhigh: deep multi-step reasoning
Effective only for the Gemini 3.x series, with different supported levels and defaults per model (consistent with the native API):
minimal, low, medium, high "minimal"
Random seed used to make output as reproducible as possible, corresponding to Gemini's seed.
12345
Response format settings, supporting JSON mode and JSON Schema, corresponding to Gemini's responseMimeType, responseSchema and responseJsonSchema.
- Option 1
- Option 2
Streaming response options. Can be set when stream is true.
List of tool definitions for Function Calling.
Controls tool-calling behavior.
none, auto, required Gemini extension parameters.
Response
Chat completion generated successfully
Unique identifier for the chat completion
"chatcmpl-20251010015944503180122WJNB8Eid"
Model name actually used
"gemini-3.6-flash"
Response type
chat.completion "chat.completion"
Creation timestamp
1760032810
List of chat completion choices
Token usage statistics