Audio
Three endpoint groups: speech-to-text, audio translation, and text-to-speech (TTS). Transcription/translation upload files as multipart/form-data; TTS takes JSON and returns binary audio.
Transcriptions
POST /v1/audio/transcriptionscurl https://test.kailin.com.cn/v1/audio/transcriptions \
-H "Authorization: Bearer sk-your-token" \
-F "file=@/path/to/audio.mp3" \
-F "model=whisper-1" \
-F "language=zh"
Fields (form-data)
| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | Audio file (mp3/wav/m4a/webm etc., ≤25MB) |
model | string | Yes | whisper-1, gpt-4o-transcribe, gpt-4o-mini-transcribe, etc. |
language | string | No | ISO-639-1 code (e.g. zh) — improves accuracy |
prompt | string | No | Guiding text to help spell proper nouns |
response_format | string | No | json (default) / text / srt / verbose_json / vtt |
temperature | number | No | Sampling temperature |
Response
{ "text": "This is the transcribed text." }
The verbose_json format additionally returns segments and timestamps (segments / duration).
Translations
POST /v1/audio/translationsTranslates audio content into English. Fields are the same as transcriptions (no language parameter):
curl https://test.kailin.com.cn/v1/audio/translations \
-H "Authorization: Bearer sk-your-token" \
-F "file=@/path/to/audio.mp3" \
-F "model=whisper-1"
{ "text": "This is the English translation of the audio." }
Text to Speech
POST /v1/audio/speechcurl https://test.kailin.com.cn/v1/audio/speech \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-token" \
-d '{
"model": "tts-1",
"voice": "alloy",
"input": "Welcome to AI Station."
}' \
--output speech.mp3
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | tts-1, tts-1-hd, gpt-4o-mini-tts, etc. |
input | string | Yes | Text to synthesize — up to 4096 characters |
voice | string | Yes | alloy / echo / fable / onyx / nova / shimmer, etc. |
response_format | string | No | mp3 (default) / opus / aac / flac / wav / pcm |
speed | number | No | 0.25–4.0, default 1.0 |
Response
On success the endpoint returns raw audio bytes (encoded per response_format). Save it as a file instead of parsing it as JSON.
caution
When using the web playground for transcription/translation, switch to the form mode to upload files. The TTS response is a binary stream — the playground embeds an audio player for it, but cURL/SDK validation is recommended.