Tree BG 1
Tree
Tree
TreeLeaves
TreeLeaves
Cat IdleGrassGrassRockRock

Voix audio

API de gestion des voix.

Lister toutes les voix

GET /v1/audio/voices#

Lister toutes les voix (à l'exclusion des données d'exemple)

200

Réponse réussie

page#
*integer
page_size#
*integer
total#
*integer
total_pages#
*integer

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();
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'

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"
}

Créer une nouvelle voix

POST /v1/audio/voices#

Créer une nouvelle voix avec un échantillon audio encodé en base64

200

Réponse réussie

age#
integer|null
color#
string|null
created_at#
*date-time
description#
string|null
gender#
string|null
id#
*string
languages#
array<string>
name#
*string
retention_notice#
integer

Default Value: 30

slug#
string|null
tags#
array<string>|null
trimmed_seconds#
number|null
user_id#
*string|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.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)

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
}

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)

200

Réponse réussie

age#
integer|null
color#
string|null
created_at#
*date-time
description#
string|null
gender#
string|null
id#
*string
languages#
array<string>
name#
*string
retention_notice#
integer

Default Value: 30

slug#
string|null
tags#
array<string>|null
trimmed_seconds#
number|null
user_id#
*string|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.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)

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
}

Supprimer une voix personnalisée

DELETE /v1/audio/voices/{voice_id}#

Supprimer une voix personnalisée

200

Réponse réussie

age#
integer|null
color#
string|null
created_at#
*date-time
description#
string|null
gender#
string|null
id#
*string
languages#
array<string>
name#
*string
retention_notice#
integer

Default Value: 30

slug#
string|null
tags#
array<string>|null
trimmed_seconds#
number|null
user_id#
*string|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();
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'

200

{
  "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).

200

Réponse réussie

age#
integer|null
color#
string|null
created_at#
*date-time
description#
string|null
gender#
string|null
id#
*string
languages#
array<string>
name#
*string
retention_notice#
integer

Default Value: 30

slug#
string|null
tags#
array<string>|null
trimmed_seconds#
number|null
user_id#
*string|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.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)

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
}

Obtenir l'audio de l'échantillon de la voix

GET /v1/audio/voices/{voice_id}/sample#

Obtenir l'échantillon audio d'une voix

200

Response Type
binary

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();
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'

200

"base64-encoded-data"