Agent configuration

This page lists every option you can pass to client.audio.sessions.init(). Options come in two scopes. Agent options define the agent itself: its models, voice, instructions, tools, and turn-taking. You can save them as a saved agent. Session options only apply to the session you open, such as which saved agent to start from and which audio interface to use.

Note

The tables use the Python names. In TypeScript, the same options are in camelCase: api_key becomes apiKey, server_url becomes serverUrl, and turn.allow_interruptions becomes turn.allowInterruptions.

The client

The client

client.audio.sessions.init() is a method on the general-purpose Mistral client. Construct the client once, then start any number of sessions from it.

Mistral(
    api_key: str,
    server_url: str = "https://api.mistral.ai",
    timeout_ms: int = 60000,
)
ParameterTypeDefaultDescription
api_keystrRequiredYour Mistral API key.
server_urlstr"https://api.mistral.ai"API base URL.
timeout_msint60000Timeout for the requests that create and close sessions.
Inline or saved configuration

Inline or saved configuration

You can pass the agent options to init() every time, which suits quick experiments. Or you can save them once as an agent and start each session with agent_id. When you set agent_id, the saved configuration is the base, and any agent option you also pass to init() overrides it for that session only. The saved agent doesn't change. Session options always apply. For an example, see Create an agent and start a session.

i
Information

In the browser, you don't call init(): your server creates the session with client.audio.sessions.create(), which takes the same options. See the Browser guide.

init() options

init() options

Agent options

Agent options

These options are part of the agent configuration, and you can save them on an agent.

OptionTypeDefaultDescription
llmmappingmistral-small-latestModel that generates the answers.
sttmappingSpeech-to-text model, with optional language (ISO 639-1 code such as "fr"), context_bias (terms to favor), target_streaming_delay_ms (80 to 1200, default 240), and turn_detection (see End-of-turn detection). language, context_bias, and turn_detection need a Voxtral 3 realtime model; other models return a 422 error.
ttsmappingText-to-speech model and voice (voice_id).
instructionsstrNoneSystem prompt for the agent.
toolslist of toolsNoneTools the agent can call. See Tools.
welcome_messagestrNoneMessage the agent speaks when the session connects.
turnmappingallow_interruptions=TrueTurn-taking settings, including whether the user can interrupt the agent.
Session options

Session options

These options only apply to the session you open.

OptionTypeDefaultDescription
agent_idstrNoneStart the session from a saved agent.
agent_versionintLatestPin a specific version of agent_id.
audio_interfaceAudioInterfaceNoneAudio input and output. Leave it out to handle audio yourself, see Custom audio.
http_headersmapping of str to strNoneExtra headers for the request that creates the session.
End-of-turn detection

End-of-turn detection

Set stt.turn_detection to let a Voxtral 3 realtime model decide when the user has finished speaking. Without it, the agent uses the model's default turn detection. Pass {} to use the server defaults, or set any of these fields:

FieldRangeServer defaultWhat it does
start_threshold0 to 10.5Decides when the user starts or resumes speaking. Raise it if turns start too easily, such as on background noise.
eager_end_threshold0 to 10.5Decides when the user may have stopped. Lower it if eager ends fire too often.
end_threshold0 to 10.33Decides when the user has stopped. Lower it to cut people off less, at the cost of a later reply.
min_silence_ms0 or more500Minimum pause before the turn can end. Increase it to end turns too early less often, at the cost of a later reply.
end_timeout_ms0 or more3000Maximum pause before the turn ends anyway. Decrease it to cap the longest wait.

For example, to let the agent answer after a shorter silence:

session = await client.audio.sessions.init(
    stt={
        "model": "voxtral-mini-transcribe-realtime-3",
        "turn_detection": {"min_silence_ms": 300},
    },
)

For what each threshold does and the faster Aggressive preset, see Turn detection.

Text-to-speech

Text-to-speech

tts accepts the following fields:

FieldAvailabilityDescription
modelAllText-to-speech model to use. Options are Voxtral TTS 3 (recommended) voxtral-mini-tts-3 and Voxtral TTS 2 voxtral-mini-tts-2603.
voice_idAllVoice to use, depending on the model. See the following lists.
phoneme_hintsVoxtral TTS 3 onlyPronunciation of specific words, as a map from each word to its list of IPA phonemes.
expressivenessVoxtral TTS 3 onlyNot available yet: this option is disabled for now. Will set how expressive the voice is, from 1.0 to 5.0.
Pronunciation

Pronunciation

Use phoneme_hints to fix how the agent says names, brands, or acronyms. Each word maps to a list of IPA phonemes. Words are case-sensitive. Only English phonemes are supported, and a phoneme outside that set is rejected when you create the session or save the agent.

session = await client.audio.sessions.init(
    tts={
        "model": "voxtral-mini-tts-3",
        "voice_id": "voice_447",
        "phoneme_hints": {"Mistral": ["m", "ɪ", "s", "t", "ɹ", "ɑ", "l"]},
    },
)
Voxtral TTS 3 voices

Voxtral TTS 3 voices

On top of Voxtral TTS 2 voices listed below, here are the additional actor voices supported by Voxtral TTS 3.

VoiceLanguageGendervoice_id
RichardEnglish (UK)Malevoice_1788
JulesEnglish (UK)Femalevoice_1787
JadeEnglish (UK)Femalevoice_1786
SarahEnglish (US)Femalevoice_478
YaelEnglish (US)Femalevoice_447
EricEnglish (US)Malevoice_485
JesseEnglish (US)Malevoice_484
EsmeraldaSpanishFemalevoice_483
AndreaItalianFemalevoice_482
FionaGermanFemalevoice_481
MarinaPortugueseFemalevoice_480
LindaArabicFemalevoice_479
Voxtral TTS 2 voices

Voxtral TTS 2 voices

On top of these actor voices, Voxtral TTS 2 supports instant voice cloning to create a voice from an audio sample.

VoiceLanguageGendervoice_id
PaulEnglish (US)Maleen_paul_{neutral,sad,happy,frustrated,excited,confident,cheerful,angry}
OliverEnglish (UK)Malegb_oliver_{neutral,sad,excited,curious,confident,cheerful,angry}
JaneEnglish (UK)Femalegb_jane_{neutral,sarcasm,confused,shameful,sad,jealousy,frustrated,curious,confident}
MarieFrenchFemalefr_marie_{neutral,sad,happy,excited,curious,angry}
Turn-taking

Turn-taking

turn controls how the agent shares the conversation with the user:

FieldDescription
allow_interruptionsWhether the user can interrupt the agent while it speaks. Defaults to True.
inactivityReminders the agent speaks when the user stays silent.

inactivity accepts:

FieldTypeDescription
timeout_msintMilliseconds of silence before the first reminder. Default: 10000.
max_remindersintMaximum number of reminders before the session ends. Default: 2.
messageslist of strMessages the agent speaks. Default: ["Are you still there?"].
session = await client.audio.sessions.init(
    turn={
        "allow_interruptions": True,
        "inactivity": {
            "timeout_ms": 10000,
            "max_reminders": 2,
            "messages": ["Are you still there?"],
        },
    },
)

You can change instructions, tools, and turn on a running session. See Update a live session.

Going further

Going further