≡ All docs
Model API / Audio
Audio
Updated: 2026-05-11
Overview
Provides text-to-speech (TTS) and speech-to-text (STT / transcription), compatible with the OpenAI Audio API.
Text to Speech
POST
/audio/speech| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Required | TTS model ID, e.g. tts-1, tts-1-hd, cosyvoice-v2 |
| input | string | Required | Text to synthesize, up to 4096 characters |
| voice | string | Required | Voice ID, e.g. alloy, nova, onyx; see the console voice list |
| response_format | string | Optional | Audio format, mp3, wav, opus or flac, default mp3 |
| speed | number | Optional | Speaking speed in [0.25, 4.0], default 1.0 |
cURL
curl -X POST "https://www.starunion.net/v1/audio/speech" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tts-1",
"input": "Hello, welcome to the StarUnion platform.",
"voice": "alloy"
}' \
--output speech.mp3Speech to Text
POST
/audio/transcriptions| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Required | Transcription model ID, e.g. whisper-1, paraformer-v2 |
| file | file | Required | Audio file (mp3, wav, m4a, flac), up to 25MB per file |
| language | string | Optional | Audio language (ISO-639-1, e.g. zh, en); auto-detected if omitted |
| response_format | string | Optional | Return format, json, text, srt or vtt, default json |
cURL
curl -X POST "https://www.starunion.net/v1/audio/transcriptions" \ -H "Authorization: Bearer YOUR_API_KEY" \ -F file=@audio.mp3 \ -F model=whisper-1 \ -F language=en
JSON
{"text": "Hello, welcome to the StarUnion platform."}
Didn't find what you were looking for?Contact us →