# Gemini

> Call Gemini 2.5 and 3 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.

- Skill: `runapi-ai/gemini` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add runapi-ai/gemini`
- Raw SKILL.md: https://api.skillmd.com/api/skills/runapi-ai/gemini/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: runapi-ai (https://skillmd.com/u/runapi-ai)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/runapi-ai/gemini

---


# 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`.

### Verify result

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.

## 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-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.1-pro-preview` | Complex multimodal and reasoning requests |
| `gemini-3-flash-preview` | Preview flash workloads |
| `gemini-2.5-pro` | Stable high-quality multimodal requests |
| `gemini-2.5-flash` | Stable fast multimodal requests |

## References

- <https://runapi.ai/models/gemini.md>
- <https://runapi.ai/providers/google.md>
- <https://runapi.ai/models.md>

