back
loading skill details...
Call Gemini 2.5, 3, and 4 series models through RunAPI using Gemini contents clients. Use for Gemini chat, streaming, multimodal input, grounding, structured output, reasoning, or an existing compatibility client that needs the conditional reference.
---
name: gemini
description: Call Gemini 2.5, 3, and 4 series models through RunAPI using Gemini contents clients. Use for Gemini chat, streaming, multimodal input, grounding, structured output, reasoning, or an existing compatibility client that needs the conditional reference.
documentation: https://runapi.ai/models/gemini.md
provider_page: https://runapi.ai/providers/google.md
catalog: https://runapi.ai/models.md
metadata:
openclaw:
homepage: https://runapi.ai/models/gemini
primaryEnv: GEMINI_API_KEY
requires:
env: [GEMINI_API_KEY, GEMINI_BASE_URL]
envVars:
- {name: GEMINI_API_KEY, required: true, description: RunAPI API key used by Gemini contents clients.}
- {name: GEMINI_BASE_URL, required: true, description: Set to https://runapi.ai for Gemini on RunAPI.}
---
# 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
```bash
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.
[Pricing](https://runapi.ai/models/gemini/4-carbon.md)
## Compatibility protocols
Load [compatibility protocols](references/compatibility-protocols.md) 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 |
## References
- <https://runapi.ai/models/gemini.md>
- <https://runapi.ai/providers/google.md>
- <https://runapi.ai/models.md>
don't have the plugin yet? install it then click "run inline in claude" again.