Studio
Developer tools
Build
- Overview
- Build your first workflow
- Building Workflows
- Install the SDK
- Build in Vibe
- Visualize your workflow
- Dependency Injection
- Connectors in workflows
- Mistral client
- Streaming Events
- Consuming Streaming Events
- Durable agents
- Payload offloading
- Workflow scheduling
- Child workflows
- Plugins
- Waiting for Conditions
- Continue-As-New
- Workflows Exception
- On-behalf-of workflows
- Encryption
- Compression
- Workflow Tags
- Search keys
- Triggers and webhooks
- Observability
- Secrets Manager
Context
Deploy
Observe & evaluate
Govern
Voice
OCR
Voices
Save audio samples as reusable voices. Once created, a voice can be referenced by voice_id in any speech generation request, avoiding the need to pass ref_audio each time.
Voice cloning usage policy: By using this model and its voice cloning feature, you agree to comply with all applicable laws and our usage policy. You are not authorized to use this model for any unlawful purpose, including to impersonate others, clone voices without explicit consent, or engage in fraud, deception, misinformation, disinformation, harm, or the generation of unlawful, harmful, libelous, abusive, harassing, discriminatory, hateful, or privacy-invasive content. You must disclose AI-generated or partially AI-generated content where required by law. We disclaim all liability for non-compliant use.
Create a voice by providing a name and a base64-encoded audio sample. The audio sample is used for voice cloning and can be retrieved later via get_sample_audio.
# Not available in the V1 SDK (mistralai 1.x).
# This feature requires the V2 SDK: pip install "mistralai>=2", then use the V2 tab.
# Migration guide: https://docs.mistral.ai/resources/migration-guides
import base64
from pathlib import Path
from mistralai.client import Mistral
client = Mistral(api_key="your-api-key")
sample_audio_b64 = base64.b64encode(Path("sample.mp3").read_bytes()).decode()
voice = client.audio.voices.create(
name="my-voice",
sample_audio=sample_audio_b64,
sample_filename="sample.mp3",
languages=["en", "fr"],
gender="female",
)
print(f"Created voice: {voice.id}")
print(f"Name: {voice.name}")
print(f"Languages: {voice.languages}")
import { Mistral } from "@mistralai/mistralai";
import { readFileSync } from "fs";
const client = new Mistral({ apiKey: "your-api-key" });
const sampleAudio = readFileSync("sample.mp3").toString("base64");
const voice = await client.audio.voices.create({
name: "my-voice",
sampleAudio: sampleAudio,
sampleFilename: "sample.mp3",
languages: ["en", "fr"],
gender: "female",
});
console.log(`Created voice: ${voice.id}`);
console.log(`Name: ${voice.name}`);
console.log(`Languages: ${voice.languages}`);
SAMPLE_AUDIO=$(base64 -i sample.mp3)
curl -X POST "https://api.mistral.ai/v1/audio/voices" \
-H "Authorization: Bearer $MISTRAL_API_KEY" \
-H "Content-Type: application/json" \
-d "{
\"name\": \"my-voice\",
\"sample_audio\": \"$SAMPLE_AUDIO\",
\"sample_filename\": \"sample.mp3\",
\"languages\": [\"en\", \"fr\"],
\"gender\": \"female\"
}"
{
"id": "a3e8f2b1-4c9d-4a6b-8e2f-1c3d5e7a9b0c",
"name": "my-voice",
"slug": null,
"languages": ["en", "fr"],
"gender": "male",
"age": null,
"tags": null,
"created_at": "2026-03-20T18:34:32.118943Z"
}
Parameters:
Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Display name for the voice |
| sample_audio | string | Yes | Base64-encoded audio file |
| sample_filename | string | No | Original filename (used for format detection) |
| slug | string | No | URL-friendly identifier |
| languages | string[] | No | Languages the voice supports (e.g. ["en", "fr"]) |
| gender | string | No | Gender label (e.g. "female", "male") |
| age | integer | No | Approximate age of the speaker |
| tags | string[] | No | Arbitrary tags for filtering |
List all available voices with offset-based pagination.
# Not available in the V1 SDK (mistralai 1.x).
# This feature requires the V2 SDK: pip install "mistralai>=2", then use the V2 tab.
# Migration guide: https://docs.mistral.ai/resources/migration-guides
from mistralai.client import Mistral
client = Mistral(api_key="your-api-key")
limit = 10
offset = 0
all_voices = []
while True:
page = client.audio.voices.list(limit=limit, offset=offset)
items = page.items or []
all_voices.extend(items)
if offset + len(items) >= page.total:
break
offset += len(items)
print(f"Total voices: {len(all_voices)}")
for voice in all_voices:
print(f" - {voice.name} ({voice.id}) languages={voice.languages}")
import { Mistral } from "@mistralai/mistralai";
const client = new Mistral({ apiKey: "your-api-key" });
const limit = 10;
let offset = 0;
const allVoices = [];
while (true) {
const page = await client.audio.voices.list({ limit, offset });
const items = page.items ?? [];
allVoices.push(...items);
if (offset + items.length >= page.total) break;
offset += items.length;
}
console.log(`Total voices: ${allVoices.length}`);
for (const voice of allVoices) {
console.log(` - ${voice.name} (${voice.id}) languages=${voice.languages}`);
}
curl "https://api.mistral.ai/v1/audio/voices?limit=10&offset=0" \
-H "Authorization: Bearer $MISTRAL_API_KEY"
{
"items": [
{
"id": "a3e8f2b1-4c9d-4a6b-8e2f-1c3d5e7a9b0c",
"name": "my-voice",
"slug": null,
"languages": ["en", "fr"],
"gender": "male",
"age": null,
"tags": null,
"created_at": "2026-03-20T18:34:32.118943Z"
}
],
"total": 1,
"page": 1,
"page_size": 10,
"total_pages": 1
}
Retrieve metadata for a specific voice by its ID.
# Not available in the V1 SDK (mistralai 1.x).
# This feature requires the V2 SDK: pip install "mistralai>=2", then use the V2 tab.
# Migration guide: https://docs.mistral.ai/resources/migration-guides
from mistralai.client import Mistral
client = Mistral(api_key="your-api-key")
voice = client.audio.voices.get(voice_id="your-voice-id")
print(f"Name: {voice.name}")
print(f"Languages: {voice.languages}")
print(f"Gender: {voice.gender}")
print(f"Created: {voice.created_at}")
import { Mistral } from "@mistralai/mistralai";
const client = new Mistral({ apiKey: "your-api-key" });
const voice = await client.audio.voices.get({ voiceId: "your-voice-id" });
console.log(`Name: ${voice.name}`);
console.log(`Languages: ${voice.languages}`);
console.log(`Gender: ${voice.gender}`);
console.log(`Created: ${voice.createdAt}`);
curl "https://api.mistral.ai/v1/audio/voices/$VOICE_ID" \
-H "Authorization: Bearer $MISTRAL_API_KEY"
{
"id": "a3e8f2b1-4c9d-4a6b-8e2f-1c3d5e7a9b0c",
"name": "my-voice",
"slug": null,
"languages": ["en", "fr"],
"gender": "male",
"age": null,
"tags": null,
"created_at": "2026-03-20T18:34:32.118943Z"
}
Partially update a voice's metadata. Only the fields you provide will be changed.
# Not available in the V1 SDK (mistralai 1.x).
# This feature requires the V2 SDK: pip install "mistralai>=2", then use the V2 tab.
# Migration guide: https://docs.mistral.ai/resources/migration-guides
from mistralai.client import Mistral
client = Mistral(api_key="your-api-key")
updated = client.audio.voices.update(
voice_id="your-voice-id",
name="my-updated-voice",
languages=["en", "fr", "es"],
tags=["narrator", "calm"],
)
print(f"Updated name: {updated.name}")
print(f"Updated languages: {updated.languages}")
import { Mistral } from "@mistralai/mistralai";
const client = new Mistral({ apiKey: "your-api-key" });
const updated = await client.audio.voices.update({
voiceId: "your-voice-id",
voiceUpdateRequest: {
name: "my-updated-voice",
languages: ["en", "fr", "es"],
tags: ["narrator", "calm"],
},
});
console.log(`Updated name: ${updated.name}`);
console.log(`Updated languages: ${updated.languages}`);
curl -X PATCH "https://api.mistral.ai/v1/audio/voices/$VOICE_ID" \
-H "Authorization: Bearer $MISTRAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "my-updated-voice",
"languages": ["en", "fr", "es"],
"tags": ["narrator", "calm"]
}'
{
"id": "a3e8f2b1-4c9d-4a6b-8e2f-1c3d5e7a9b0c",
"name": "my-updated-voice",
"slug": null,
"languages": ["en", "fr", "es"],
"gender": "male",
"age": null,
"tags": ["narrator", "calm"],
"created_at": "2026-03-20T18:34:32.118943Z"
}
Permanently delete a voice. Any speech requests using its voice_id will fail after deletion.
# Not available in the V1 SDK (mistralai 1.x).
# This feature requires the V2 SDK: pip install "mistralai>=2", then use the V2 tab.
# Migration guide: https://docs.mistral.ai/resources/migration-guides
from mistralai.client import Mistral
client = Mistral(api_key="your-api-key")
result = client.audio.voices.delete(voice_id="your-voice-id")
print(f"Deleted: {result.id}")
import { Mistral } from "@mistralai/mistralai";
const client = new Mistral({ apiKey: "your-api-key" });
const result = await client.audio.voices.delete({ voiceId: "your-voice-id" });
console.log(`Deleted: ${result.id}`);
curl -X DELETE "https://api.mistral.ai/v1/audio/voices/$VOICE_ID" \
-H "Authorization: Bearer $MISTRAL_API_KEY"
{
"id": "a3e8f2b1-4c9d-4a6b-8e2f-1c3d5e7a9b0c",
"name": "my-updated-voice",
"slug": null,
"languages": ["en", "fr", "es"],
"gender": "male",
"age": null,
"tags": ["narrator", "calm"],
"created_at": "2026-03-20T18:34:32.118943Z"
}
Retrieve the original audio sample that was used to create the voice, returned as raw audio bytes.
# Not available in the V1 SDK (mistralai 1.x).
# This feature requires the V2 SDK: pip install "mistralai>=2", then use the V2 tab.
# Migration guide: https://docs.mistral.ai/resources/migration-guides
from pathlib import Path
from mistralai.client import Mistral
client = Mistral(api_key="your-api-key")
audio_bytes = client.audio.voices.get_sample_audio(voice_id="your-voice-id")
Path("voice_sample.wav").write_bytes(audio_bytes)
print("Saved sample to voice_sample.wav")
import { Mistral } from "@mistralai/mistralai";
import { writeFileSync } from "fs";
const client = new Mistral({ apiKey: "your-api-key" });
const audioBytes = await client.audio.voices.getSampleAudio({
voiceId: "your-voice-id",
});
writeFileSync("voice_sample.wav", Buffer.from(audioBytes));
console.log("Saved sample to voice_sample.wav");
curl "https://api.mistral.ai/v1/audio/voices/$VOICE_ID/sample" \
-H "Authorization: Bearer $MISTRAL_API_KEY" \
> voice_sample.wav