voice_id: REST, WebSocket and Speech-to-Speech.
Starting from a recording?
Clone the speaker first, then enhance the clone.
Starting from a description?
Voice Design creates a new voice from words. Enhance cleans up a voice you already have.
How it works
1. Pick a source
A flagship voice, one of your clones, or a Voice Design candidate.
2. Enhance
One request, no other settings. Candidates are ready in about twenty seconds.
3. Listen
Audition each candidate against the source on the same line of Text-to-Speech.
4. Convert
Promote your pick to a permanent
voice_id.n_samples new
candidates, drafts with a vox_emb_ id, exactly like Voice Design candidates:
you audition them on POST /post/speech/tts, convert them with
POST /voices/from-embedding, and they expire after 30 days unless converted.
Access
Base URLhttps://api.gradium.ai/api, API key in the x-api-key header.
Quickstart
The example enhances a French clone. Replace$SOURCE with any voice id or
candidate id you own, or a flagship voice id.
1
Enhance the voice
201 Created
There is nothing else to set: the language comes from the source voice, and
so does the speaker. The request is checked before anything is queued, so
an unknown source or a source that cannot be enhanced fails here with
404 or 409 and nothing is billed.2
Wait for the candidates
200 OK
kind is enhance and enhance_config holds the source id
and its language. language is the source voice’s language, which the
candidate keeps. prompt is empty for an enhanced candidate.3
Listen to a candidate
Pass the candidate id as Candidates keep the same restrictions as Voice Design candidates: REST
only, capped audition text, and an opaque
voice_id on the Text-to-Speech endpoint, with
text in the voice’s language. Synthesise the same line with the source
voice too: the difference between the two files is what Enhance did.404 Embedding not found until
ready.4
Convert the candidate into a voice
201 Created
uid is your permanent voice_id. Store it. The new voice keeps the
source’s language. Converting is free, uses one custom-voice slot, and
clears the candidate’s expiry. Candidates from one request are variations:
if you like one, convert it rather than re-running the request. The source
voice is untouched, so you can keep both or delete the source once you are
happy with the enhanced one.Complete example
SetGRADIUM_API_KEY and SOURCE, then run it. It creates a real voice in
your account.
voice_enhance.py
Sources you can enhance
Tips from testing
- Compare against the source reading the same text. Enhance changes how the voice sounds, not what it says or in which language. Put the source and the candidate side by side in your review UI, on the same line.
- Start with a clone. Flagship voices are produced from clean recordings already; the clone you wish sounded cleaner is the natural source.
- Candidates vary. Five samples from one request, or five separate requests, give five slightly different results. Convert the one you like; do not expect a re-run to reproduce it.
- Keep the source. Converting a candidate does not replace the source
voice. Switch your
voice_idover once you have listened, and delete the old one when you no longer need it. - Budget the wait. Enhanced candidates take fifteen to twenty seconds, longer than Voice Design candidates. Poll rather than block a request on it.
Candidate lifecycle
Enhanced candidates follow the Voice Design candidate lifecycle: 30 days retention, cleared on conversion,DELETE /voice-generator/embeddings/{embedding_id} to
remove one early. Deleting the source voice or candidate after the 201 never
breaks the request: each candidate holds its own copy of the source.
Limits
Errors
Errors are{"detail": "..."}, except 422, which carries a list of field
errors.
Next steps
Custom Voices
Clone a speaker, with a language, so the clone can be enhanced.
Voice Design
Create a voice from a description instead.
Manage Voices
Set a language on an older clone, list and delete voices.
API Reference
The enhance endpoint in full.