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

# Gemini Stream Generate Content

> V1Beta Models Model Generatecontent



## OpenAPI

````yaml /openapi/gemini.json post /v1beta/models/{model}:streamGenerateContent
openapi: 3.0.0
info:
  title: Gemini AI
  version: 1.0.0
  description: API reference for Gemini AI on Ace Data Cloud.
servers:
  - url: https://api.acedata.cloud
    description: Ace Data Cloud API
security:
  - bearerAuth: []
paths:
  /v1beta/models/{model}:streamGenerateContent:
    post:
      summary: Gemini Stream Generate Content
      description: V1Beta Models Model Generatecontent
      parameters:
        - name: model
          in: path
          required: true
          schema:
            type: string
            enum:
              - gemini-2.0-flash
              - gemini-2.5-flash
              - gemini-2.5-flash-lite
              - gemini-2.5-pro
              - gemini-3-flash-preview
              - gemini-3.5-flash
              - gemini-3.0-pro
              - gemini-3.1-pro
              - gemini-3.1-flash-lite-preview
              - gemini-3.1-flash-image
              - gemini-2.5-flash-image
              - gemini-3-pro-image
            example: gemini-2.5-flash
          description: V1Beta Models Model Generatecontent Param Model 2
        - name: alt
          in: query
          required: false
          schema:
            type: string
            enum:
              - sse
          description: V1Beta Models Model Generatecontent Param Alt
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - contents
              properties:
                contents:
                  type: array
                  description: V1Beta Models Model Generatecontent Contents
                  items:
                    type: object
                    required:
                      - parts
                    properties:
                      role:
                        type: string
                        enum:
                          - user
                          - model
                        description: V1Beta Models Model Generatecontent Contents Role
                      parts:
                        type: array
                        description: V1Beta Models Model Generatecontent Contents Parts
                        items:
                          type: object
                          properties:
                            text:
                              type: string
                              description: >-
                                V1Beta Models Model Generatecontent Contents
                                Parts Text
                            inlineData:
                              type: object
                              description: >-
                                V1Beta Models Model Generatecontent Contents
                                Parts Inlinedata
                              properties:
                                mimeType:
                                  type: string
                                  description: >-
                                    V1Beta Models Model Generatecontent Contents
                                    Parts Inlinedata Mimetype
                                data:
                                  type: string
                                  description: >-
                                    V1Beta Models Model Generatecontent Contents
                                    Parts Inlinedata Data
                            fileData:
                              type: object
                              description: >-
                                V1Beta Models Model Generatecontent Contents
                                Parts Filedata
                              properties:
                                mimeType:
                                  type: string
                                fileUri:
                                  type: string
                            functionCall:
                              type: object
                              description: >-
                                V1Beta Models Model Generatecontent Contents
                                Parts Functioncall
                              properties:
                                name:
                                  type: string
                                args:
                                  type: object
                            functionResponse:
                              type: object
                              description: >-
                                V1Beta Models Model Generatecontent Contents
                                Parts Functionresponse
                              properties:
                                name:
                                  type: string
                                response:
                                  type: object
                systemInstruction:
                  type: object
                  description: V1Beta Models Model Generatecontent Systeminstruction
                  properties:
                    parts:
                      type: array
                      items:
                        type: object
                        properties:
                          text:
                            type: string
                generationConfig:
                  type: object
                  description: V1Beta Models Model Generatecontent Generationconfig
                  properties:
                    stopSequences:
                      type: array
                      items:
                        type: string
                      description: >-
                        V1Beta Models Model Generatecontent Generationconfig
                        Stopsequences
                    responseMimeType:
                      type: string
                      description: >-
                        V1Beta Models Model Generatecontent Generationconfig
                        Responsemimetype
                      enum:
                        - text/plain
                        - application/json
                        - text/x.enum
                    responseSchema:
                      type: object
                      description: >-
                        V1Beta Models Model Generatecontent Generationconfig
                        Responseschema
                    responseModalities:
                      type: array
                      items:
                        type: string
                        enum:
                          - TEXT
                          - IMAGE
                          - AUDIO
                      description: >-
                        V1Beta Models Model Generatecontent Generationconfig
                        Responsemodalities
                    candidateCount:
                      type: integer
                      description: >-
                        V1Beta Models Model Generatecontent Generationconfig
                        Candidatecount
                    maxOutputTokens:
                      type: integer
                      description: >-
                        V1Beta Models Model Generatecontent Generationconfig
                        Maxoutputtokens
                    temperature:
                      type: number
                      description: >-
                        V1Beta Models Model Generatecontent Generationconfig
                        Temperature
                      minimum: 0
                      maximum: 2
                    topP:
                      type: number
                      description: >-
                        V1Beta Models Model Generatecontent Generationconfig
                        Topp
                    topK:
                      type: integer
                      description: >-
                        V1Beta Models Model Generatecontent Generationconfig
                        Topk
                    seed:
                      type: integer
                      description: >-
                        V1Beta Models Model Generatecontent Generationconfig
                        Seed
                    presencePenalty:
                      type: number
                      description: >-
                        V1Beta Models Model Generatecontent Generationconfig
                        Presencepenalty
                    frequencyPenalty:
                      type: number
                      description: >-
                        V1Beta Models Model Generatecontent Generationconfig
                        Frequencypenalty
                    thinkingConfig:
                      type: object
                      description: >-
                        V1Beta Models Model Generatecontent Generationconfig
                        Thinkingconfig
                      properties:
                        includeThoughts:
                          type: boolean
                          description: >-
                            V1Beta Models Model Generatecontent Generationconfig
                            Thinkingconfig Includethoughts
                        thinkingBudget:
                          type: integer
                          description: >-
                            V1Beta Models Model Generatecontent Generationconfig
                            Thinkingconfig Thinkingbudget
                    imageConfig:
                      type: object
                      description: >-
                        V1Beta Models Model Generatecontent Generationconfig
                        Imageconfig
                      properties:
                        aspectRatio:
                          type: string
                          description: >-
                            V1Beta Models Model Generatecontent Generationconfig
                            Imageconfig Aspectratio
                        imageSize:
                          type: string
                          enum:
                            - '512'
                            - 1K
                            - 2K
                            - 4K
                          description: >-
                            V1Beta Models Model Generatecontent Generationconfig
                            Imageconfig Imagesize
                    speechConfig:
                      type: object
                      description: >-
                        V1Beta Models Model Generatecontent Generationconfig
                        Speechconfig
                tools:
                  type: array
                  description: V1Beta Models Model Generatecontent Tools
                  items:
                    type: object
                    properties:
                      functionDeclarations:
                        type: array
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                            description:
                              type: string
                            parameters:
                              type: object
                          required:
                            - name
                      codeExecution:
                        type: object
                        description: >-
                          V1Beta Models Model Generatecontent Tools
                          Codeexecution
                      googleSearch:
                        type: object
                        description: V1Beta Models Model Generatecontent Tools Googlesearch
                      urlContext:
                        type: object
                        description: V1Beta Models Model Generatecontent Tools Urlcontext
                toolConfig:
                  type: object
                  description: V1Beta Models Model Generatecontent Toolconfig
                  properties:
                    functionCallingConfig:
                      type: object
                      properties:
                        mode:
                          type: string
                          enum:
                            - MODE_UNSPECIFIED
                            - AUTO
                            - ANY
                            - NONE
                        allowedFunctionNames:
                          type: array
                          items:
                            type: string
                safetySettings:
                  type: array
                  description: V1Beta Models Model Generatecontent Safetysettings
                  items:
                    type: object
                    properties:
                      category:
                        type: string
                        enum:
                          - HARM_CATEGORY_HARASSMENT
                          - HARM_CATEGORY_HATE_SPEECH
                          - HARM_CATEGORY_SEXUALLY_EXPLICIT
                          - HARM_CATEGORY_DANGEROUS_CONTENT
                          - HARM_CATEGORY_CIVIC_INTEGRITY
                      threshold:
                        type: string
                        enum:
                          - BLOCK_NONE
                          - BLOCK_ONLY_HIGH
                          - BLOCK_MEDIUM_AND_ABOVE
                          - BLOCK_LOW_AND_ABOVE
                          - 'OFF'
                cachedContent:
                  type: string
                  description: V1Beta Models Model Generatecontent Cachedcontent
      responses:
        '200':
          description: V1Beta Models Model Generatecontent Response 200 2
          content:
            text/event-stream:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    candidates:
                      type: array
                      items:
                        type: object
                        properties:
                          content:
                            type: object
                            properties:
                              parts:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    text:
                                      type: string
                                    thought:
                                      type: boolean
                                      description: >-
                                        V1Beta Models Model Generatecontent
                                        Response 200 Candidates Parts Thought
                              role:
                                type: string
                          finishReason:
                            type: string
                            enum:
                              - STOP
                              - MAX_TOKENS
                              - SAFETY
                              - RECITATION
                              - LANGUAGE
                              - OTHER
                              - BLOCKLIST
                              - PROHIBITED_CONTENT
                              - SPII
                              - MALFORMED_FUNCTION_CALL
                          index:
                            type: integer
                          safetyRatings:
                            type: array
                            items:
                              type: object
                              properties:
                                category:
                                  type: string
                                probability:
                                  type: string
                                blocked:
                                  type: boolean
                    usageMetadata:
                      type: object
                      properties:
                        promptTokenCount:
                          type: integer
                        candidatesTokenCount:
                          type: integer
                        totalTokenCount:
                          type: integer
                        thoughtsTokenCount:
                          type: integer
                        promptTokensDetails:
                          type: array
                          items:
                            type: object
                            properties:
                              modality:
                                type: string
                              tokenCount:
                                type: integer
                        candidatesTokensDetails:
                          type: array
                          items:
                            type: object
                            properties:
                              modality:
                                type: string
                              tokenCount:
                                type: integer
                    modelVersion:
                      type: string
                    responseId:
                      type: string
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API token from https://platform.acedata.cloud

````