> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omniall.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Gemini 接口

> Omniall AI 上的 Google Gemini generateContent API。

# Gemini 接口

Omniall AI 上的 Gemini 原生路径：

| 动作 | 端点 |
| - | - |
| 非流式 | `POST /v1beta/models/{model}:generateContent` |
| 流式 | `POST /v1beta/models/{model}:streamGenerateContent` |

鉴权：`Authorization: Bearer sk-...`，或 `x-goog-api-key` / `?key=`。

若模型广场以 OpenAI 兼容方式开放，也可走 `POST /v1/chat/completions`。

| 场景 | 用法 |
| - | - |
| 文本对话 | `contents[].parts[].text` |
| 图像识别 | `inlineData`（base64） |
| 文件分析 | `fileData.fileUri` 或 Chat 的 `type: file` |
| 联网 / Grounding | `tools: [{ "googleSearch": {} }]`（需支持） |
| Agent | `tools[].functionDeclarations` |
| 图像生成 | `generationConfig.responseModalities` 含 `IMAGE` |
| 香蕉 2.1 参考生图 | `gemini-nano-banana-2.1`；`inlineData` 支持图片 / `application/pdf` / `video/mp4`；Chat 可用 `image_url` / `file` / `video_url` |
| 香蕉 2.1 Thinking | 原生 `generationConfig.thinkingConfig.thinkingLevel`；Chat `extra_body.google.thinking_config.thinking_level`；档位 `minimal` / `medium`（默认）/ `high` |

生图详情：[Gemini原生格式](/zh-CN/api-reference/endpoints/gemini-native-image)、[Chat 生图](/zh-CN/api-reference/endpoints/gemini-chat-image)。

官方文档：[generateContent](https://ai.google.dev/api/generate-content)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.