≡ 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
ParameterTypeRequiredDescription
modelstringRequiredTTS model ID, e.g. tts-1, tts-1-hd, cosyvoice-v2
inputstringRequiredText to synthesize, up to 4096 characters
voicestringRequiredVoice ID, e.g. alloy, nova, onyx; see the console voice list
response_formatstringOptionalAudio format, mp3, wav, opus or flac, default mp3
speednumberOptionalSpeaking 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.mp3

Speech to Text

POST/audio/transcriptions
ParameterTypeRequiredDescription
modelstringRequiredTranscription model ID, e.g. whisper-1, paraformer-v2
filefileRequiredAudio file (mp3, wav, m4a, flac), up to 25MB per file
languagestringOptionalAudio language (ISO-639-1, e.g. zh, en); auto-detected if omitted
response_formatstringOptionalReturn 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 →