Apply your own routing policies, reduce token costs automatically, and see every routing decision in real time with Merge Gateway.

What Mistral Small costs to run
Test Mistral Small
with Gateway’s Simulator
See a prompt's output, token spend, latency, and more with Mistral Small.
Route requests to Mistral Small in minutes
1$ pip install merge-gateway-sdk1from merge_gateway import MergeGateway
2
3client = MergeGateway(api_key="YOUR_API_KEY")
4
5response = client.responses.create(
6 model="openai/gpt-5.2",
7 input=[
8 {"type": "message", "role": "system", "content": "You are a helpful programming tutor. Explain the concepts clearly with practical examples."},
9 {"type": "message", "role": "user", "content": "Explain the concept of recursion in programming with a simple set of examples."},
10 ],
11)
12
13print(response.output[0].content[0].text)1response = client.responses.create(
2 model="anthropic/claude-sonnet-4-20250514",
3 input=[
4 {"type": "message", "role": "system", "content": "You are a helpful programming tutor. Explain the concepts clearly with practical examples."},
5 {"type": "message", "role": "user", "content": "Explain the concept of recursion in programming with a simple set of examples."},
6 ],
7)1from openai import OpenAI
2
3client = OpenAI(
4 api_key="YOUR_API_KEY",
5 base_url="https://api-gateway.merge.dev/v1/openai",
6)1response = client.chat.completions.create(
2 model="gpt-5.2",
3 messages=[
4 {"role": "system", "content": "You are a helpful programming tutor. Explain the concepts clearly with practical examples."},
5 {"role": "user", "content": "Explain the concept of recursion in programming with a simple set of examples."},
6 ],
7)
8
9print(response.choices[0].message.content)1npm install merge-gateway-ai-sdk-provider ai1import { createMergeGateway } from "merge-gateway-ai-sdk-provider";
2
3const gateway = createMergeGateway({
4 apiKey: "YOUR_API_KEY",
5});1import { generateText } from "ai";
2
3const { text } = await generateText({
4 model: gateway("openai/gpt-4o"),
5 prompt: "Explain the concept of recursion in programming with a simple set of examples.",
6});
7
8console.log(text);1import { createOpenAI } from "@ai-sdk/openai";
2
3const gateway = createOpenAI({
4 apiKey: "YOUR_API_KEY",
5 baseURL: "https://api-gateway.merge.dev/v1/ai-sdk",
6});
7
8// All generateText/streamText calls work unchanged1from anthropic import Anthropic
2
3client = Anthropic(
4 api_key="YOUR_API_KEY",
5 base_url="https://api-gateway.merge.dev/v1/anthropic",
6)
7
8message = client.messages.create(
9 model="claude-sonnet-4-20250514",
10 max_tokens=1024,
11 messages=[
12 {"role": "user", "content": "Explain the concept of recursion in programming with a simple set of examples."},
13 ],
14)
15
16print(message.content[0].text)Explore other models available in Merge Gateway
Mistral Small FAQ
Heading
What other models does Mistral AI offer?
Mistral AI covers a wide range of use cases across its model catalog, from edge-optimized inference to frontier reasoning. Here are some other models Mistral AI supports:
- Ministral 8B: A lightweight 8B model suited for edge and on-device workloads, priced at $0.10 per million tokens. It is part of the Ministral series designed for fast, low-cost inference with vision capability
- Mistral Medium: A mid-tier proprietary model available via
mistral-medium-latestat $1.50 input / $7.50 output per million tokens. It is positioned for teams that need a general-purpose model between the small and large tiers
- Mistral Large 3: The current general-purpose flagship, featuring a 256k token context window, multimodal image input, 675B total parameters, and Apache 2.0 licensing. It is priced at $0.50 input / $1.50 output per million tokens
- Magistral Medium: Mistral AI's reasoning model for multi-step, domain-specific, and multilingual analytical tasks. It uses chain-of-thought and is available at $2.00 input / $5.00 output per million tokens via
magistral-medium-latest
- Codestral: A specialist code completion model available at $0.30 input / $0.90 output per million tokens via
codestral-latest. It targets code generation and fill-in-the-middle workflows rather than general chat
- Devstral 2: A frontier code agent model for autonomous software engineering, priced at $0.40 input / $2.00 output per million tokens. It is purpose-built for solving multi-step engineering tasks in agentic frameworks
How does Mistral Small differ from Mistral AI's other models?
Mistral Small (currently Mistral Small 4) is Mistral AI's most cost-efficient option that combines instruct, reasoning, and coding capability in a single model.
- Pricing: At $0.10 input / $0.30 output per million tokens, Mistral Small is the lowest-cost proprietary model in the Mistral lineup. Mistral Medium costs $1.50 input / $7.50 output and Magistral Medium costs $2.00 input / $5.00 output per million tokens
- Speed: Mistral Small 4 reaches approximately 179 tokens per second, making it among the fastest models in the Mistral catalog. Its speed advantage is especially noticeable compared to Mistral Medium at around 80 tokens per second
- Context window: Mistral Small 4 supports a 256k token context window, matching the context capacity of Mistral Large 3 and far exceeding the approximately 33,000 token window of Mistral Medium
- Reasoning capability: Mistral Small 4 is a hybrid reasoning model that can apply extended chain-of-thought when needed. This distinguishes it from Mistral Medium and earlier Small versions, which do not include native reasoning modes
- Modality: Mistral Small 4 accepts both text and image input, matching Mistral Large 3's multimodal capability at a fraction of the cost
Mistral Small is the right default for most production workloads: fast, inexpensive, and capable across instruct, reasoning, and coding tasks without requiring a step up to the larger model tiers.
What models should I consider using alongside Mistral Small?
No single model is optimal for every task. Here are models worth pairing with Mistral Small depending on what your product needs:
- Magistral Medium (Mistral AI): For hard analytical tasks that require transparent, step-by-step reasoning, such as legal analysis, financial modeling, or complex domain-specific Q&A, Magistral Medium's dedicated reasoning architecture produces better results than Mistral Small on the most demanding problems
- Codestral (Mistral AI): For code completion and fill-in-the-middle tasks specifically, Codestral is fine-tuned for coding workflows in a way that a general-purpose model like Mistral Small is not. Route code completion requests there for sharper code quality
- Claude Haiku 3.5 (Anthropic): For high-volume, latency-sensitive tasks like classification, entity extraction, or short-form generation where you want a strong cross-provider fallback, Claude Haiku 3.5 is competitive with Mistral Small on speed and cost
- Gemini 2.0 Flash (Google): When your workload involves very long documents or extended context retrieval, Gemini 2.0 Flash offers a 1 million token context window at sub-cent pricing, covering the longest-context cases that even Mistral Small's 256k window cannot handle
- Llama 3.3 70B (Meta): For teams that want to self-host inference and eliminate per-token API charges entirely, Llama 3.3 70B is an open-weights alternative with strong performance on general text tasks that can serve as a cost-free fallback when API quotas are exhausted
What are the challenges of using Mistral Small in my product?
Like any production LLM, Mistral Small comes with tradeoffs worth planning for:
- Provider dependency: Relying solely on Mistral AI's API creates fragility when the provider experiences an outage or deprecates a model version. Mistral Small 4 was released in March 2026, and earlier versions of Mistral Small have already been deprecated, so build with version aliases (
mistral-small-latest) and plan for version transitions
- Cost at scale: At $0.30 per million output tokens, Mistral Small is inexpensive by flagship standards, but costs compound quickly at high volume. An application generating 10 million output tokens per day still accumulates $3,000 per month, making cost tracking and budget controls important from early on
- Reasoning verbosity: As a hybrid reasoning model, Mistral Small 4 can generate substantial thinking tokens before producing its final output. For latency-sensitive applications, the extended thinking mode may increase response times and inflate token counts in ways that are not immediately obvious during development
- License terms: While Mistral Small 4 uses an Apache 2.0 license for the model weights, API access is still governed by Mistral AI's terms of service. Teams building commercial products should verify usage limits and data handling terms before deploying at scale
- Benchmark variance by task type: Mistral Small 4 scores 28 on the Artificial Analysis Intelligence Index, which reflects a broad average across benchmark types. Performance on specialized tasks like domain-specific reasoning or multilingual generation may vary significantly from that aggregate score
Why should I use Merge Gateway to route LLM requests with Mistral Small and every other model?
Using Mistral Small through Merge Gateway gives you access to the model itself and the infrastructure layer around it:
- Intelligent routing and automatic failover: Merge routes around Mistral AI outages automatically. Routing policies based on cost, latency, or quality can reduce spend by 40-60% without touching your application code
- One API, every provider: Access Mistral Small and every other major LLM through a single endpoint and API key. Change providers by swapping the model string. No application code changes required
- Cost governance: Set hard or soft project budgets so Mistral Small spend stays within plan. Every request is attributed to a model, project, and tag in a unified billing dashboard across all providers
- Build Your Own Router: Define what "best" means for your traffic by selecting from curated ML benchmarks or adding your own eval scores. The router scores each available model against your weights and picks the winner per request, with a plain-language explanation of every decision
- Security and compliance controls: Apply DLP rules and prompt injection protection before every request reaches Mistral AI. Enforce per-project model and region policies without adding that logic to your application
How can I start routing requests to Mistral Small via Merge Gateway?
Getting Mistral Small running through Merge Gateway takes a few minutes:
1. Create an account and get your API key from the dashboard.
2. Install the Merge Gateway SDK: run pip install merge-gateway-sdk (Python) or npm install merge-gateway-sdk (Node). Alternatively, if you're already using the OpenAI SDK, set base_url = "https://api-gateway.merge.dev/v1/openai" and your existing code works as-is.
3. Make your first request using the provider/model format. For Mistral Small, the model string is mistral/mistral-small-latest. Swap the model string to route to any other provider without changing anything else.
4. Configure a routing policy in the dashboard to set failover behavior, cost limits, and optimization strategy. Your first policy can be as simple as naming Mistral Small as primary with a cross-provider fallback like Claude Haiku 3.5 or Gemini 2.0 Flash.
Full setup instructions and SDK references are in the Merge Gateway docs.
Try Mistral Small through Merge Gateway
Route, observe, and control AI requests across providers from one API.





