Designing a voice
Generate a voice from a text prompt without source audio. The flow has two steps:
- Call
POST /v1/voice-previews/designwith a description and a sample script. The request returns onegenerated_voice_idpreview by default. - Pick the preview you like and call
POST /v1/voice-previews/{generated_voice_id}/saveto persist a real voice.
Step 1: generate previews
Billed by successful preview count × preview text character count. voice_description and text each accept up to 500 characters. Set preview_count to 3 when you want three candidates in one request.
python
import os
from breeze_blue import BreezeBlue
client = BreezeBlue(api_key=os.environ["BREEZE_API_KEY"])
design = client.voices.create_design_preview(
voice_description="A confident young woman with a warm British accent.",
text="The lighthouse blinked twice and went silent.",
)
for preview in design["previews"]:
print(preview["generated_voice_id"])
typescript
import { BreezeBlueClient } from "@breeze.blue/sdk";
const client = new BreezeBlueClient({
apiKey: process.env.BREEZE_API_KEY!,
});
const design = await client.voices.createDesignPreview({
voiceDescription: "A confident young woman with a warm British accent.",
text: "The lighthouse blinked twice and went silent.",
});
for (const preview of design.previews) {
console.log(preview.generatedVoiceId);
}
curl
curl -X POST "https://api.breeze.blue/v1/voice-previews/design" \
-H "xi-api-key: $BREEZE_API_KEY" \
-H "content-type: application/json" \
-d '{
"voice_description": "A confident young woman with a warm British accent.",
"text": "The lighthouse blinked twice and went silent."
}'
import os
from breeze_blue import BreezeBlue
client = BreezeBlue(api_key=os.environ["BREEZE_API_KEY"])
design = client.voices.create_design_preview(
voice_description="A confident young woman with a warm British accent.",
text="The lighthouse blinked twice and went silent.",
)
for preview in design["previews"]:
print(preview["generated_voice_id"])Step 2: preview the audio
Each preview includes a generated_voice_id. Stream the sample with GET /v1/voice-previews/{generated_voice_id}/stream or decode the audio_base_64 field returned in the design response.
Step 3: persist the voice
python
import os
from breeze_blue import BreezeBlue
client = BreezeBlue(api_key=os.environ["BREEZE_API_KEY"])
voice = client.voices.save_preview(
generated_voice_id="gvi_01hpreview",
voice_name="Lighthouse Keeper",
voice_description="A confident young woman with a warm British accent.",
)
print(voice["voice_id"])
typescript
import { BreezeBlueClient } from "@breeze.blue/sdk";
const client = new BreezeBlueClient({
apiKey: process.env.BREEZE_API_KEY!,
});
const voice = await client.voices.savePreview({
generatedVoiceId: "gvi_01hpreview",
voiceName: "Lighthouse Keeper",
voiceDescription: "A confident young woman with a warm British accent.",
});
console.log(voice.voiceId);
curl
curl -X POST "https://api.breeze.blue/v1/voice-previews/gvi_01hpreview/save" \
-H "xi-api-key: $BREEZE_API_KEY" \
-H "content-type: application/json" \
-d '{
"voice_name": "Lighthouse Keeper",
"voice_description": "A confident young woman with a warm British accent."
}'
import os
from breeze_blue import BreezeBlue
client = BreezeBlue(api_key=os.environ["BREEZE_API_KEY"])
voice = client.voices.save_preview(
generated_voice_id="gvi_01hpreview",
voice_name="Lighthouse Keeper",
voice_description="A confident young woman with a warm British accent.",
)
print(voice["voice_id"])The saved voice works with POST /v1/text-to-speech/{voice_id} and appears on the voices page in the console.