Skip to content

Mistral

Mistral is an OpenAI-compatible provider with custom compatibility handling for specific features. DeepIntShield converts requests to Mistral’s expected format while supporting their unique API endpoints. Key characteristics:

  • OpenAI-compatible format - Chat and streaming endpoints
  • Transcription API - Native audio transcription support
  • Tool calling support - Function definitions with string-based tool choice
  • Streaming support - Server-Sent Events for chat and transcription
  • Parameter compatibility - max_completion_tokens → max_tokens conversion
OperationNon-StreamingStreamingEndpoint
Chat Completions/v1/chat/completions
Responses API/v1/chat/completions
Transcriptions (STT)/v1/audio/transcriptions
Embeddings-/v1/embeddings
List Models-/v1/models
Image Generation-
Text Completions-
Speech (TTS)-
Files-
Batch-

Mistral supports most OpenAI chat completion parameters with some conversions. For standard OpenAI parameter reference, see OpenAI Chat Completions.

ParameterOpenAIMistralNotes
max_completion_tokensmax_tokensConversion required
temperatureDirect pass-through
top_pDirect pass-through
stopStop sequences
toolsFunction definitions
tool_choiceString onlyString onlyLimitations apply
userMax 64 characters
frequency_penalty, presence_penaltyDirect pass-through

max_completion_tokens → max_tokens:

// DeepIntShield request
{"max_completion_tokens": 4096}
// Mistral API
{"max_tokens": 4096}

Tool Choice Simplification: Mistral only supports simple string tool choice, not structured constraints:

// OpenAI supports specific tool forcing
{"tool_choice": {"type": "function", "function": {"name": "specific_tool"}}}
// Mistral only supports
{"tool_choice": "any"} // or "none", "auto"

Removed for Mistral compatibility:

  • prompt_cache_key - Not supported
  • cache_control - Stripped from content blocks
  • verbosity - Anthropic-specific
  • store - Not supported
  • service_tier - Not supported

Full OpenAI message support:

  • All roles: user, assistant, system, tool, developer
  • Content types: text, images, audio, files

Tool definitions supported with constraints:

AspectSupportNotes
Function definitionsFull parameter schema support
Tool choice “auto”Default mode
Tool choice “any”Requires any tool
Tool choice “none”No tools
Specific tool forcingNot supported - simplified to “any”
Parallel toolsMultiple tools in one turn

Limitation Caveat:

// DeepIntShield allows specifying a specific tool
{
"tool_choice": {
"type": "function",
"function": {"name": "get_weather"} // ❌ Not supported
}
}
// Mistral compatibility - converted to generic "any"
{
"tool_choice": "any"
}

Standard OpenAI-compatible response:

  • choices[].message.content - Response text
  • choices[].message.tool_calls - Function calls
  • usage - Token counts (prompt_tokens, completion_tokens)
  • finish_reason - stop, tool_calls, length

Converted internally to Chat Completions with format transformation:

ResponsesRequest → ChatRequest → ChatCompletion → ResponsesResponse

Same parameter support and tool handling as Chat Completions.


Mistral provides native audio transcription with streaming support.

ParameterDeepIntShieldMistralNotes
fileBinary audioMultipart formConverted to multipart
modelModel namemodel
languageISO-639-1languageOptional language hint
promptOptionalpromptContext for recognition
response_formatFormat typeresponse_formatjson, text, etc.
temperaturefloattemperatureSampling temperature
timestamp_granularitiesArrayArray fieldSegment/word timestamps

Transcription requests are sent as multipart/form-data:

--boundary
Content-Disposition: form-data; name="file"; filename="audio.mp3"
[binary audio data]
--boundary
Content-Disposition: form-data; name="model"
voxtral-mini-latest
--boundary
Content-Disposition: form-data; name="language"
en
--boundary--
{
"text": "transcribed text",
"language": "en",
"duration": 3.5,
"segments": [{
"id": 0,
"start": 0.0,
"end": 1.5,
"text": "transcribed segment",
"temperature": 0.0,
"avg_logprob": -0.45,
"compression_ratio": 1.2,
"no_speech_prob": 0.001
}],
"words": [{
"word": "transcribed",
"start": 0.0,
"end": 0.8
}]
}

Mistral supports SSE streaming for transcription with custom event types:

Event TypeContentNotes
transcription.languageLanguage codeLanguage detected
transcription.text.deltaText deltaIncremental text
transcription.segmentFull segmentComplete segment data
transcription.doneFinal usageCompletion with tokens

Mistral supports text embeddings:

ParameterNotes
inputText or array of texts
modelEmbedding model name
dimensionsCustom output dimensions (optional)
encoding_format”float” or “base64”

Response returns embedding vectors with token usage.


Lists available Mistral models with context length and capabilities.


FeatureReason
Text CompletionsNot offered by Mistral API
Image GenerationNot yet implemented in DeepIntShield integration (Mistral API supports this)
Speech/TTSNot offered by Mistral API
File ManagementNot offered by Mistral API
Batch OperationsNot offered by Mistral API

Cache Control Stripped

Severity: Medium Behavior: Cache control directives removed from messages Impact: Prompt caching features unavailable Code: Stripped during JSON marshaling

Parameter Filtering

Severity: Low Behavior: OpenAI-specific parameters filtered Impact: prompt_cache_key, verbosity, store removed Code: filterOpenAISpecificParameters

User Field Size Limit

Severity: Low Behavior: User field > 64 characters silently dropped Impact: Longer user identifiers are lost Code: SanitizeUserField enforces 64-char max