Medium 3.1 overview
Medium 3.1 specs
- Model ID
mistralai/mistral-medium-3.1- Developer
- Mistral AI
- Context window
- 131,072 tokens
- Input
- Image, Text
- Output
- Text
- API
- OpenAI-compatible, base URL
https://api.aimlapi.com/v1
Coding and code review
Generate, debug, and review code across languages, reading whole files or repos in a single prompt.
Agentic and multi-step workflows
Reliable tool-calling and instruction-following suit agent loops that plan, call tools, and iterate.
Complex reasoning
Extended reasoning improves reliability on multi-step math, logic, and technical analysis.
Long-document analysis
Summarize and extract from contracts, papers, and reports without aggressive chunking.
Use cases
Mistral Medium 3.1 is documented as suited to software development, including writing, reviewing, debugging, and explaining code. It is also documented for document analysis, such as analyzing reports, specifications, forms, research papers, and other long-form documents.
It is documented for business and knowledge work, including drafting content, analyzing information, summarizing materials, and supporting everyday professional workflows. It is also documented for multimodal analysis, such as interpreting screenshots, charts, diagrams, and other visual information alongside text.
Capabilities
- Function calling
- Reasoning
- Streaming
- Structured outputs
- Web search
Medium 3.1 benchmarks by
Artificial Analysis
See how Medium 3.1 scores on independent evaluations. Data retrieved Nov 3, 2026.
Benchmark results
Compare 12 models available on AI/ML API across 5 independent benchmarks.
Humanity's Last Exam
Expert-written questions across academic subjects.
GPQA Diamond
Graduate-level science questions written to resist web search.
Terminal-Bench 4.0
Agentic tasks completed in a command-line environment.
AA-LCR
Reasoning across long documents of about 100k tokens.
SciCode
Python coding tasks drawn from scientific research.
Medium 3.1 API pricing
| Usage | Price | Unit |
|---|---|---|
| Input | $0.4232 | 1M tokens |
| Output | $2.12 | 1M tokens |
| Cached input | $0.0423 | 1M tokens |
Prices from the AI/ML API price list, checked on Nov 4, 2026.
Medium 3.1 vs other models: token prices
AI/ML API input and output rates for 5 models, per million tokens.
| Model | Input | Output |
|---|---|---|
| $0.4232 | $2.12 | |
| $0.1984 | $0.7935 | |
| $0.2645 | $2.12 | |
| $1.36 | $4.18 | |
| $1.59 | $7.93 |
How to use the Medium 3.1 API
View docsBuild with your agent
Give your agent the model details, code and documentation.
1Get your API key
Create API keyexport AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"2Make your first request
curl 'https://api.aimlapi.com/v1/chat/completions' \
-H "Authorization: Bearer $AIMLAPI_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "mistralai/mistral-medium-3.1",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}'import os
import requests
headers = {
"Authorization": f"Bearer {os.environ['AIMLAPI_KEY']}",
"Content-Type": "application/json",
}
payload = {
"model": "mistralai/mistral-medium-3.1",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}
response = requests.post("https://api.aimlapi.com/v1/chat/completions", headers=headers, json=payload, timeout=120)
response.raise_for_status()
print(response.json())const response = await fetch("https://api.aimlapi.com/v1/chat/completions", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AIMLAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "mistralai/mistral-medium-3.1",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());Related articles
Medium 3.1 FAQ
What is the context window of Medium 3.1?
Medium 3.1 has a 131,072 tokens context window.
What inputs and outputs does Medium 3.1 support?
Medium 3.1 takes image, text as input and returns text.
What is the model ID for Medium 3.1?
Use mistralai/mistral-medium-3.1 as the model id. Requests go to https://api.aimlapi.com/v1/chat/completions.
How much does Medium 3.1 cost?
Medium 3.1 costs $0.4232 input and $2.12 output per 1M tokens on AI/ML API, billed as you go with no subscription.
Does Medium 3.1 support streaming?
Yes, Medium 3.1 can stream responses as they are generated.
Can Medium 3.1 read images?
Yes, Medium 3.1 accepts image input alongside text.
Who created Medium 3.1?
Medium 3.1 was built by Mistral AI.
Is Medium 3.1 a reasoning model?
Yes, it includes reasoning as one of its listed capabilities.
Can Medium 3.1 call external tools or functions?
Yes, it supports function calling and parallel tool calls.

