Transcribe a recording
const url = 'https://ai.work.optidata.cloud/api/ai/audio/transcribe';const form = new FormData();form.append('file', 'file');form.append('language', 'en');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://ai.work.optidata.cloud/api/ai/audio/transcribe \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form file=@file \ --form language=enUploads a short audio recording and returns its transcription in the same
response. Common audio formats are accepted (for example mp3, m4a,
wav, webm); the file extension must match the content.
The spoken language defaults to Portuguese (pt); pass language for
anything else.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
The audio recording.
Spoken language as an ISO-639-1 code. Defaults to pt.
Responses
Section titled “ Responses ”The transcription.
object
Id of this transcription response.
The full text.
State of a transcription.
Detected or requested language code, when known.
Length of the recording, when known.
Each word with its timing (milliseconds) and confidence, when available.
object
Speaker turns, when available.
object
Examples
{ "id": "a305087d-5130-48b3-907c-098439fa7c1a", "text": "Good morning, team. Today we review the release plan.", "status": "completed", "language": null, "duration_seconds": null, "words": [], "utterances": []}No authentication key was sent.
Authentication failures use an error key rather than message.
object
Examples
No bearer token sent
{ "error": "JWT passport exception: Missing bearer token in request"}The authentication key is expired or not recognised. Get a fresh one and retry.
Authentication failures use an error key rather than message.
object
Examples
{ "error": "JWT passport expired: Passport expired"}No file was sent.
object
The first validation message.
Validation messages keyed by field name.
object
Examples
{ "message": "The file field is required.", "errors": { "file": [ "The file field is required." ] }}