Skip to main content
POST
/
audio
/
transcriptions
cURL
curl --request POST \
  --url https://api.siliconflow.cn/v1/audio/transcriptions \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -F "file=@path/to/your/audio.mp3" \
  -F "model=FunAudioLLM/SenseVoiceSmall"
import requests
url = "https://api.siliconflow.cn/v1/audio/transcriptions"
file_path = "path/to/your/audio.mp3"
headers = {
"Authorization": "Bearer <YOUR_API_KEY>"
}
with open(file_path, "rb") as audio_file:
files = {
"file": ("audio.mp3", audio_file), # 根据文件类型调整 MIME 类型
"model": (None, "FunAudioLLM/SenseVoiceSmall")
}
response = requests.post(url, headers=headers, files=files)
fetch('https://api.siliconflow.cn/v1/audio/transcriptions', {
method: 'POST',
headers: {
'Authorization': 'Bearer <YOUR_API_KEY>'
},
body: JSON.stringify({
model: 'FunAudioLLM/SenseVoiceSmall',
file: 'path/to/your/audio.mp3'
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
{
  "text": "<string>"
}
{
"code": 20012,
"message": "<string>",
"data": "<string>"
}
"Invalid token"
"Forbidden"
"404 page not found"
{
"message": "Request was rejected due to rate limiting. If you want more, please contact contact@siliconflow.cn. Details:TPM limit reached.",
"data": "<string>"
}
{
"code": 50505,
"message": "Model service overloaded. Please try again later.",
"data": "<string>"
}
"<string>"

Authorizations

Authorization
string
header
required

Use the following format for authentication: Bearer

Body

multipart/form-data
file
file
required

The audio file object (not file name) to transcribe. File upload specifications are limited to:duration not exceeding 1 hour, and file size not exceeding 50MB.

model
enum<string>
required

Corresponding Model Name. To better enhance service quality, we will make periodic changes to the models provided by this service, including but not limited to model on/offlining and adjustments to model service capabilities. We will notify you of such changes through appropriate means such as announcements or message pushes where feasible.

Available options:
FunAudioLLM/SenseVoiceSmall,
TeleAI/TeleSpeechASR
Example:

"FunAudioLLM/SenseVoiceSmall"

Response

The response from the model. The response header contains the x-siliconcloud-trace-id field, which serves as a unique identifier for tracing requests, facilitating log queries and issue troubleshooting.

Represents a transcription response returned by model, based on the provided input.

text
string
required

The transcribed text.