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

# Synthesize Speech

> Generate speech audio from text

## Request Body

<ParamField body="speaker_id" type="string" required>
  ID of the speaker to use for synthesis
</ParamField>

<ParamField body="text" type="string" required>
  Text to convert to speech (max 2000 characters)
</ParamField>

## Response

<ResponseField name="audio_url" type="string" required>
  URL to the generated audio file (WAV format)
</ResponseField>

<ResponseField name="duration_seconds" type="number" required>
  Duration of the generated audio
</ResponseField>

<ResponseField name="characters_used" type="integer" required>
  Number of characters consumed
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.destined.ai/v1/tts/synthesize" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "speaker_id": "abc123-def456",
      "text": "Hello, this is a test of the Destined Voice API."
    }'
  ```

  ```typescript TypeScript theme={null}
  const result = await client.ttsGeneration.synthesizeSpeechV1TtsSynthesizePost({
    speakerId: "abc123-def456",
    text: "Hello, this is a test of the Destined Voice API.",
  });

  console.log(result.audioUrl);
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "audio_url": "https://voice.s3.amazonaws.com/audio/gen_abc123.wav",
    "duration_seconds": 3.2,
    "characters_used": 47
  }
  ```

  ```json 400 theme={null}
  {
    "detail": "Text exceeds maximum length of 2000 characters"
  }
  ```

  ```json 404 theme={null}
  {
    "detail": "Speaker not found"
  }
  ```

  ```json 429 theme={null}
  {
    "detail": "Character quota exceeded for this billing period"
  }
  ```
</ResponseExample>
