Audio translation
curl --request POST \
--url https://models.phanedge.cloud/v1/audio/translations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data'import requests
url = "https://models.phanedge.cloud/v1/audio/translations"
payload = "-----011000010111000001101001\r\n-----011000010111000001101001--"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "multipart/form-data"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const form = new FormData();
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://models.phanedge.cloud/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://models.phanedge.cloud/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",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://models.phanedge.cloud/v1/audio/translations"
payload := strings.NewReader("-----011000010111000001101001\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://models.phanedge.cloud/v1/audio/translations")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://models.phanedge.cloud/v1/audio/translations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{}音频
Audio · Translations
将音频翻译为目标语言文本,支持多种输出格式(JSON/SRT/VTT)。
POST
/
v1
/
audio
/
translations
Audio translation
curl --request POST \
--url https://models.phanedge.cloud/v1/audio/translations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data'import requests
url = "https://models.phanedge.cloud/v1/audio/translations"
payload = "-----011000010111000001101001\r\n-----011000010111000001101001--"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "multipart/form-data"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const form = new FormData();
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://models.phanedge.cloud/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://models.phanedge.cloud/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",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://models.phanedge.cloud/v1/audio/translations"
payload := strings.NewReader("-----011000010111000001101001\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://models.phanedge.cloud/v1/audio/translations")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://models.phanedge.cloud/v1/audio/translations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{}接口说明
最佳实践
- 路径:
POST /v1/audio/translations(multipart/form-data)。 - 输入:音频文件(
file),可带prompt、language、temperature等字段。 - 输出:默认 JSON;也可通过
response_format指定text/srt/vtt。
curl -X POST "https://models.phanedge.cloud/v1/audio/translations" \
-H "Authorization: Bearer $TOKEN" \
-F "model=whisper-1" \
-F "file=@sample.wav" \
-F "response_format=srt"
- 大文件建议预处理(降采样/切片),缩短时延并提升稳定性。
- 需要纯文本可选
response_format=text;字幕场景推荐srt/vtt。 - 若你已在“转写(Transcriptions)”拿到原文,可复用
prompt做辅助提示,提升翻译通顺度。
Authorizations
Authorization: Bearer
Body
multipart/form-data
The body is of type object.
Response
200 - application/json
OK
The response is of type object.

