Translate audio
POST
/v1/audio/translations
package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://api.mirapi.ai/v1/audio/translations"
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\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\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"temperature\"\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/translations';const form = new FormData();form.append('file', '');form.append('model', '');form.append('prompt', '');form.append('response_format', '');form.append('temperature', '');
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/translations \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form file=undefined \ --form model= \ --form prompt= \ --form response_format= \ --form temperature=Translates audio into English text
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typemultipart/form-data
object
file
required
string format: binary
model
required
string
prompt
string
response_format
string
temperature
number
Example
{ "file": "", "model": "", "prompt": "", "response_format": "", "temperature": ""}Responses
Section titled “Responses”Translation returned
Media typeapplication/json
object
text
string
Examplegenerated
{ "text": "example"}