11 lines
468 B
Python
11 lines
468 B
Python
|
|
def synthesize_minimax(text):
|
||
|
|
url = "https://api.minimaxi.com/v1/t2a_v2"
|
||
|
|
headers = {"Authorization": f"Bearer {MINIMAX_API_KEY}", "Content-Type": "application/json"}
|
||
|
|
payload = {
|
||
|
|
"model": "speech-02-turbo",
|
||
|
|
"text": text,
|
||
|
|
"voice_setting": {"voice_id": MINIMAX_VOICE_ID}
|
||
|
|
}
|
||
|
|
resp = requests.post(url, headers=headers, json=payload)
|
||
|
|
return jsonify({"success": True, "model": "minimax", "text": text, "response": resp.json()})
|