POST /v1/text-to-speech
Text to speech
Speak text in a predefined voice and return a download link for the audio.
POST https://api.pascalai.co/v1/text-to-speechContent-Type: application/json
Authenticate with Authorization: Bearer and an API key. The call remains open for up to 4 minutes. When processing has finished inside that window, the body is the job. When status is queued or running, retrieve the same object with GET /v1/text-to-speech/{job_id}. Live speech is on Text to speech realtime.
| Field | Type | Description |
|---|---|---|
modelRequired | string | Catalogue id of the text-to-speech model. |
textRequired | string | The words to speak. The length is priced before the request is queued. |
params | object | Fields for that model, including the predefined voice. Omit the object to use the defaults. The fields are on the model page. |
name | string | Optional label stored on the job and returned as name. |
Response
200 with the job. A successful request is charged $0.05 plus the generated audio duration in minutes. result.artifacts contains the audio. url is the download link. Download the file within one day. The file is deleted after that. The job record remains.
Batch
POST /v1/text-to-speech/batch
Speak up to 50 texts in a single request. All texts use the same model and the same parameters. Send model, params, and items. Each item has text and an optional name.
The response contains the batch identifier. Retrieve progress with GET /v1/text-to-speech/batch/{batch_id}. An account may have two open batches. The length of every text is priced before anything is queued. A successful batch is charged $0.05 once. Each text is charged for the generated audio duration in minutes.
Example
curl https://api.pascalai.co/v1/text-to-speech \
-H "Authorization: Bearer $PASCAL_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "sarvam-bulbul",
"text": "Keep walking toward the river.",
"params": {
"language": "en-IN",
"speaker": "shubh",
"output_format": "wav",
"output_sample_rate": "source",
"output_channels": "source"
}
}'
curl https://api.pascalai.co/v1/text-to-speech/$JOB_ID \
-H "Authorization: Bearer $PASCAL_API_KEY"Models
sarvam-bulbulJSON text. Default speaker shubh. Default language en-IN.deepgram-aura-2Voice ids look like aura-2-thalia-en. model and voice are the same field.deepgram-aura-1Voice ids look like aura-asteria-en.deepgram-fluxVoice ids look like flux-alexis-en. Served on Deepgramās current speak API.kokoro24 kHz mono int16 WAVchatterbox-turbo24 kHz monochatterbox-original24 kHz monochatterbox-multilingual-v324 kHz monoqwen3-tts-0.6b24 kHz monoqwen3-tts-1.7b24 kHz monoomnivoice24 kHz monovoxcpm248 kHz mono