gemini
Latest: v0.3.0
Added
- Document gemini-4-argon Chat Completions and native streaming with chat-only, thinking, context, and media boundaries.
- Document gemini-4-carbon for Chat Completions and native Gemini streaming, including single-turn tools and the chat-only capability boundary.
- Document gemini-4-hydrogen with native buffered and streaming output, Chat JSON and SSE, four thinking levels, a ten-file media limit, and single-turn function declarations.
- Document gemini-4-neon Chat Completions and native streaming with chat-only, thinking, context, and media boundaries.
Changed
- State Hydrogen restrictions for hosted search, tool-result history, continuation, and agent workflows.
Gemini on RunAPI
Use Gemini contents at https://runapi.ai with generateContent or
streamGenerateContent as the primary protocol.
Primary protocol recipe
Authenticate
Set GEMINI_API_KEY to a RunAPI API key and the Gemini client base URL to
https://runapi.ai. Raw requests send the key with x-goog-api-key.
Send request
curl -X POST \
"https://runapi.ai/v1beta/models/gemini-3.7-flash:streamGenerateContent" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"contents":[{"role":"user","parts":[{"text":"Summarize this review."}]}]}'
Use generateContent only when the selected model supports synchronous output;
gemini-3.7-flash accepts only streamGenerateContent. For this model, native
tools are limited to functionDeclarations and the googleSearch tool with an
empty object payload;
native thinking is limited to generationConfig.thinkingConfig.includeThoughts
and thinkingLevel of low or high.
Gemini 4 Neon boundaries
Use gemini-4-neon with native streamGenerateContent, or Chat Completions
with messages and optional stream: true. RunAPI bridges Responses, Messages,
and synchronous generateContent through Chat Completions. Gemini requests use
contents. This model supports chat only. Agent loops, function tools, and search
are not verified public capabilities.
Input, thinking, and output share 1,048,576 tokens. The default output budget is
65,536 tokens, including thinking. Set native
generationConfig.thinkingConfig.thinkingLevel, or compatible
reasoning_effort, to low, medium, high, or xhigh. The default is high.
minimal is ignored. temperature, topP, and topK have no effect.
Send at most ten media files per request. Compatible messages use image_url
for all media types. Native parts use file_data or inline_data. Requests
exceeding these limits are rejected. Requests return a response or stream with
terminal Usage; there is no task polling or callback.
Gemini 4 Argon boundaries
Use gemini-4-argon with native streamGenerateContent, or Chat Completions
with messages and optional stream: true. RunAPI bridges Responses, Messages,
and synchronous generateContent through Chat Completions. Gemini requests use
contents. This model supports chat only. Agent loops, function tools, and search
are not verified public capabilities.
Input, thinking, and output share 1,048,576 tokens. The default synchronous
output budget is 65,536 tokens, including thinking. Set native
generationConfig.thinkingConfig.thinkingLevel, or compatible
reasoning_effort, to low or high, with optional includeThoughts /
include_thoughts.
Send at most ten media files per request. Compatible messages use image_url
for all media types. Native parts use file_data or inline_data. Requests
exceeding these limits are rejected. Requests return a response or stream with
terminal Usage; there is no task polling or callback.
Verify result
For gemini-4-hydrogen, both generation methods are available. Send nonempty
contents. Set generationConfig.thinkingConfig.thinkingLevel to low,
medium, high, or xhigh; omitting it uses high. includeThoughts is
optional. Text and up to 10 media files are accepted through inlineData or
fileData. Single-turn custom functionDeclarations are supported. Hosted
search, function response history, continuation, and agent workflows are
unsupported. Load the compatibility reference for Chat fields.
Require candidate content, terminal finishReason, and usageMetadata. A
stream is complete only after the terminal candidate and Usage; an HTTP 2xx
without both is incomplete.
Stop boundaries
Correct a rejected shape once using the structured error. Retry transport once only before any candidate or Usage and when replay is safe. Record a terminal error and stop without changing model or protocol.
Gemini 4 Carbon uses streamGenerateContent for native output and Chat
Completions for synchronous or streaming output. It supports single-turn tool
declarations, with low, medium and high reasoning levels. The default is
medium. Agent loops, stateful continuation and tool-result replay are
unsupported. Send at most 10 input files.
Compatibility protocols
Load compatibility protocols only when an existing client requires OpenAI-compatible Chat Completions.
Supported models
| Model ID | Use when |
|---|---|
gemini-4-hydrogen | Text and up to 10 media files; four thinking levels, single-turn function declarations, no hosted tools or agent workflows |
gemini-4-carbon | Multimodal chat and native SSE with single-turn tools; agent loops and tool-result replay are unsupported |
gemini-4-neon | Chat Completions with synchronous or streaming output and native Gemini streaming; chat only, agent use unverified |
gemini-4-argon | Chat Completions with synchronous or streaming output and native Gemini streaming; chat only, agent use unverified |
gemini-3.8-flash | Fast text-only chat and function calling; image, audio, and file input are rejected |
gemini-3.7-flash | Fast streaming chat; use native tools/search grounding only with Gemini contents |
gemini-3.6-flash | Fast current-generation multimodal requests |
gemini-3.5-flash | Fast multimodal and function-calling requests |
gemini-3.5-flash-lite | Lightweight text generation with native Gemini streaming |
gemini-3.1-pro-preview | Complex multimodal and reasoning requests |
gemini-3.1-flash-lite | Lightweight text-only requests; image, audio, and file input are rejected |
gemini-3-flash-preview | Preview flash workloads |
gemini-2.5-pro | Stable high-quality multimodal requests |
gemini-2.5-flash | Stable fast multimodal requests |
gemini-2.5-flash-lite | Lightweight text-only requests; image, audio, and file input are rejected |
