文本转语音,OpenAI 兼容。按 model 路由到对应 TTS 上游(OpenAI 兼容 TTS / 阿里 Qwen-TTS),返回二进制音频。
https://api.lolai.lol/v1/audio/speechAuthorizationstring必填Bearer <key>。Bearer sk-lolai-xxxContent-Typestring必填application/jsoninputstring必填你好,这是语音合成测试。voicestring可选Cherry;OpenAI 的 alloy 等)。Cherryresponse_formatstring可选mp3 / opus / aac / flac / wav / pcm(部分上游固定格式)。mp3speednumber可选1.0按输入字符数计费(非时长、非 token)。失败请求不扣费。
/v1/audio/transcriptionsmultipart 上传音频(file)→ 转写文本,按音频时长计费。response_format:json(默认 { text })/ text / verbose_json。已接:阿里 Qwen3-ASR(qwen3-asr-flash-*)、OpenAI Whisper(whisper-1,需上游)。
curl https://api.lolai.lol/v1/audio/transcriptions \
-H "Authorization: Bearer sk-lolai-xxx" \
-F "model=qwen3-asr-flash-2026-02-10" \
-F "file=@audio.wav" \
-F "response_format=json"TTS 模型见 模型广场(筛选语音类型)。当前已接:阿里 Qwen-TTS(qwen3-tts-flash 等);OpenAI 兼容 TTS(tts-1 等,需上游支持)。
用下面的示例确认请求格式与返回结构。需要在线发起请求时,点击页面顶部「调试」拉起在线运行面板。
curl https://api.lolai.lol/v1/audio/speech \
-H "Authorization: Bearer sk-lolai-xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-tts-flash",
"input": "你好,这是 LOLAI 的语音合成测试。",
"voice": "Cherry"
}' \
--output speech.wavaudio/wav / audio/mpeg),不是 JSON —— 直接写文件或播放。