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

# 流式生成内容

> 以 SSE 流式返回 Gemini generateContent 输出。

请求体与 [生成内容](/zh/api-reference/gemini/generate-content) 相同，响应改为 SSE 流。

<ParamField path="model" type="string" required>
  Gemini 模型 ID，例如 `gemini-3-flash-preview`。
</ParamField>

```bash theme={"dark"}
curl "https://api.pipellm.ai/v1beta/models/gemini-3-flash-preview:streamGenerateContent" \
  -H "Content-Type: application/json" \
  -H "x-goog-api-key: $PIPELLM_API_KEY" \
  -N \
  -d '{
    "contents": [
      {
        "role": "user",
        "parts": [{"text": "从 1 数到 5。"}]
      }
    ]
  }'
```

使用 `x-goog-api-key: $PIPELLM_API_KEY`。原生 Gemini 路由只会打到 Gemini 平台。要保留 Gemini 格式去调用 OpenAI 或 Anthropic，使用 [Gemini converter](/zh/converter/gemini-format)。


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