Nombre maximal de voix à retourner













Voix audio
API de gestion des voix.












Exemples
Exemples réels de code
Lister toutes les voix
GET /v1/audio/voices#
Lister toutes les voix (à l'exclusion des données d'exemple)
Playground
Testez les endpoints en direct
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.audio.voices.list({});
console.log(result);
}
run();
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.audio.voices.list({});
console.log(result);
}
run();
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.audio.voices.list(limit=10, offset=0, type_="all")
# Handle response
print(res)
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.audio.voices.list(limit=10, offset=0, type_="all")
# Handle response
print(res)
curl https://api.mistral.ai/v1/audio/voices \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'curl https://api.mistral.ai/v1/audio/voices \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'200
{
"items": [
{
"created_at": "2025-12-17T10:25:07.818693Z",
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"user_id": null
}
],
"page": "1",
"page_size": "1000",
"total": 56,
"total_pages": "1"
}{
"items": [
{
"created_at": "2025-12-17T10:25:07.818693Z",
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"user_id": null
}
],
"page": "1",
"page_size": "1000",
"total": 56,
"total_pages": "1"
}Créer une nouvelle voix
POST /v1/audio/voices#
Créer une nouvelle voix avec un échantillon audio encodé en base64
Modèle de requête pour la création d'une nouvelle voix avec audio en base64.
Playground
Testez les endpoints en direct
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.audio.voices.create({
name: "<value>",
sampleAudio: "<value>",
});
console.log(result);
}
run();
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.audio.voices.create({
name: "<value>",
sampleAudio: "<value>",
});
console.log(result);
}
run();
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.audio.voices.create(name="<value>", sample_audio="<value>", retention_notice=30)
# Handle response
print(res)
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.audio.voices.create(name="<value>", sample_audio="<value>", retention_notice=30)
# Handle response
print(res)
curl https://api.mistral.ai/v1/audio/voices \
-X POST \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"name": "My voice",
"sample_audio": "base64-encoded-audio-data"
}'curl https://api.mistral.ai/v1/audio/voices \
-X POST \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"name": "My voice",
"sample_audio": "base64-encoded-audio-data"
}'200
{
"created_at": "2025-12-17T10:25:07.818693Z",
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"user_id": null
}{
"created_at": "2025-12-17T10:25:07.818693Z",
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"user_id": null
}Obtenir les détails d'une voix
GET /v1/audio/voices/{voice_id}#
Obtenir les détails d'une voix (à l'exclusion de l'échantillon)
Playground
Testez les endpoints en direct
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.audio.voices.get({
voiceId: "<id>",
});
console.log(result);
}
run();
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.audio.voices.get({
voiceId: "<id>",
});
console.log(result);
}
run();
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.audio.voices.get(voice_id="<id>")
# Handle response
print(res)
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.audio.voices.get(voice_id="<id>")
# Handle response
print(res)
curl https://api.mistral.ai/v1/audio/voices/{voice_id} \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'curl https://api.mistral.ai/v1/audio/voices/{voice_id} \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'200
{
"created_at": "2025-12-17T10:25:07.818693Z",
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"user_id": null
}{
"created_at": "2025-12-17T10:25:07.818693Z",
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"user_id": null
}Playground
Testez les endpoints en direct
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.audio.voices.delete({
voiceId: "f42bf0d7-8a10-4b98-bbfa-589a232209d2",
});
console.log(result);
}
run();
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.audio.voices.delete({
voiceId: "f42bf0d7-8a10-4b98-bbfa-589a232209d2",
});
console.log(result);
}
run();
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.audio.voices.delete(voice_id="f42bf0d7-8a10-4b98-bbfa-589a232209d2")
# Handle response
print(res)
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.audio.voices.delete(voice_id="f42bf0d7-8a10-4b98-bbfa-589a232209d2")
# Handle response
print(res)
curl https://api.mistral.ai/v1/audio/voices/{voice_id} \
-X DELETE \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json'curl https://api.mistral.ai/v1/audio/voices/{voice_id} \
-X DELETE \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json'200
{
"created_at": "2025-12-17T10:25:07.818693Z",
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"user_id": null
}{
"created_at": "2025-12-17T10:25:07.818693Z",
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"user_id": null
}Mettre à jour les métadonnées de la voix
PATCH /v1/audio/voices/{voice_id}#
Mettre à jour les métadonnées de la voix (nom, genre, langues, âge, balises).
Playground
Testez les endpoints en direct
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.audio.voices.update({
voiceId: "030a6b20-e287-414d-9a77-6b76a4a56c9d",
voiceUpdateRequest: {},
});
console.log(result);
}
run();
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.audio.voices.update({
voiceId: "030a6b20-e287-414d-9a77-6b76a4a56c9d",
voiceUpdateRequest: {},
});
console.log(result);
}
run();
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.audio.voices.update(voice_id="030a6b20-e287-414d-9a77-6b76a4a56c9d")
# Handle response
print(res)
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.audio.voices.update(voice_id="030a6b20-e287-414d-9a77-6b76a4a56c9d")
# Handle response
print(res)
curl https://api.mistral.ai/v1/audio/voices/{voice_id} \
-X PATCH \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{}'curl https://api.mistral.ai/v1/audio/voices/{voice_id} \
-X PATCH \
-H 'Authorization: Bearer YOUR_APIKEY_HERE' \
-H 'Content-Type: application/json' \
-d '{}'200
{
"created_at": "2025-12-17T10:25:07.818693Z",
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"user_id": null
}{
"created_at": "2025-12-17T10:25:07.818693Z",
"id": "019b2bd7-96e7-7219-8c0b-45a73da50088",
"name": "My resource",
"user_id": null
}Obtenir l'audio de l'échantillon de la voix
GET /v1/audio/voices/{voice_id}/sample#
Obtenir l'échantillon audio d'une voix
200
Réponse réussie
Playground
Testez les endpoints en direct
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.audio.voices.getSampleAudio({
voiceId: "<id>",
});
console.log(result);
}
run();
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: "MISTRAL_API_KEY",
});
async function run() {
const result = await mistral.audio.voices.getSampleAudio({
voiceId: "<id>",
});
console.log(result);
}
run();
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.audio.voices.get_sample_audio(voice_id="<id>")
# Handle response
print(res)
from mistralai.client import Mistral
import os
with Mistral(
api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:
res = mistral.audio.voices.get_sample_audio(voice_id="<id>")
# Handle response
print(res)
curl https://api.mistral.ai/v1/audio/voices/{voice_id}/sample \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'curl https://api.mistral.ai/v1/audio/voices/{voice_id}/sample \
-X GET \
-H 'Authorization: Bearer YOUR_APIKEY_HERE'200
"base64-encoded-data""base64-encoded-data"