curl -X POST "https://api.vogent.ai/api/tts" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "text": "So I tried this new thing called Voicelab that I found online, and the voices that it generated were super realistic.", "voiceId": "23b2186b-ed56-4185-998c-8d19e1bb227a" }' \ --output my-first-voice.wav
Now let’s try the multispeaker feature to create a conversation:
Copy
import requestsapi_key = "YOUR_API_KEY"# Create a conversation between two peopleconversation = { "lines": [ { "text": "So I tried this new thing called Voicelab that I found online, and the voices that it generated were super realistic.", "voiceId": "23b2186b-ed56-4185-998c-8d19e1bb227a" # The CSM-1B professional voice clone "Mabel" }, { "text": "That's interesting, was it actually like super realistic or was it just not robotic.", "voiceId": "50c9287d-bcee-4f2a-943f-f0f2184a5d3b" # The CSM-1B professional voice clone "Kevin" }, { "text": "I mean, it's hard to tell the difference from a real person speaking. The technology is incredible.", "voiceId": "23b2186b-ed56-4185-998c-8d19e1bb227a" # The CSM-1B professional voice clone "Mabel" }, { "text": "Interesting, I've been looking for a new API to use in my app. I'll definitely check it out then.", "voiceId": "50c9287d-bcee-4f2a-943f-f0f2184a5d3b" # The CSM-1B professional voice clone "Kevin" } ]}response = requests.post( "https://api.vogent.ai/api/tts/multispeaker", headers={"Authorization": f"Bearer {api_key}"}, json=conversation)if response.status_code == 200: with open("conversation.wav", "wb") as f: f.write(response.content) print("✅ Conversation saved as 'conversation.wav'")else: print(f"❌ Error: {response.status_code}")