Skip to main content
POST
/
v1
/
audio
/
translations
Audio translation
curl --request POST \
  --url https://openp.ai/v1/audio/translations
import requests

url = "https://openp.ai/v1/audio/translations"

response = requests.post(url)

print(response.text)
const options = {method: 'POST'};

fetch('https://openp.ai/v1/audio/translations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://openp.ai/v1/audio/translations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://openp.ai/v1/audio/translations"

req, _ := http.NewRequest("POST", url, nil)

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://openp.ai/v1/audio/translations")
.asString();
require 'uri'
require 'net/http'

url = URI("https://openp.ai/v1/audio/translations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
Translate and transcribe to English an audio file in any language.

Request

curl https://openp.ai/v1/audio/translations \
  -H "Authorization: Bearer $OPENPAI_API_KEY" \
  -F [email protected] \
  -F model=whisper-1 \
  -F response_format=json

Parameters

Same as Transcriptions, except:
  • The output language is fixed to English (no language field).
  • Only whisper-1 supports this endpoint.

Response

{"text": "Hello, this is a test audio."}

Translating to other languages

To translate audio into a non-English language, we recommend:
  1. Use /v1/audio/transcriptions to first transcribe to the original language’s text.
  2. Pass the text to /v1/chat/completions and have the LLM translate it to the target language.
text_zh = client.audio.transcriptions.create(model="whisper-1", file=open("a.mp3","rb")).text

text_ja = client.chat.completions.create(
    model="gpt-5.5",
    messages=[
        {"role": "system", "content": "Translate to Japanese."},
        {"role": "user", "content": text_zh},
    ],
).choices[0].message.content

Billing

Same as transcriptions, charged by audio duration.