Audio.Speech

April 21, 2026 ยท View on GitHub

Overview

Available Operations

complete

Speech

Example Usage

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.audio.speech.complete(input="<value>", stream=False, additional_properties={

    })

    with res as event_stream:
        for event in event_stream:
            # handle event
            print(event, flush=True)

Parameters

ParameterTypeRequiredDescription
inputstr:heavy_check_mark:Text to generate a speech from
modelOptionalNullable[str]:heavy_minus_sign:N/A
metadataDict[str, Any]:heavy_minus_sign:N/A
streamOptional[bool]:heavy_minus_sign:N/A
voice_idOptionalNullable[str]:heavy_minus_sign:The preset or custom voice to use for generating the speech.
ref_audioOptionalNullable[str]:heavy_minus_sign:The audio reference for generating the speech.
response_formatOptional[models.SpeechOutputFormat]:heavy_minus_sign:N/A
additional_propertiesDict[str, Any]:heavy_minus_sign:N/A
retriesOptional[utils.RetryConfig]:heavy_minus_sign:Configuration to override the default retry behavior of the client.

Response

models.SpeechV1AudioSpeechPostResponse

Errors

Error TypeStatus CodeContent Type
errors.HTTPValidationError422application/json
errors.SDKError4XX, 5XX*/*