> ## 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 Pro Preview (Stream)

> 通过 Gemini API 调用 Google Gemini 3 Pro Preview 流式输出。支持 SSE 实时 Token 流式传输。

Gemini 3 Pro Preview (Stream) 提供基于 Google Gemini 3 Pro Preview 模型的流式文本生成服务，通过 Anyfast 代理访问。响应通过 Server-Sent Events (SSE) 实时传输。

## 核心能力

* **SSE 流式输出** — 实时逐 Token 传输响应
* **思考模式** — 支持思考配置以增强推理能力
* **多轮对话** — 支持系统指令的复杂对话
* **安全过滤** — 可配置的内容安全过滤器

## 快速示例

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://www.anyfast.ai/v1beta/models/gemini-3-pro-preview:streamGenerateContent?key=YOUR_API_KEY&alt=sse" \
    -H "Content-Type: application/json" \
    -d '{
      "contents": [
        {
          "role": "user",
          "parts": [{ "text": "写一首关于大海的短诗。" }]
        }
      ],
      "generationConfig": {
        "temperature": 1,
        "topP": 1,
        "thinkingConfig": {
          "includeThoughts": true,
          "thinkingBudget": 26240
        }
      }
    }'
  ```

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

  url = "https://www.anyfast.ai/v1beta/models/gemini-3-pro-preview:streamGenerateContent"
  params = {"key": "YOUR_API_KEY", "alt": "sse"}
  data = {
      "contents": [
          {
              "role": "user",
              "parts": [{"text": "写一首关于大海的短诗。"}]
          }
      ],
      "generationConfig": {
          "temperature": 1,
          "topP": 1,
          "thinkingConfig": {
              "includeThoughts": True,
              "thinkingBudget": 26240
          }
      }
  }

  response = requests.post(url, params=params, json=data, stream=True)
  for line in response.iter_lines():
      if line:
          print(line.decode())
  ```
</CodeGroup>

## 参数说明

| 参数                                | 类型     | 必填 | 说明                     |
| --------------------------------- | ------ | -- | ---------------------- |
| `key`                             | string | 是  | API 密钥（查询参数）           |
| `alt`                             | string | 否  | 设为 `sse` 以启用 SSE 流式输出  |
| `contents`                        | array  | 是  | `{ role, parts }` 对象数组 |
| `systemInstruction`               | object | 否  | 包含 `parts` 数组的系统指令     |
| `generationConfig.temperature`    | float  | 否  | `0`–`2`，控制随机性，默认 `1`   |
| `generationConfig.topP`           | float  | 否  | 核采样阈值，默认 `1`           |
| `generationConfig.thinkingConfig` | object | 否  | 思考模式配置                 |
| `safetySettings`                  | array  | 否  | 内容安全过滤设置               |

<Card title="API 参考" icon="code" href="/zh/api-reference/model-api/google/gemini-3-pro-preview-stream">
  查看 Gemini 3 Pro Preview (Stream) 的交互式 API Playground。
</Card>

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