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

# Gemini 2.5 Flash

> 通过 Gemini API 调用 Google Gemini 2.5 Flash，支持 Google 搜索增强。

Gemini 2.5 Flash 是 Google 的快速高效模型，集成 Google 搜索功能，通过 Starrise AI 以原生 Gemini API 提供服务。可以使用实时搜索结果增强回复。

## 核心能力

* **Google 搜索增强** — 使用实时网络搜索增强回复
* **文档处理** — 处理和分析文档
* **多模态输入** — 接受文本和文件输入
* **快速推理** — 针对速度和效率优化

## 快速示例

```bash cURL theme={null}
curl "https://dayu.cdn-fly.com/v1beta/models/gemini-2.5-flash:generateContent?key=YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "role": "user",
        "parts": [{ "text": "今天有什么AI相关的最新新闻？" }]
      }
    ],
    "tools": [{ "googleSearch": {} }]
  }'
```

```python Python theme={null}
import requests

url = "https://dayu.cdn-fly.com/v1beta/models/gemini-2.5-flash:generateContent"
params = {"key": "YOUR_API_KEY"}
data = {
    "contents": [
        {
            "role": "user",
            "parts": [{"text": "今天有什么AI相关的最新新闻？"}]
        }
    ],
    "tools": [{"googleSearch": {}}]
}

response = requests.post(url, params=params, json=data)
result = response.json()
print(result["candidates"][0]["content"]["parts"][0]["text"])
```

## 参数说明

| 参数 | 类型 | 必填 | 说明 |
| - | - | - | - |
| `key` | string | 是 | API 密钥（查询参数） |
| `contents` | array | 是 | `{ role, parts }` 对象数组 |
| `tools` | array | 否 | 包含 `{ "googleSearch": {} }` 以启用搜索 |

> **[API 参考](/zh/api-reference/model-api/google/gemini-2-5-flash)**
>
> 查看 Gemini 2.5 Flash 的交互式 API Playground。


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