Audio Translation: Translate audio to English text
POST
/v1/audio/translationsPOST
/v1/audio/translationsYour instance endpoint, shown on the instance page in the dashboard. Each instance has its own host; there is no shared API host.
Request Body
| Property | Type | Required | Description |
|---|---|---|---|
file | string | No | |
model | string | No | |
prompt | string | No | |
responseFormat | string | No | |
temperature | number | No | |
filename | string | No | |
metadata | object | No |
Responses
200 Translated text
| Property | Type | Description |
|---|---|---|
text | string | |
task | string | |
language | string | |
duration | number | |
segments | object[] |
default An unexpected error response.
| Property | Type | Description |
|---|---|---|
code | integer | |
message | string | |
details | object[] |
Request
curl -X POST "http://localhost:8089/v1/audio/translations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"file":"string","model":"string","prompt":"string","responseFormat":"string","temperature":0,"filename":"string"}'const response = await fetch("http://localhost:8089/v1/audio/translations", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
"file": "string",
"model": "string",
"prompt": "string",
"responseFormat": "string",
"temperature": 0,
"filename": "string"
}),
});
const data = await response.json();import requests
response = requests.post(
"http://localhost:8089/v1/audio/translations",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"file": "string",
"model": "string",
"prompt": "string",
"responseFormat": "string",
"temperature": 0,
"filename": "string"
},
)
data = response.json()Response
{
"text": "string",
"task": "string",
"language": "string",
"duration": 0,
"segments": [
{
"id": 0,
"seek": 0,
"start": 0,
"end": 0,
"text": "string",
"tokens": [
0
],
"temperature": 0,
"avgLogprob": 0,
"compressionRatio": 0,
"noSpeechProb": 0
}
]
}{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
