Speech-to-Text
Transcribe audio into text. STT runs as an asynchronous job: you enqueue the work, then poll the job until it finishes.
POST
/v1/stt/jobs API key Send either a multipart/form-data file or a JSON body with an audioUrl.
Fields
file * file | Audio file, up to 200 MB. (Or provide audioUrl in a JSON body.) |
audioUrl uri | A URL to fetch the audio from, instead of uploading. |
language string | Language hint, e.g. "lo". Auto-detected when omitted. |
projectId uuid | Attach the job to a project. |
Enqueue a job
curl -X POST https://api-ocr.vanguardinitiative.com/v1/stt/jobs \
-H "authorization: Bearer $API_KEY" \
-F file=@meeting.mp3 -F language=loconst form = new FormData();
form.append('file', audioFile);
form.append('language', 'lo');
const res = await fetch('https://api-ocr.vanguardinitiative.com/v1/stt/jobs', {
method: 'POST',
headers: { authorization: 'Bearer ' + API_KEY },
body: form,
});
const { jobId } = await res.json();202 Job accepted
{
"status": "success",
"jobId": "b3f1c2a4-...",
"state": "pending"
}Poll for the result
Poll GET /v1/jobs/{id} until status is success or error.
curl https://api-ocr.vanguardinitiative.com/v1/jobs/$JOB_ID \
-H "authorization: Bearer $API_KEY"200 Finished job
{
"status": "success",
"job": {
"id": "b3f1c2a4-...",
"serviceId": "stt",
"status": "success",
"result": { "text": "ສະບາຍດີ ...", "language": "lo" }
}
}