Mistral Small 4
API guide
Chat completion
Basic chat completion to test the endpoint or run conversation tasks.
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mistral/mistral-small-4",
"messages": [
{"role": "user", "content": "Explain the difference between MoE and dense transformer models"}
]
}'Streaming
Stream tokens incrementally for real-time UX. Mistral Small 4 supports server-sent events via the standard OpenAI streaming interface.
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mistral/mistral-small-4",
"messages": [{"role": "user", "content": "Write a haiku about AI"}],
"stream": true
}'Tool calling
Mistral Small 4 supports native tool/function calling through the OpenAI-compatible tools API. The 'mistral' tool call parser is recommended for self-hosted vLLM deployments.
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mistral/mistral-small-4",
"messages": [{"role": "user", "content": "What is the weather in Paris?"}],
"tools": [{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get current weather for a city",
"parameters": {
"type": "object",
"properties": {
"location": {"type": "string", "description": "City name"}
},
"required": ["location"]
}
}
}],
"tool_choice": "auto"
}'Vision (multimodal)
Send images alongside text for document analysis, UI review, and visual question answering. Uses the standard OpenAI vision format with base64 or URL image inputs.
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mistral/mistral-small-4",
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "What does this chart show?"},
{"type": "image_url", "image_url": {"url": "https://therouter.ai/assets/vision-sample.png"}}
]
}]
}'Reasoning (reasoning_effort)
Mistral Small 4's standout feature β the reasoning_effort parameter controls reasoning depth per request. Set 'none' for fast chat, 'high' for deep step-by-step reasoning equivalent to Magistral-level capability.
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mistral/mistral-small-4",
"messages": [{"role": "user", "content": "How many r's are in the word 'strawberry'? Think step by step."}],
"reasoning_effort": "high"
}'JSON mode
Use response_format to guarantee structured JSON output. Mistral Small 4 supports the standard OpenAI JSON-mode API.
curl https://api.therouter.ai/v1/chat/completions \
-H "Authorization: Bearer $THEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "mistral/mistral-small-4",
"messages": [{"role": "user", "content": "Extract name, age, and city from: John is 30 years old from London"}],
"response_format": {"type": "json_object"}
}'Fact ledger β every claim on this page traces here
| source | URL | retrieved | |
|---|---|---|---|
| Release date | mistral.ai β | 2026-05-27 | verified |
| Architecture | docs.mistral.ai β | 2026-05-27 | verified |
| Upstream context length | huggingface.co β | 2026-05-27 | verified |
| Training cutoff | β | β | unknown |
| License | huggingface.co β | 2026-05-27 | verified |
| Supported inference backends | huggingface.co β | 2026-05-27 | verified |
| Minimum self-host hardware | mistral.ai β | 2026-05-27 | to verify |
| AA LCR | mistral.ai β | 2026-05-27 | to verify |
| LiveCodeBench | mistral.ai β | 2026-05-27 | to verify |
| AIME 2025 | mistral.ai β | 2026-05-27 | to verify |
| Introducing Mistral Small 4 | mistral.ai/news β | 2026-05-27 | verified |
| What makes Mistral Small 4 different from Mistral Small 3? | mistral.ai β | 2026-05-27 | to verify |
| Can I use Mistral Small 4 via the standard OpenAI Python/TypeScript SDK? | docs.therouter.ai β | 2026-05-27 | to verify |
| Is Mistral Small 4 open-source? Can I run it on my own hardware? | huggingface.co β | 2026-05-27 | to verify |
| How does the reasoning_effort parameter work? | docs.mistral.ai β | 2026-05-27 | to verify |
| What are the benchmark scores for Mistral Small 4? | mistral.ai β | 2026-05-27 | to verify |