API reference · Alibaba

alibaba/qwen-3-tts/0.6b

Integrate this model through SandBase's unified API, with production-ready schemas and examples.

AUDIOAsyncOpen model
Production endpoint

Send your first request

OpenAI-compatible endpoint with unified authentication and usage tracking.

POSThttps://api.sandbase.ai/v1/run
Model IDalibaba/qwen-3-tts/0.6b
01

Input Schema

15 parameters · 1 required · 14 optional

ParameterTypeRequiredDescription
promptstringRequiredOptional prompt to guide the style of the generated speech. This prompt will be ignored if a speaker embedding is provided.
textstringOptionalThe text to be converted to speech.
top_kintegerOptionalTop-k sampling parameter. · Min: 0 · Default: 50
top_pnumberOptionalTop-p sampling parameter. · Min: 0 · Max: 1 · Default: 1
voicestringOptionalThe voice to be used for speech synthesis, will be ignored if a speaker embedding is provided. Check out the **[documentation](https://github.com/QwenLM/Qwen3-TTS/tree/main?tab=readme-ov-file#custom-voice-generate)** for each voice's details and which language they primarily support. · Options: Vivian, Serena, Uncle_Fu, Dylan, Eric, Ryan, Aiden, Ono_Anna, Sohee
VivianSerenaUncle_FuDylanEricRyanAidenOno_AnnaSohee
languagestringOptionalThe language of the voice. · Options: Auto, English, Chinese, Spanish, French, German, Italian, Japanese, Korean, Portuguese, Russian · Default: "Auto"
AutoEnglishChineseSpanishFrenchGermanItalianJapaneseKoreanPortugueseRussian
temperaturenumberOptionalSampling temperature; higher => more random. · Min: 0 · Max: 1 · Default: 0.9
max_new_tokensintegerOptionalMaximum number of new codec tokens to generate. · Min: 1 · Max: 8192 · Default: 200
reference_textstringOptionalOptional reference text that was used when creating the speaker embedding. Providing this can improve synthesis quality when using a cloned voice.
subtalker_top_kintegerOptionalTop-k for sub-talker sampling. · Min: 0 · Default: 50
subtalker_top_pnumberOptionalTop-p for sub-talker sampling. · Min: 0 · Max: 1 · Default: 1
repetition_penaltynumberOptionalPenalty to reduce repeated tokens/codes. · Min: 0 · Default: 1.05
subtalker_dosamplebooleanOptionalSampling switch for the sub-talker. · Default: true
subtalker_temperaturenumberOptionalTemperature for sub-talker sampling. · Min: 0 · Max: 1 · Default: 0.9
speaker_voice_embedding_file_urlstringOptionalURL to a speaker embedding file in safetensors format, from `fal-ai/qwen-3-tts/clone-voice/0.6b` endpoint. If provided, the TTS model will use the cloned voice for synthesis instead of the predefined voices.
02

Output Schema

FieldTypeDescription
idstringUnique identifier for the generation task
statusstringTask status: pending, running, completed, failed, timeout
modelstringModel used for the generation
outputsarrayArray of output items
outputs[].urlstringURL of the generated artifact
outputs[].content_typestringMIME type (e.g. image/png, video/mp4)
errorobject | nullError details if failed, null on success
error.typestringMachine-readable error type code
error.messagestringHuman-readable error description

Async Workflow

This model uses asynchronous execution. Submit a request and poll for the result.

  1. Submit — POST to /v1/run, receive an id
  2. Poll — GET /v1/run/{id} until status is completed, failed, or timeout
  3. Retrieve — Read outputs from the completed response
03

Code Examples

Ready-to-run snippets

const apiKey = process.env.SANDBASE_API_KEY;
const response = await fetch("https://api.sandbase.ai/v1/run", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "model": "alibaba/qwen-3-tts/0.6b",
    "text": "I feel like I'm taking crazy pills! How can something be both a square and a circle at the same time? It defies all logic!",
    "top_k": 50,
    "top_p": 1,
    "voice": "Vivian",
    "prompt": "Very happy.",
    "language": "English",
    "temperature": 0.9,
    "max_new_tokens": 200,
    "subtalker_top_k": 50,
    "subtalker_top_p": 1,
    "repetition_penalty": 1.05,
    "subtalker_dosample": true,
    "subtalker_temperature": 0.9
  }),
});

if (!response.ok) throw new Error(await response.text());
let result = await response.json();
for (let attempt = 0; attempt < 120 && !["completed", "failed", "timeout"].includes(result.status); attempt++) {
  await new Promise((resolve) => setTimeout(resolve, 2_000));
  const poll = await fetch(`https://api.sandbase.ai/v1/run/${result.id}`, {
    headers: { Authorization: `Bearer ${apiKey}` },
  });
  if (!poll.ok) throw new Error(await poll.text());
  result = await poll.json();
}
if (result.status !== "completed") throw new Error(`Generation ended: ${result.status}`);
console.log(result);