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

# /v1beta/models/{model}:streamGenerateContent

> 증분 Gemini 생성 이벤트를 스트리밍합니다.

このエンドポイントは、Gemini ストリーミング テキストの生成と増分イベント出力に使用します。

* 一般的な認証パターンは `x-goog-api-key: {API_KEY}` ですが、クエリ文字列 API キーもサポートされています
* リクエスト構造は `generateContent` とほぼ同じで、コア フィールドは `contents` です。
* 応答は、最終的な JSON ペイロードではなく、イベント ストリームです。
* 終了状態と安全性のメタデータは、後のチャンクでのみ完成する可能性があります


## OpenAPI

````yaml POST /v1beta/models/{model}:streamGenerateContent
openapi: 3.1.0
info:
  title: OpenAPI Plant Store
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://maas.apigo.ai
security:
  - bearerAuth: []
paths:
  /v1beta/models/{model}:streamGenerateContent:
    post:
      summary: Gemini streamGenerateContent
      description: Streams incremental Gemini generation events.
      parameters:
        - name: model
          in: path
          description: Gemini model name.
          required: true
          schema:
            type: string
            example: gemini-2.5-pro
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GeminiGenerateContentRequest'
      responses:
        '200':
          description: Successful Gemini streaming response
          content:
            text/event-stream:
              schema:
                type: string
              example: |+
                data: {"candidates":[{"content":{"parts":[{"text":"这里是第一段"}]}}]}

        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - googleApiKey: []
components:
  schemas:
    GeminiGenerateContentRequest:
      type: object
      required:
        - contents
      properties:
        contents:
          type: array
          items:
            $ref: '#/components/schemas/GeminiContent'
        systemInstruction:
          $ref: '#/components/schemas/GeminiContent'
        generationConfig:
          $ref: '#/components/schemas/GeminiGenerationConfig'
        safetySettings:
          type: array
          items:
            $ref: '#/components/schemas/GeminiSafetySetting'
        tools:
          type: array
          items:
            type: object
            additionalProperties: true
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
    GeminiContent:
      type: object
      properties:
        role:
          type: string
        parts:
          type: array
          items:
            $ref: '#/components/schemas/GeminiPart'
    GeminiGenerationConfig:
      type: object
      properties:
        temperature:
          type: number
        topP:
          type: number
        maxOutputTokens:
          type: integer
        responseMimeType:
          type: string
    GeminiSafetySetting:
      type: object
      properties:
        category:
          type: string
        threshold:
          type: string
    GeminiPart:
      type: object
      properties:
        text:
          type: string
        inlineData:
          $ref: '#/components/schemas/GeminiInlineData'
        fileData:
          $ref: '#/components/schemas/GeminiFileData'
    GeminiInlineData:
      type: object
      properties:
        mimeType:
          type: string
        data:
          type: string
    GeminiFileData:
      type: object
      properties:
        mimeType:
          type: string
        fileUri:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    googleApiKey:
      type: apiKey
      in: header
      name: x-goog-api-key

````