SiliconFlow
API REFERENCE

Create a Audio Transcription

Creates an audio transcription.

POST
/audio/transcriptions
AuthorizationBearer <token>required

Set the header 'Authorization: Bearer {your API key}' for authentication

In: header

filefilerequired

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.

Formatbinary
Example"/path/to/file/audio.mp3"
modelstringrequired

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.

Value in"FunAudioLLM/SenseVoiceSmall" | "TeleAI/TeleSpeechASR"
Example"FunAudioLLM/SenseVoiceSmall"

Response Body

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.

TypeScript Definitions

Use the response body type in TypeScript.

textstringrequired

The transcribed text.

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"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
with open("path/to/your/audio.mp3", "rb") as audio_file:
    files = {
        "file": ("audio.mp3", audio_file),
        "model": (None, "FunAudioLLM/SenseVoiceSmall")
    }
    response = requests.post(url, headers=headers, files=files)
    print(response.text)
{
  "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"