cURL
curl --request POST \ --url https://api.qhaigc.net/v1/audio/speech \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "input": "<string>", "model": "<string>", "voice": "<string>" } '
将文本转换为自然流畅的语音
model
string
qhai-tts
voice
input
import openai client = openai.OpenAI( api_key="sk-your-api-key-here", base_url="https://api.qhaigc.net/v1" ) response = client.audio.speech.create( model="qhai-tts", voice="可爱少女", input="启航 AI API 系统是一款聚焦低成本探索 AIGC 无限可能的服务平台。" ) response.stream_to_file("output.mp3")
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
要生成音频的文本
语音模型名称
语音角色名称
音频文件流