List all voices (excluding sample data)
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)
models.VoiceListResponse
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.SDKError |
4XX, 5XX |
*/* |
Create a new voice with a base64-encoded audio sample
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)
| Parameter |
Type |
Required |
Description |
name |
str |
✔️ |
N/A |
sample_audio |
str |
✔️ |
Base64-encoded audio file |
slug |
OptionalNullable[str] |
➖ |
N/A |
languages |
List[str] |
➖ |
N/A |
gender |
OptionalNullable[str] |
➖ |
N/A |
age |
OptionalNullable[int] |
➖ |
N/A |
tags |
List[str] |
➖ |
N/A |
color |
OptionalNullable[str] |
➖ |
N/A |
retention_notice |
Optional[int] |
➖ |
N/A |
sample_filename |
OptionalNullable[str] |
➖ |
Original filename for extension detection |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.VoiceResponse
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.SDKError |
4XX, 5XX |
*/* |
Delete a custom voice
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)
| Parameter |
Type |
Required |
Description |
voice_id |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.VoiceResponse
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.SDKError |
4XX, 5XX |
*/* |
Update voice metadata (name, gender, languages, age, tags).
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)
| Parameter |
Type |
Required |
Description |
voice_id |
str |
✔️ |
N/A |
name |
OptionalNullable[str] |
➖ |
N/A |
languages |
List[str] |
➖ |
N/A |
gender |
OptionalNullable[str] |
➖ |
N/A |
age |
OptionalNullable[int] |
➖ |
N/A |
tags |
List[str] |
➖ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.VoiceResponse
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.SDKError |
4XX, 5XX |
*/* |
Get voice details (excluding sample)
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)
| Parameter |
Type |
Required |
Description |
voice_id |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
models.VoiceResponse
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.SDKError |
4XX, 5XX |
*/* |
Get the audio sample for a voice
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)
| Parameter |
Type |
Required |
Description |
voice_id |
str |
✔️ |
N/A |
retries |
Optional[utils.RetryConfig] |
➖ |
Configuration to override the default retry behavior of the client. |
str
| Error Type |
Status Code |
Content Type |
| errors.HTTPValidationError |
422 |
application/json |
| errors.SDKError |
4XX, 5XX |
*/* |