Text-to-Speech

Compose Text To Speech

Generate multiple speech segments and pauses as one audio file. Add tts and pause objects to segments in the order they should appear. Each tts segment accepts the same voice, model, prompt, and output settings as POST /v1/text-to-speech; voices and models may differ between segments.

Limits

  • Up to 50 total segments, with at least one tts segment
  • Up to 2,000 characters across all tts segments
  • Up to 10 seconds per pause and 60 seconds across all pauses
  • All tts segments must use the same audio_format

Credits are charged only for the combined text length; pauses are free. Segments are synthesized in parallel and returned in input order. If any segment fails, the entire request fails and no credits are charged.

Response A successful request returns the composed audio directly as binary data, not JSON. The response Content-Type is audio/wav or audio/mpeg, based on the audio_format requested by the segments.

post/v1/text-to-speech/compose

Request

  • Base URL: https://api.typecast.ai
  • URL: https://api.typecast.ai/v1/text-to-speech/compose
  • Auth: API key in header X-API-KEY

Request body

Example request

{
  "segments": [
    {
      "text": "Welcome to today's update.",
      "type": "tts",
      "model": "ssfm-v30",
      "output": {
        "audio_format": "wav"
      },
      "language": "eng",
      "voice_id": "tc_672c5f5ce59fac2a48faeaee"
    }
  ]
}

Response

Binary composed audio. The media type matches the requested audio_format.

Changes

No recorded changes to this operation across all 1 revision of this API.