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

# Create Speech

> Generate speech audio from text.

Generates audio from the input text using text-to-speech models. Supports multiple
voices and output formats including mp3, opus, aac, flac, wav, and pcm.

Returns streaming audio data that can be saved to a file or streamed directly to users.



## OpenAPI

````yaml /openapi.json post /v1/audio/speech
openapi: 3.1.0
info:
  title: Dedalus API
  description: >-
    MCP gateway for AI agents. Mix-and-match any model with any tool from our
    marketplace.


    ## Authentication

    Use Bearer token or X-API-Key header authentication:

    ```

    Authorization: Bearer your-api-key-here

    ```

    ```

    x-api-key: your-api-key-here

    ```


    ## Available Endpoints

    - **GET /v1/models**: list available models

    - **POST /v1/chat/completions**: Chat completions with MCP tools

    - **GET /health**: Service health check
  version: 0.0.1
servers:
  - url: https://api.dedaluslabs.ai
    description: Official Dedalus API
security: []
paths:
  /v1/audio/speech:
    post:
      tags:
        - V1
        - Audio
      summary: Create Speech
      description: >-
        Generate speech audio from text.


        Generates audio from the input text using text-to-speech models.
        Supports multiple

        voices and output formats including mp3, opus, aac, flac, wav, and pcm.


        Returns streaming audio data that can be saved to a file or streamed
        directly to users.
      operationId: create_speech_v1_audio_speech_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SpeechRequest'
        required: true
      responses:
        '200':
          description: Audio file stream
          content:
            audio/mpeg:
              schema:
                type: string
                format: binary
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Bearer: []
      x-codeSamples:
        - lang: typescript
          label: Typescript
          source: |-
            const client = new Dedalus();

            const result = await client.audio.speech.create({ ...params });
        - lang: python
          label: Python
          source: |-
            client = Dedalus()

            result = client.audio.speech.create(**params)
        - lang: go
          label: Go
          source: >-
            client := dedalus.NewClient()


            result, err := client.Audio.Speech.New(ctx, body
            githubcomdedaluslabsdedalussdkgo.AudioSpeechNewParams)
components:
  schemas:
    SpeechRequest:
      properties:
        model:
          anyOf:
            - type: string
            - type: string
              enum:
                - tts-1
                - tts-1-hd
                - gpt-4o-mini-tts
                - gpt-4o-mini-tts-2025-12-15
          title: Model
          description: >-
            One of the available [TTS models](/docs/models#tts): `tts-1`,
            `tts-1-hd`, `gpt-4o-mini-tts`, or `gpt-4o-mini-tts-2025-12-15`.
          x-order: 0
        input:
          type: string
          maxLength: 4096
          title: Input
          description: >-
            The text to generate audio for. The maximum length is 4096
            characters.
          x-order: 1
        instructions:
          type: string
          maxLength: 4096
          title: Instructions
          description: >-
            Control the voice of your generated audio with additional
            instructions. Does not work with `tts-1` or `tts-1-hd`.
          x-order: 2
        voice:
          anyOf:
            - type: string
            - type: string
              enum:
                - alloy
                - ash
                - ballad
                - coral
                - echo
                - sage
                - shimmer
                - verse
                - marin
                - cedar
            - $ref: '#/components/schemas/VoiceIdsOrCustomVoiceInline'
          title: Voice
          description: >-
            The voice to use when generating the audio. Supported built-in
            voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`,
            `onyx`, `nova`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`.
            You may also provide a custom voice object with an `id`, for example
            `{ "id": "voice_1234" }`. Previews of the voices are available in
            the [Text to speech
            guide](/docs/guides/text-to-speech#voice-options).
          x-order: 3
        response_format:
          type: string
          enum:
            - mp3
            - opus
            - aac
            - flac
            - wav
            - pcm
          title: Response Format
          description: >-
            The format to audio in. Supported formats are `mp3`, `opus`, `aac`,
            `flac`, `wav`, and `pcm`.
          default: mp3
          x-order: 4
        speed:
          type: number
          maximum: 4
          minimum: 0.25
          title: Speed
          description: >-
            The speed of the generated audio. Select a value from `0.25` to
            `4.0`. `1.0` is the default.
          default: 1
          x-order: 5
        stream_format:
          type: string
          enum:
            - sse
            - audio
          title: Stream Format
          description: >-
            The format to stream the audio in. Supported formats are `sse` and
            `audio`. `sse` is not supported for `tts-1` or `tts-1-hd`.
          default: audio
          x-order: 6
      type: object
      required:
        - model
        - input
        - voice
      title: SpeechRequest
      description: >-
        Schema for SpeechRequest.


        Fields:

        - model (required): str | Literal["tts-1", "tts-1-hd",
        "gpt-4o-mini-tts", "gpt-4o-mini-tts-2025-12-15"]

        - input (required): Annotated[str, StringConstraints(max_length=4096)]

        - instructions (optional): Annotated[str,
        StringConstraints(max_length=4096)]

        - voice (required): VoiceIdsOrCustomVoice

        - response_format (optional): Literal["mp3", "opus", "aac", "flac",
        "wav", "pcm"]

        - speed (optional): float

        - stream_format (optional): Literal["sse", "audio"]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    VoiceIdsOrCustomVoiceInline:
      properties:
        id:
          type: string
          title: Id
          description: The custom voice ID, e.g. `voice_1234`.
          x-order: 0
      type: object
      required:
        - id
      title: VoiceIdsOrCustomVoiceInline
      description: |-
        Custom voice reference.

        Fields:
        - id (required): str
      x-ddls-inline: true
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer

````