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

# Synthesize speech audio

> Generates speech for one chunk of text (max 900 bytes, see getTtsVoices' maxChunkBytes) and returns raw `audio/mpeg` bytes.

Long documents are read by splitting them into sentence-aligned chunks and requesting them in sequence.

Identical requests from the same user are served from a server-side cache. `voice` is one of the names returned by `getTtsVoices`, `style` one of its style keys (default `natural`).



## OpenAPI

````yaml post /tts/speech
openapi: 3.1.0
info:
  title: HERO API
  version: current
  description: |-
    The HERO REST API.

    See https://developers.myhero.so for the rendered docs.
servers:
  - url: https://app.myhero.so
security: []
paths:
  /tts/speech:
    post:
      tags:
        - TTS
      summary: Synthesize speech audio
      description: >-
        Generates speech for one chunk of text (max 900 bytes, see getTtsVoices'
        maxChunkBytes) and returns raw `audio/mpeg` bytes.


        Long documents are read by splitting them into sentence-aligned chunks
        and requesting them in sequence.


        Identical requests from the same user are served from a server-side
        cache. `voice` is one of the names returned by `getTtsVoices`, `style`
        one of its style keys (default `natural`).
      operationId: synthesizeSpeechAudio
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                text:
                  type: string
                  minLength: 1
                  maxLength: 900
                voice:
                  type: string
                  enum:
                    - Achernar
                    - Aoede
                    - Autonoe
                    - Callirrhoe
                    - Despina
                    - Erinome
                    - Gacrux
                    - Kore
                    - Laomedeia
                    - Leda
                    - Pulcherrima
                    - Sulafat
                    - Vindemiatrix
                    - Zephyr
                    - Achird
                    - Algenib
                    - Algieba
                    - Alnilam
                    - Charon
                    - Enceladus
                    - Fenrir
                    - Iapetus
                    - Orus
                    - Puck
                    - Rasalgethi
                    - Sadachbia
                    - Sadaltager
                    - Schedar
                    - Umbriel
                    - Zubenelgenubi
                style:
                  type: string
                  enum:
                    - natural
                    - narration
                    - formal
                    - expressive
                languageCode:
                  type: string
                  pattern: ^[a-zA-Z]{2,3}(-[a-zA-Z0-9]{2,8})*$
              required:
                - text
      responses:
        '200':
          description: MP3 audio
          content:
            audio/mpeg:
              schema:
                type: string
                format: binary
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: |-
                      Error class name (e.g.

                      ValidationError, NotFound)
                  message:
                    type: string
                    description: Human-readable error message
                  details:
                    type: array
                    items: {}
                required:
                  - error
                  - message
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: |-
                      Error class name (e.g.

                      ValidationError, NotFound)
                  message:
                    type: string
                    description: Human-readable error message
                  details:
                    type: array
                    items: {}
                required:
                  - error
                  - message
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: HERO personal access token

````

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