> ## 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.

# Batch Synthesize

> Generate speech for multiple texts asynchronously

## Request Body

<ParamField body="items" type="array" required>
  Array of synthesis requests (max 100 items)

  <Expandable title="Item properties">
    <ParamField body="speaker_id" type="string" required>
      Speaker ID for this item
    </ParamField>

    <ParamField body="text" type="string" required>
      Text to synthesize
    </ParamField>
  </Expandable>
</ParamField>

## Response

<ResponseField name="job_id" type="string" required>
  Unique job identifier to track progress
</ResponseField>

<ResponseField name="status" type="string" required>
  Initial job status: `pending`
</ResponseField>

<ResponseField name="total_items" type="integer" required>
  Number of items in the batch
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.destined.ai/v1/tts/batch" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "items": [
        {"speaker_id": "speaker-1", "text": "First sentence."},
        {"speaker_id": "speaker-2", "text": "Second sentence."},
        {"speaker_id": "speaker-3", "text": "Third sentence."}
      ]
    }'
  ```

  ```typescript TypeScript theme={null}
  const job = await client.ttsGeneration.batchSynthesizeV1TtsBatchPost({
    items: [
      { speakerId: "speaker-1", text: "First sentence." },
      { speakerId: "speaker-2", text: "Second sentence." },
      { speakerId: "speaker-3", text: "Third sentence." },
    ],
  });

  console.log(job.jobId);
  // Use jobs.getJobV1JobsJobIdGet() to track progress
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "job_id": "job_abc123xyz",
    "status": "pending",
    "total_items": 3,
    "created_at": "2024-01-15T10:30:00Z"
  }
  ```

  ```json 400 theme={null}
  {
    "detail": "Batch exceeds maximum of 100 items"
  }
  ```
</ResponseExample>

## Next Steps

After creating a batch job, use the [Get Job](/api-reference/jobs/get-job) endpoint to track progress and retrieve results.
