Audio
Use configured OpenAI-compatible audio routes and Qwen native voice cloning and TTS.
Paths
| Path | Method | Status |
|---|---|---|
| /v1/audio/transcriptions | POST | Active |
| /v1/audio/translations | POST | Active |
| /v1/audio/speech | POST | Active |
POST /v1/audio/speech
Creates speech audio from text input. The request uses the OpenAI-compatible audio speech JSON envelope and accepts model, input, voice, response format, speed, instructions, metadata, and provider-specific relay fields when configured.
curl https://www.token168.cc/v1/audio/speech \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-d '{
"model": "<MODEL_ID>",
"input": "Token168 unifies native model APIs.",
"voice": "alloy",
"instructions": "Neutral narration.",
"response_format": "mp3",
"speed": 1,
"stream_format": "none",
"metadata": {"trace_id": "trace_123"},
"task_type": "tts",
"language": "en",
"ref_audio": "",
"ref_text": "",
"x_vector_only_mode": false,
"max_new_tokens": 1024,
"initial_codec_chunk_frames": 0
}'
POST /api/v1/services/audio/tts/customization
Create a voice with model=voice-enrollment and action=create_voice. Pass a public audio URL or Base64 Data URI. Save the original output.voice_id returned by Alibaba. Management actions are free.
curl https://www.token168.cc/api/v1/services/audio/tts/customization \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "voice-enrollment",
"input": {
"action": "create_voice",
"target_model": "qwen-audio-3.1-tts-plus",
"prefix": "myvoice",
"audio": "https://example.com/reference.wav",
"language_hints": [
"zh"
]
}
}'
query_voice
Call query_voice with the returned voice_id until status is OK, then synthesize. The same customization endpoint also accepts list_voice, update_voice and delete_voice.
curl https://www.token168.cc/api/v1/services/audio/tts/customization \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "voice-enrollment",
"input": {
"action": "query_voice",
"voice_id": "VOICE_ID_FROM_CREATE"
}
}'
POST /api/v1/services/audio/tts/SpeechSynthesizer
Use qwen-audio-3.1-tts-plus and put the original voice_id in input.voice. Non-streaming returns output.audio.url. Add X-DashScope-SSE: enable for ordered Base64 audio events in output.audio.data. Billing uses final usage.characters, not tokens. These routes use your Token168 API key.
curl https://www.token168.cc/api/v1/services/audio/tts/SpeechSynthesizer \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-audio-3.1-tts-plus",
"input": {
"text": "你好,欢迎使用语音合成。",
"voice": "VOICE_ID_FROM_CREATE",
"format": "wav",
"sample_rate": 24000
}
}'
cosyvoice-v3-plus
Use cosyvoice-v3-plus with a supported system voice such as longanyang. The same speech synthesis endpoint accepts your Token168 API key. The JSON result includes an expiring output.audio.url. Send X-DashScope-SSE: enable for ordered Base64 audio chunks and a final usage.characters count. Input text is limited to 20,000 characters per request.
curl https://www.token168.cc/api/v1/services/audio/tts/SpeechSynthesizer \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "cosyvoice-v3-plus",
"input": {
"text": "你好,欢迎使用语音合成。",
"voice": "longanyang",
"format": "wav",
"sample_rate": 24000
}
}'
POST /v1/audio/transcriptions
Transcribes one uploaded audio file with qwen3-asr-flash. Send model and file, with optional language, prompt, and response_format (json or text). Files are limited to 7 MiB and 5 minutes. Streaming, subtitles, input, and speed are not supported for this model.
curl https://www.token168.cc/v1/audio/transcriptions \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-F model="qwen3-asr-flash" \
-F file="@speech.wav" \
-F response_format="json" \
-F language="en"
POST /v1/audio/translations
Translates uploaded audio into English text through the OpenAI-compatible audio relay. It uses the same multipart shape as transcription, with translation-specific upstream behavior selected by the route.
curl https://www.token168.cc/v1/audio/translations \
-H "Authorization: Bearer $TOKEN168_API_KEY" \
-F model="<MODEL_ID>" \
-F file="@speech.wav" \
-F input="speech.wav" \
-F response_format="json" \
-F language="en" \
-F speed="1"
Scope
Check Models & Pricing for model availability and prices. Qwen native routes retain provider JSON and SSE formats. Realtime audio and music use separate APIs.