reference.wav.
1
Create an API key
Sign in to the Gnani API dashboard and generate an API key.
2
Set your key
The examples read your key from the If you use a
GNANI_API_KEY environment variable, so it never appears in your code. Set it in the terminal you will run the examples from:.env file, load it with a library such as python-dotenv or dotenv, and keep the file out of version control.3
Install
jq is missing, install it from jqlang.org.4
Run
python quickstart.py and the Node.js example with node quickstart.mjs.There is no Python SDK tab: the Python SDK can use a speaker embedding but cannot create one. See Voice cloning in the Python SDK.
5
Check the output
The first request returns The second request returns
200 and a speaker embedding in data.voice_clone_embedding:200 with WAV audio, saved as cloned.wav. Play it: you should hear “नमस्ते, आप कैसे हैं?” (“Hello, how are you?”) in the voice from your recording.The cURL example saves it as speaker_embedding.json. Keep the embedding and reuse it for later requests. You only need to create it once per voice.If it didn’t work
Voice Cloning errors return a JSON body with amessage that says what is wrong, instead of an embedding or audio.
Every error is listed in the Error Reference.
Next
Voice Clone Embeddings
What makes a good reference recording.
Streaming
Receive cloned audio as it is generated.
Realtime
Lowest latency over a WebSocket.

