Speechify Text-to-Speech API

Synthesizes lifelike speech from plain text or SSML via POST /v1/audio/speech, returning base64-encoded audio (wav, mp3, ogg, aac, or pcm) plus speech marks for word-level timing, using the simba-english or simba-multilingual models across 30+ languages.

OpenAPI Specification

speechify-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Speechify Voice API
  description: >-
    Specification of the Speechify Voice API (Text-to-Speech). The API
    synthesizes lifelike speech from plain text or SSML in 30+ languages,
    supports non-streaming and streaming audio, lists available voices, and
    creates and deletes instant voice clones. All requests authenticate with a
    Bearer API key.
  termsOfService: https://speechify.com/terms/
  contact:
    name: Speechify Support
    url: https://docs.sws.speechify.com
  version: '1.0'
servers:
  - url: https://api.sws.speechify.com
security:
  - bearerAuth: []
paths:
  /v1/audio/speech:
    post:
      operationId: createSpeech
      tags:
        - Audio
      summary: Convert text to speech
      description: >-
        Synthesizes speech for the given input and returns a JSON object with
        base64-encoded audio data, the audio format, the billable character
        count, and speech marks describing word-level timing.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetSpeechRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSpeechResponse'
        '401':
          description: Unauthorized - missing or invalid API key.
        '422':
          description: Unprocessable entity - invalid request parameters.
  /v1/audio/stream:
    post:
      operationId: streamSpeech
      tags:
        - Audio
      summary: Stream text to speech
      description: >-
        Synthesizes speech for the given input and returns the raw audio as a
        chunked HTTP stream for low-latency playback. The response content type
        is selected with the Accept header. WAV is not available for streaming;
        use /v1/audio/speech for WAV output.
      parameters:
        - name: Accept
          in: header
          required: false
          description: >-
            Desired audio container for the streamed response. Allowed values
            are audio/mpeg, audio/ogg, audio/aac, or audio/pcm.
          schema:
            type: string
            enum:
              - audio/mpeg
              - audio/ogg
              - audio/aac
              - audio/pcm
            default: audio/mpeg
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetStreamRequest'
      responses:
        '200':
          description: A chunked stream of synthesized audio bytes.
          headers:
            Transfer-Encoding:
              schema:
                type: string
              description: chunked
          content:
            audio/mpeg:
              schema:
                type: string
                format: binary
            audio/ogg:
              schema:
                type: string
                format: binary
            audio/aac:
              schema:
                type: string
                format: binary
            audio/pcm:
              schema:
                type: string
                format: binary
        '401':
          description: Unauthorized - missing or invalid API key.
        '422':
          description: Unprocessable entity - invalid request parameters.
  /v1/voices:
    get:
      operationId: listVoices
      tags:
        - Voices
      summary: List voices
      description: >-
        Returns the available voices, including pre-set Speechify voices and
        any personal cloned voices on the account.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Voice'
        '401':
          description: Unauthorized - missing or invalid API key.
    post:
      operationId: createVoice
      tags:
        - Voices
      summary: Create a voice clone
      description: >-
        Creates an instant personal voice clone from a 10-30 second audio
        sample. Requires explicit consent identifying the person who owns the
        voice. Submitted as multipart/form-data.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateVoiceRequest'
      responses:
        '200':
          description: The created personal voice.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Voice'
        '401':
          description: Unauthorized - missing or invalid API key.
        '422':
          description: Unprocessable entity - invalid sample or missing consent.
  /v1/voices/{id}:
    delete:
      operationId: deleteVoice
      tags:
        - Voices
      summary: Delete a voice
      description: Deletes a personal (cloned) voice by its id.
      parameters:
        - name: id
          in: path
          required: true
          description: The id of the personal voice to delete.
          schema:
            type: string
      responses:
        '204':
          description: The voice was deleted.
        '401':
          description: Unauthorized - missing or invalid API key.
        '404':
          description: The voice was not found.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Pass your Speechify API key as a Bearer token in the Authorization
        header, e.g. "Authorization: Bearer $SPEECHIFY_API_KEY".
  schemas:
    GetSpeechRequest:
      type: object
      required:
        - input
        - voice_id
      properties:
        input:
          type: string
          description: Plain text or SSML to be synthesized to speech.
        voice_id:
          type: string
          description: Id of the voice to be used for synthesizing speech.
        language:
          type: string
          description: >-
            ISO 639-1 language code and ISO 3166-1 region code separated by a
            hyphen, e.g. en-US.
          example: en-US
        model:
          type: string
          description: Synthesis model to use.
          enum:
            - simba-english
            - simba-multilingual
          default: simba-english
        audio_format:
          type: string
          description: Output audio container.
          enum:
            - wav
            - mp3
            - ogg
            - aac
            - pcm
          default: wav
        options:
          $ref: '#/components/schemas/SpeechOptions'
    GetStreamRequest:
      type: object
      required:
        - input
        - voice_id
      properties:
        input:
          type: string
          description: Plain text or SSML to be synthesized to speech.
        voice_id:
          type: string
          description: Id of the voice to be used for synthesizing speech.
        language:
          type: string
          description: >-
            ISO 639-1 language code and ISO 3166-1 region code separated by a
            hyphen, e.g. en-US.
          example: en-US
        model:
          type: string
          enum:
            - simba-english
            - simba-multilingual
          default: simba-english
        options:
          $ref: '#/components/schemas/SpeechOptions'
    SpeechOptions:
      type: object
      description: Optional synthesis controls.
      properties:
        loudness_normalization:
          type: boolean
          description: Whether to normalize the loudness of the output audio.
        text_normalization:
          type: boolean
          description: >-
            Whether to apply text normalization (e.g. expanding numbers and
            abbreviations) before synthesis.
    GetSpeechResponse:
      type: object
      properties:
        audio_data:
          type: string
          format: byte
          description: Base64-encoded synthesized audio.
        audio_format:
          type: string
          description: The format of the returned audio.
          enum:
            - wav
            - mp3
            - ogg
            - aac
            - pcm
        billable_characters_count:
          type: integer
          description: The number of billable characters processed in the request.
        speech_marks:
          $ref: '#/components/schemas/SpeechMarks'
    SpeechMarks:
      type: object
      description: >-
        A nested chunk structure mapping spans of text to start and end times
        in the synthesized audio, informing the client when each word is
        spoken.
      properties:
        type:
          type: string
          example: sentence
        start:
          type: integer
          description: Character offset of the start of the chunk in the input.
        end:
          type: integer
          description: Character offset of the end of the chunk in the input.
        start_time:
          type: number
          description: Start time of the chunk in the audio, in milliseconds.
        end_time:
          type: number
          description: End time of the chunk in the audio, in milliseconds.
        value:
          type: string
          description: The text value of the chunk.
        chunks:
          type: array
          description: Nested speech marks, e.g. words within a sentence.
          items:
            $ref: '#/components/schemas/SpeechMarks'
    Voice:
      type: object
      properties:
        id:
          type: string
          description: The voice id used as voice_id when synthesizing speech.
        display_name:
          type: string
          description: Human-readable name of the voice.
        type:
          type: string
          description: Whether the voice is a pre-set Speechify voice or a personal clone.
          enum:
            - shared
            - personal
        gender:
          type: string
          enum:
            - male
            - female
            - notSpecified
        locale:
          type: string
          description: Primary locale of the voice, e.g. en-US.
        tags:
          type: array
          items:
            type: string
        models:
          type: array
          description: Models the voice supports.
          items:
            type: string
    CreateVoiceRequest:
      type: object
      required:
        - name
        - sample
        - consent
      properties:
        name:
          type: string
          description: Display name for the cloned voice.
        sample:
          type: string
          format: binary
          description: A 10-30 second audio sample of the voice to clone.
        consent:
          type: string
          description: >-
            JSON string containing the fullName and email of the person who
            owns the voice, confirming the voice belongs to you or someone you
            represent.
          example: '{"fullName":"Jane Doe","email":"jane@example.com"}'
        gender:
          type: string
          enum:
            - male
            - female
            - notSpecified
        locale:
          type: string
          description: Primary locale of the voice, e.g. en-US.