# Configuration parameters

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1beta/models/gemini-2.0-flash:generateContent:
    post:
      summary: Configuration parameters
      deprecated: false
      description: >-
        Every prompt you send to the model includes parameters that control how
        the model generates responses. You can configure these parameters, or
        let the model use the default options.
      tags:
        - Model Capabilities/Text generation
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                contents:
                  type: array
                  items:
                    type: object
                    properties:
                      parts:
                        type: array
                        items:
                          type: object
                          properties:
                            text:
                              type: string
                          x-apidog-orders:
                            - text
                    x-apidog-orders:
                      - parts
                generationConfig:
                  type: object
                  properties:
                    stopSequences:
                      type: array
                      items:
                        type: string
                      description: >-
                        指定一组将停止生成输出的字符序列（最多 5 个）。如果指定，API 会在 `stop_sequence`
                        首次出现时停止。停止序列不会包含在响应中。
                    temperature:
                      type: integer
                      description: >-
                        控制输出的随机性。使用较高的值可获得更具创造性的回答，使用较低的值可获得更具确定性的回答。值的范围为 [0.0,
                        2.0]。
                    maxOutputTokens:
                      type: integer
                      description: 设置候选项中包含的词元数上限。
                    topP:
                      type: number
                      description: >-
                        更改模型选择输出词元的方式。系统会按照概率从最高到最低的顺序选择 token，直到所选 token
                        的概率总和等于 `topP` 的值。默认的 `topP` 值为 0.95。
                    topK:
                      type: integer
                      description: >-
                        更改模型选择输出词元的方式。如果 `topK` 设为 1，则表示所选 token 是模型词汇表的所有 token
                        中概率最高的 token；如果 `topK` 设为 3，则表示系统将从 3 个概率最高的 token
                        中选择下一个 token（通过温度确定）。系统会根据 `topP`
                        进一步过滤词元，并使用温度采样选择最终的词元。
                  required:
                    - stopSequences
                    - temperature
                    - maxOutputTokens
                    - topP
                    - topK
                  x-apidog-orders:
                    - stopSequences
                    - temperature
                    - maxOutputTokens
                    - topP
                    - topK
              required:
                - contents
                - generationConfig
              x-apidog-orders:
                - contents
                - generationConfig
            example:
              contents:
                - parts:
                    - text: Explain how AI works
              generationConfig:
                stopSequences:
                  - Title
                temperature: 1
                maxOutputTokens: 800
                topP: 0.8
                topK: 10
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
                x-apidog-orders: []
          headers: {}
          x-apidog-name: 成功
      security:
        - apikey-header-x-goog-api-key: []
      x-apidog-folder: Model Capabilities/Text generation
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/892755/apis/api-16240705-run
components:
  schemas: {}
  securitySchemes:
    apikey-header-x-goog-api-key:
      type: apiKey
      in: header
      name: x-goog-api-key
servers:
  - url: https://generativelanguage.googleapis.com
    description: Prod Env
security:
  - apikey-header-x-goog-api-key: []

```
