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

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

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

## 核心能力

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

## 快速示例

```bash cURL theme={null}
curl "https://dayu.cdn-fly.com/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://dayu.cdn-fly.com/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())
```

## 参数说明

| 参数 | 类型 | 必填 | 说明 |
| - | - | - | - |
| `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 | 否 | 内容安全过滤设置 |

> **[API 参考](/zh/api-reference/model-api/google/gemini-3-pro-preview-stream)**
>
> 查看 Gemini 3 Pro Preview (Stream) 的交互式 API Playground。


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