> ## 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 3.5 Flash-Lite

> 通过原生 Gemini API 调用 Google Gemini 3.5 Flash-Lite，适用于高吞吐量智能体、文档解析和结构化提取。

Gemini 3.5 Flash-Lite 是 Google Gemini 3.5 系列中速度最快、成本最低的模型。它通过原生 Gemini API 提供服务，适合高吞吐量子智能体执行、文档解析、数据提取、路由和分类任务。

## 核心能力

* **100 万 token 上下文** - 最多 1,048,576 个输入 token 和 65,536 个输出 token
* **多模态输入** - 支持文本、图片、视频、音频和 PDF 输入，输出文本
* **高吞吐量** - 针对低延迟文档解析和批量提取优化
* **子智能体执行** - 改进代码执行、搜索和多步工作流中的工具可靠性
* **结构化提取** - 擅长文档理解、表格处理和 JSON 输出
* **工具能力** - 函数调用、代码执行、文件搜索、Google 搜索、Google 地图、网址上下文和结构化输出
* **思考等级** - 默认为 `minimal`；自主工具调用和多步推理可使用 `medium` 或 `high`

## 快速示例

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://www.anyfast.ai/v1beta/models/gemini-3.5-flash-lite:generateContent?key=YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "contents": [
        {
          "role": "user",
          "parts": [{ "text": "将发票编号、日期和总金额提取为 JSON。" }]
        }
      ],
      "generationConfig": {
        "thinkingConfig": {
          "thinkingLevel": "minimal"
        },
        "responseMimeType": "application/json",
        "maxOutputTokens": 1024
      }
    }'
  ```

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

  response = requests.post(
      "https://www.anyfast.ai/v1beta/models/gemini-3.5-flash-lite:generateContent",
      params={"key": "YOUR_API_KEY"},
      json={
          "contents": [{
              "role": "user",
              "parts": [{"text": "将发票编号、日期和总金额提取为 JSON。"}],
          }],
          "generationConfig": {
              "thinkingConfig": {"thinkingLevel": "minimal"},
              "responseMimeType": "application/json",
              "maxOutputTokens": 1024,
          },
      },
  )
  response.raise_for_status()
  print(response.json()["candidates"][0]["content"]["parts"][0]["text"])
  ```
</CodeGroup>

## API 变更

<Warning>
  请勿传入 `temperature`、`topP` 或 `topK`。Google 已在 Gemini 3.6 Flash 和 Gemini 3.5 Flash-Lite 中弃用这些采样参数。同时请移除 `candidateCount` 和旧版 `thinkingBudget` 配置。
</Warning>

请求不能以非空的 `model` 角色轮次结尾。对话必须以非空的 `user` 轮次结束，否则 API 返回 HTTP 400。

## 参数说明

| 参数                                              | 类型      | 必填 | 说明                               |
| ----------------------------------------------- | ------- | -- | -------------------------------- |
| `key`                                           | string  | 是  | 查询参数中的 API 密钥                    |
| `contents`                                      | array   | 是  | 包含文本或多模态内容的对话轮次                  |
| `systemInstruction`                             | object  | 否  | 包含 `parts` 数组的系统指令               |
| `generationConfig.thinkingConfig.thinkingLevel` | string  | 否  | `minimal`（默认）、`medium` 或 `high`  |
| `generationConfig.maxOutputTokens`              | integer | 否  | 最大输出 token 数，上限 65,536           |
| `generationConfig.responseMimeType`             | string  | 否  | 输出 MIME 类型，例如 `application/json` |
| `generationConfig.responseSchema`               | object  | 否  | 用于结构化输出的 JSON Schema             |

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

## 官方参考

* [Gemini 3.5 Flash-Lite 模型页面](https://ai.google.dev/gemini-api/docs/models/gemini-3.5-flash-lite?hl=zh-cn)
* [最新 Gemini 模型和迁移指南](https://ai.google.dev/gemini-api/docs/latest-model?hl=zh-cn)

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