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

# Gemini 2.5 Flash Lite

> 通过 Gemini API 调用 Google Gemini 2.5 Flash Lite。轻量高效的文本生成。

Gemini 2.5 Flash Lite 是 Google 2.5 系列中最轻量高效的语言模型，通过 Anyfast 以原生 Gemini API 提供服务。适合对响应速度和成本敏感的大规模场景。

## 核心能力

* **原生 Gemini API** — 使用 Google 原生 API 格式，完整功能访问
* **超高效率** — Gemini 2.5 系列中延迟最低、成本最低
* **多轮对话** — 支持系统指令的对话
* **高吞吐量** — 适合大规模、成本敏感型工作负载

## 快速示例

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://www.anyfast.ai/v1beta/models/gemini-2.5-flash-lite:generateContent?key=YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "contents": [
        {
          "role": "user",
          "parts": [{ "text": "用简单的语言解释量子计算。" }]
        }
      ],
      "generationConfig": {
        "temperature": 1,
        "topP": 1
      }
    }'
  ```

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

  url = "https://www.anyfast.ai/v1beta/models/gemini-2.5-flash-lite:generateContent"
  params = {"key": "YOUR_API_KEY"}
  data = {
      "contents": [
          {
              "role": "user",
              "parts": [{"text": "用简单的语言解释量子计算。"}]
          }
      ],
      "generationConfig": {
          "temperature": 1,
          "topP": 1
      }
  }

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

## 参数说明

| 参数                             | 类型     | 必填 | 说明                     |
| ------------------------------ | ------ | -- | ---------------------- |
| `key`                          | string | 是  | API 密钥（查询参数）           |
| `contents`                     | array  | 是  | `{ role, parts }` 对象数组 |
| `systemInstruction`            | object | 否  | 包含 `parts` 数组的系统指令     |
| `generationConfig.temperature` | float  | 否  | `0`–`2`，控制随机性，默认 `1`   |
| `generationConfig.topP`        | float  | 否  | 核采样阈值，默认 `1`           |

<Card title="API 参考" icon="code" href="/zh/api-reference/model-api/google/gemini-2.5-flash-lite">
  查看 Gemini 2.5 Flash Lite 的交互式 API Playground。
</Card>

<script src="/feedback.js" />
