Text-to-Speech
Turn text into natural‑sounding audio. Like STT, TTS runs as an asynchronous job; the synthesised audio is attached to the finished job.
POST
/v1/tts/jobs API key JSON body
text * string | The text (or SSML) to synthesise. |
voice string | Voice identifier. |
languageCode string | e.g. "lo-LA". |
format mp3 | wav | ogg | Output audio format. Default: mp3. |
ssml boolean | Set true if text is SSML. Default: false. |
speakingRate number | Speed multiplier, e.g. 1.0. |
pitch number | Pitch adjustment, e.g. 0.0. |
Enqueue a job
curl -X POST https://api-ocr.vanguardinitiative.com/v1/tts/jobs \
-H "authorization: Bearer $API_KEY" \
-H 'content-type: application/json' \
-d '{"text":"ສະບາຍດີ","languageCode":"lo-LA","format":"mp3"}'const res = await fetch('https://api-ocr.vanguardinitiative.com/v1/tts/jobs', {
method: 'POST',
headers: {
authorization: 'Bearer ' + API_KEY,
'content-type': 'application/json',
},
body: JSON.stringify({ text: 'ສະບາຍດີ', languageCode: 'lo-LA', format: 'mp3' }),
});
const { jobId } = await res.json();202 Job accepted
{
"status": "success",
"jobId": "9a2b7c10-...",
"state": "pending"
}Poll GET /v1/jobs/{id} until it finishes; the stored audio is referenced
in the job’s result.