---
title: "Mistral | Micdrop"
description: "Mistral AI implementation for @micdrop/server."
url: "https://micdrop.dev/docs/ai-integration/provided-integrations/mistral"
---

*   [Getting Started](/docs/getting-started)
*   [Client (Browser)](/docs/client)
    
    *   [Installation](/docs/client/installation)
    *   [React Hooks](/docs/client/react-hooks)
    *   [Start/Stop Call](/docs/client/start-stop-call)
    *   [Pause/Resume Call](/docs/client/pause-resume-call)
    *   [Mute/Unmute Call](/docs/client/mute-unmute-call)
    *   [Call State](/docs/client/call-state)
    *   [Display Conversation Messages](/docs/client/display-conversation-messages)
    *   [Handling Tool Calls](/docs/client/handling-tool-calls)
    *   [Device Management](/docs/client/devices-management)
    *   [Voice Activity Detection (VAD)](/docs/client/vad)
    *   [Error Handling](/docs/client/error-handling)
    *   Utility Classes
        
        *   [Mic](/docs/client/utility-classes/mic)
        *   [MicdropClient](/docs/client/utility-classes/micdrop-client)
        *   [MicRecorder](/docs/client/utility-classes/mic-recorder)
        *   [Speaker](/docs/client/utility-classes/speaker)
        
    
*   [Server (Node.js)](/docs/server)
    
    *   [Installation](/docs/server/installation)
    *   [With Fastify](/docs/server/with-fastify)
    *   [With NestJS](/docs/server/with-nestjs)
    *   [Auth and Parameters](/docs/server/auth-and-parameters)
    *   [First Message](/docs/server/first-message)
    *   [Save Messages](/docs/server/save-messages)
    *   [Resume a Conversation](/docs/server/resume-conversation)
    *   [Recording Audio](/docs/server/recording-audio)
    *   [Error Handling](/docs/server/error-handling)
    *   [Tools](/docs/server/tools)
    *   [Extract Value from Answer](/docs/server/extract)
    *   [Auto End Call](/docs/server/auto-end-call)
    *   [Semantic Turn Detection](/docs/server/semantic-turn-detection)
    *   [Noise Filtering](/docs/server/noise-filtering)
    *   [Micdrop Protocol](/docs/server/protocol)
    
*   [AI Integrations](/docs/ai-integration)
    
    *   Provided Integrations
        
        *   [AI SDK](/docs/ai-integration/provided-integrations/ai-sdk)
        *   [Cartesia](/docs/ai-integration/provided-integrations/cartesia)
        *   [ElevenLabs](/docs/ai-integration/provided-integrations/elevenlabs)
        *   [Gladia](/docs/ai-integration/provided-integrations/gladia)
        *   [Gradium](/docs/ai-integration/provided-integrations/gradium)
        *   [Mistral](/docs/ai-integration/provided-integrations/mistral)
        *   [OpenAI](/docs/ai-integration/provided-integrations/openai)
        
    *   Custom Integrations
        
        *   [Agent (LLM)](/docs/ai-integration/custom-integrations/custom-agent)
        *   [Speech-to-Text (STT)](/docs/ai-integration/custom-integrations/custom-stt)
        *   [Text-to-Speech (TTS)](/docs/ai-integration/custom-integrations/custom-tts)
        
    *   Fallback Strategies
        
        *   [FallbackAgent](/docs/ai-integration/fallback-strategies/agent-fallback)
        *   [FallbackSTT](/docs/ai-integration/fallback-strategies/stt-fallback)
        *   [FallbackTTS](/docs/ai-integration/fallback-strategies/tts-fallback)
        
    *   [IA Vocale Souveraine 🇫🇷🇪🇺](/docs/ai-integration/sovereign-voice-ai)
    

[Micdrop](/) › [Documentation](/docs/getting-started)

# Mistral

Mistral AI implementation for [@micdrop/server](/docs/server).

This package provides an AI agent implementation using Mistral AI’s API and a real-time speech-to-text implementation using Mistral’s Voxtral realtime transcription.

## Installation

Terminal window

```
npm install @micdrop/mistral
```

## Mistral Agent

### Usage

```
import { MistralAgent } from '@micdrop/mistral'import { MicdropServer } from '@micdrop/server'
const agent = new MistralAgent({  apiKey: process.env.MISTRAL_API_KEY || '',  model: 'mistral-large-latest',  systemPrompt: 'You are a helpful assistant',})
// Use with MicdropServernew MicdropServer(socket, {  agent,  // ... other options})
```

### Options

Option

Type

Default

Description

