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

# Text to Speech API

> Turn text into spoken audio with the voice model of your choice, and get each recording as a file link with its length, the voice, the exact model version, its maker and the exact cost of the call. You pay exactly what each text costs at the model's own rates.

`POST /v1/data/ai/speech/run`

**Pricing:** Metered: you pay exactly each call's cost at the selected model's rates (default ElevenLabs: Eleven Flash v2.5: the model's own rate).

## Request

Send the inputs under `params`. Only the keys below are accepted; any other key returns `422 invalid_params`.

**texts** `string[]` *required*

The texts to speak, one per line, up to 5,000 characters each. Each text is one call and one audio file.

**model** `string` (default: elevenlabs/eleven-flash-v2.5)

The text-to-speech model. Pick from the list (popular models first). Each model shows its own rate, mostly per 1M characters, and that is exactly what each text costs.

36 allowed values, for example `elevenlabs/eleven-flash-v2.5` (ElevenLabs: Eleven Flash v2.5), `elevenlabs/eleven-v4` (ElevenLabs: Eleven v4), `elevenlabs/eleven-v4-turbo` (ElevenLabs: Eleven v4 Turbo), `elevenlabs/eleven-v3` (ElevenLabs: Eleven v3), `google/gemini-3.8-flash-lite-tts` (Google: Gemini 3.8 Flash Lite TTS), `minimax/speech-2.8-hd` (MiniMax: Speech 2.8 HD), `deepgram/flux-tts` (Deepgram: Flux TTS), `microsoft/mai-voice-2.1-flash` (Microsoft AI: MAI-Voice-2.1-Flash), `mistralai/voxtral-mini-tts-3-0` (Mistral: Voxtral TTS 3), `assemblyai/assemblyai-tts-1` (AssemblyAI: TTS 1). Fetch the full list with `GET /v1/data/ai/speech?expand=options`.

**voice** `string`

The voice, from the selected model's own voices. Leave blank for the model's first listed voice.

612 allowed values, for example `george` (george (ElevenLabs)), `sarah` (sarah (ElevenLabs)), `adam` (adam (ElevenLabs)), `alice` (alice (ElevenLabs)), `bella` (bella (ElevenLabs)), `bill` (bill (ElevenLabs)), `brian` (brian (ElevenLabs)), `callum` (callum (ElevenLabs)), `charlie` (charlie (ElevenLabs)), `chris` (chris (ElevenLabs)). Fetch the full list with `GET /v1/data/ai/speech?expand=options`.

**format** `string` (default: mp3)

mp3 or wav. A model that only produces raw audio returns wav, and the row's Format says so.

Allowed values: `mp3` (MP3), `wav` (WAV).

## Example

```bash cURL theme={null}
curl -X POST "https://api.mindcase.co/v1/data/ai/speech/run?wait=true" \
  -H "Authorization: Bearer $MINDCASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "params": {
    "texts": [
      "Hello from Mindcase.",
      "This is a short test."
    ],
    "model": "heygen/heygen-voice-1-turbo"
  }
}'
```

```python Python theme={null}
import os, requests

r = requests.post(
    "https://api.mindcase.co/v1/data/ai/speech/run",
    params={"wait": "true"},
    headers={"Authorization": f"Bearer {os.environ['MINDCASE_API_KEY']}"},
    json={"params": {
    "texts": [
        "Hello from Mindcase.",
        "This is a short test."
    ],
    "model": "heygen/heygen-voice-1-turbo"
}},
)
job = r.json()
rows = job.get("data", [])  # if job["status"] == "running", poll /v1/jobs/{job_id}/results
```

```javascript Node.js theme={null}
const r = await fetch("https://api.mindcase.co/v1/data/ai/speech/run?wait=true", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MINDCASE_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ params: {
  "texts": [
    "Hello from Mindcase.",
    "This is a short test."
  ],
  "model": "heygen/heygen-voice-1-turbo"
} }),
});
const job = await r.json();
const rows = job.data ?? []; // if job.status === "running", poll /v1/jobs/{job_id}/results
```

## Response fields

Each row in `data` is one audio file, keyed by these fields.

| Field | Name | Type |
| - | - | - |
| `id` | ID | text |
| `text` | Text | text |
| `fileUrl` | File URL | text |
| `mimeType` | MIME Type | text |
| `durationSeconds` | Duration (Seconds) | number |
| `characters` | Characters | number |
| `model` | Model | text |
| `provider` | Provider | text |
| `voice` | Voice | text |
| `format` | Format | text |
| `costUsd` | Cost (USD) | number |
| `error` | Error | text |
| `createdAt` | Created At | datetime |

## Example response

Abridged: long text and lists are shortened.

```json theme={null}
{
  "job_id": "7f3a1c2e-0b9d-4c55-9a51-3f2e8d1b6a40",
  "agent": "ai/speech",
  "status": "completed",
  "row_count": 1,
  "truncated": false,
  "data": [
    {
      "format": "wav",
      "characters": 20,
      "voice": "nadine",
      "mimeType": "audio/wav",
      "fileUrl": "https://api-staging.mindcase.co/api/v1/files/2026/11/09/27d372ea1c6045ebba51a8c8d3c41624adaad916.wav",
      "provider": "HeyGen",
      "error": null,
      "model": "heygen/heygen-voice-1-turbo-20261009",
      "id": "gen-tts-1794263075-MaZ7fmLQd8Z28isFrplR",
      "text": "Hello from Mindcase.",
      "costUsd": 8e-05,
      "createdAt": "2026-11-09T22:24:49Z",
      "durationSeconds": 1.676
    }
  ]
}
```


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