# Multi-turn conversations

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1beta/models/gemini-2.0-flash:generateContent:
    post:
      summary: Multi-turn conversations
      deprecated: false
      description: >-
        The Gemini SDK lets you collect multiple rounds of questions and
        responses into a chat. The chat format enables users to step
        incrementally toward answers and to get help with multipart problems.
        This SDK implementation of chat provides an interface to keep track of
        conversation history, but behind the scenes it uses the same
        [`generateContent`](https://ai.google.dev/api/generate-content#method:-models.generatecontent)
        method to create the response.


        The following code example shows a basic chat implementation:
      tags:
        - Model Capabilities/Text generation
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                contents:
                  type: array
                  items:
                    type: object
                    properties:
                      role:
                        type: string
                      parts:
                        type: array
                        items:
                          type: object
                          properties:
                            text:
                              type: string
                          required:
                            - text
                          x-apidog-orders:
                            - text
                    required:
                      - role
                      - parts
                    x-apidog-orders:
                      - role
                      - parts
              required:
                - contents
              x-apidog-orders:
                - contents
            example:
              contents:
                - role: user
                  parts:
                    - text: Hello
                - role: model
                  parts:
                    - text: Great to meet you. What would you like to know?
                - role: user
                  parts:
                    - text: >-
                        I have two dogs in my house. How many paws are in my
                        house?
      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-16240703-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: []

```