`apiKey`

`string`

Required

Your Mistral AI API key

`model`

`string`

`'mistral-large-latest'`

Mistral AI model to use

`systemPrompt`

`string`

Required

System prompt for the agent

`maxRetry`

`number`

`3`

Maximum number of retries on API failures

`retryDelay`

`number`

`500`

Delay in milliseconds between retries

`maxSteps`

`number`

`5`

Maximum number of steps (for tool calls)

`autoEndCall`

`boolean | string`

`false`

[Auto-detect when user wants to end call](/docs/server/auto-end-call)

`autoSemanticTurn`

`boolean | string`

`false`

[Handle incomplete user sentences](/docs/server/semantic-turn-detection)

`autoIgnoreUserNoise`

`boolean | string`

`false`

[Filter meaningless user sounds](/docs/server/noise-filtering)

`extract`

[`ExtractJsonOptions`](/docs/server/extract#json-extraction) | [`ExtractTagOptions`](/docs/server/extract#custom-tag-extraction)

`undefined`

Extract structured data from responses

`onBeforeAnswer`

`function`

`undefined`

Hook called before answer generation - return `true` to skip generation

`settings`

`object`

`{}`

Additional Mistral AI API parameters

### Available Models

Mistral AI offers several models you can choose from:

*   **`ministral-8b-latest`** - Fast and efficient 8B parameter model (default)
*   **`mistral-large-latest`** - Most capable model for complex tasks
*   **`mistral-small-latest`** - Balanced performance and cost
*   **`codestral-latest`** - Specialized for code generation

### Settings Object

The `settings` parameter accepts any additional options from the Mistral AI Chat Completions API:

```
const agent = new MistralAgent({  apiKey: process.env.MISTRAL_API_KEY || '',  systemPrompt: 'You are a helpful assistant',  settings: {    temperature: 0.7, // Controls randomness (0-1)    max_tokens: 1000, // Maximum tokens in response    top_p: 0.9, // Nucleus sampling parameter    random_seed: 42, // For reproducible outputs    safe_prompt: false, // Enable/disable safety filtering  },})
```

### Advanced Features

The Mistral Agent supports advanced features for improved conversation handling:

*   **[Auto End Call](/docs/server/auto-end-call)**: Automatically detect when users want to end the conversation
*   **[Semantic Turn Detection](/docs/server/semantic-turn-detection)**: Handle incomplete sentences for natural flow
*   **[User Noise Filtering](/docs/server/noise-filtering)**: Filter out meaningless sounds and filler words
*   **[Extract Value from Answer](/docs/server/extract)**: Extract structured data from responses
*   **[Tools](/docs/server/tools)**: Add custom tools to the agent

## Mistral STT (Speech-to-Text)

Real-time transcription using Mistral’s Voxtral realtime models.

### Usage

```
import { MistralSTT } from '@micdrop/mistral'import { MicdropServer } from '@micdrop/server'
const stt = new MistralSTT({  apiKey: process.env.MISTRAL_API_KEY || '',})
// Use with MicdropServernew MicdropServer(socket, {  stt,  // ... other options})
```

### Options

Option

Type

Default

Description

`apiKey`

`string`

Required

Your Mistral AI API key

`model`

`string`

`'voxtral-mini-transcribe-realtime-2602'`

Realtime transcription model to use

`encoding`

`MistralAudioEncoding`

`'pcm_s16le'`

Audio encoding of the incoming stream

`targetStreamingDelayMs`

`number`

Optional

Target streaming delay in milliseconds

`connectionTimeout`

`number`

`5000`

Timeout in milliseconds for WebSocket connection

`transcriptionTimeout`

`number`

`4000`

Timeout in milliseconds to wait for transcription

`retryDelay`

`number`

`1000`

Delay in milliseconds between reconnection attempts

`maxRetry`

`number`

`3`

Maximum number of reconnection attempts before failing

The Micdrop client streams 16kHz PCM16 mono audio, which matches Voxtral’s default input format, so no resampling is required.

[Previous← Gradium](/docs/ai-integration/provided-integrations/gradium)[NextOpenAI →](/docs/ai-integration/provided-integrations/openai)

On this page

*   [Installation](#installation)
*   [Mistral Agent](#mistral-agent)
*   [Usage](#usage)
*   [Options](#options)
*   [Available Models](#available-models)
*   [Settings Object](#settings-object)
*   [Advanced Features](#advanced-features)
*   [Mistral STT (Speech-to-Text)](#mistral-stt-speech-to-text)
*   [Usage](#usage-1)
*   [Options](#options-1)
