Speech-to-Text: Transcribe audio to text
POST
/v1/audio/transcriptionsPOST
/v1/audio/transcriptionsYour 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 | |
language | string | No | |
prompt | string | No | |
responseFormat | string | No | |
temperature | number | No | |
timestampGranularities | string[] | No | |
filename | string | No | |
metadata | object | No |
Responses
200 Transcribed text
| Property | Type | Description |
|---|---|---|
text | string | |
task | string | |
language | string | |
duration | number | |
words | object[] | |
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/transcriptions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"file":"string","model":"string","language":"string","prompt":"string","responseFormat":"string","temperature":0,"timestampGranularities":["string"],"filename":"string"}'const response = await fetch("http://localhost:8089/v1/audio/transcriptions", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
"file": "string",
"model": "string",
"language": "string",
"prompt": "string",
"responseFormat": "string",
"temperature": 0,
"timestampGranularities": [
"string"
],
"filename": "string"
}),
});
const data = await response.json();import requests
response = requests.post(
"http://localhost:8089/v1/audio/transcriptions",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"file": "string",
"model": "string",
"language": "string",
"prompt": "string",
"responseFormat": "string",
"temperature": 0,
"timestampGranularities": [
"string"
],
"filename": "string"
},
)
data = response.json()Response
{
"text": "string",
"task": "string",
"language": "string",
"duration": 0,
"words": [
{
"word": "string",
"start": 0,
"end": 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"
}
]
}
