Transcribe audio
POST
/v1/audio/transcriptions
package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://api.mirapi.ai/v1/audio/transcriptions"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model\"\r\nContent-Type: text/plain\r\n\r\nwhisper-1\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\nContent-Type: text/plain\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"prompt\"\r\nContent-Type: text/plain\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"response_format\"\r\nContent-Type: text/plain\r\n\r\njson\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"temperature\"\r\nContent-Type: text/plain\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"timestamp_granularities\"\r\nContent-Type: text/plain\r\n\r\n\r\n-----011000010111000001101001--\r\n")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>") req.Header.Add("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}const url = 'https://api.mirapi.ai/v1/audio/transcriptions';const form = new FormData();form.append('file', '');form.append('model', 'whisper-1');form.append('language', '');form.append('prompt', '');form.append('response_format', 'json');form.append('temperature', '');form.append('timestamp_granularities', '');
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://api.mirapi.ai/v1/audio/transcriptions \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form file=undefined \ --form model=whisper-1 \ --form language= \ --form prompt= \ --form response_format=json \ --form temperature= \ --form timestamp_granularities=Converts audio into text
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typemultipart/form-data
object
file
required
Audio file
string format: binary
model
required
string
language
ISO-639-1 language code
string
prompt
string
response_format
string
temperature
number
timestamp_granularities
Array<string>
Example
{ "file": "", "model": "whisper-1", "language": "", "prompt": "", "response_format": "json", "temperature": "", "timestamp_granularities": ""}Responses
Section titled “Responses”Transcription returned
Media typeapplication/json
object
text
string
Examplegenerated
{ "text": "example"}