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

# Generate speech audio

> Generate speech audio. See the Audio API guide for limits, lifecycle and examples.

See the [Audio API guide](/api-reference/elevenlabs/overview) for request examples, limits, billing and delivery behavior.


## OpenAPI

````yaml openapi/audio.yaml POST /audio/speech
openapi: 3.1.0
info:
  title: GENGEN Audio API
  version: 1.0.0
  description: >-
    Speech, dialogue, complete-turn WebSocket sessions, voices and completion
    webhooks. See the Audio API guide for frame format and signature
    verification.
servers:
  - url: https://gengen.farm/api/gengen/v1
security:
  - bearerAuth: []
paths:
  /audio/speech:
    post:
      tags:
        - Text to Speech
      summary: Generate speech audio
      description: >-
        Generate speech audio. See the Audio API guide for limits, lifecycle and
        examples.
      operationId: audio-speech
      parameters:
        - name: Idempotency-Key
          in: header
          schema:
            type: string
            minLength: 1
            maxLength: 128
          description: >-
            Reuse the same key and body after a timeout to recover accepted work
            without generating or charging twice.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  enum:
                    - eleven_v3
                    - eleven_v4
                    - eleven_v4_turbo
                mode:
                  type: string
                  enum:
                    - text_to_speech
                    - text_to_dialogue
                  default: text_to_speech
                prompt:
                  type: string
                  description: >-
                    Speech text. Maximum 2,000 Unicode code points including
                    whitespace and tags across the request.
                dialogue:
                  type: array
                  items:
                    type: object
                    properties:
                      text:
                        type: string
                      voiceId:
                        type: string
                    required:
                      - text
                      - voiceId
                  maxItems: 100
                  description: >-
                    v3/v4 only; at most ten distinct voices. Omit prompt and
                    controls.voiceId.
                controls:
                  type: object
                  properties:
                    voiceId:
                      type: string
                    outputFormat:
                      type: string
                      enum:
                        - mp3_44100_128
                        - pcm_24000
                      default: mp3_44100_128
                    languageCode:
                      type: string
                      pattern: ^[a-zA-Z]{2,3}$
                  required: []
                  additionalProperties: false
                providerOptions:
                  type: object
                  properties:
                    elevenlabs:
                      type: object
                      properties:
                        seed:
                          type: integer
                          minimum: 0
                          maximum: 4294967295
                        applyTextNormalization:
                          type: string
                          enum:
                            - auto
                            - 'on'
                            - 'off'
                      required: []
                  required: []
                webhookEndpointId:
                  type: string
                stream:
                  type: boolean
                  default: false
              required:
                - model
              additionalProperties: false
              example:
                model: eleven_v4
                prompt: Hello, welcome to GENGEN.
                controls:
                  voiceId: JBFqnCBsd6RMkjVDRZzb
                  outputFormat: mp3_44100_128
      responses:
        '200':
          description: Success
          content:
            audio/mpeg:
              schema:
                type: string
                format: binary
            application/octet-stream:
              schema:
                type: string
                format: binary
          headers:
            x-gengen-task-id:
              schema:
                type: string
              description: >-
                Durable task ID; poll it for measured usage and final
                settlement.
        default:
          description: Request failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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