Codestral 2508 overview
Codestral 2508 specs
- Model ID
mistralai/codestral-2508- Developer
- Mistral AI
- Context window
- 256,000 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
Codestral 2508 is documented as suited to fill-in-the-middle completion, code correction, and test generation. It is also described as optimized for code completion and code generation tasks, including low-latency, high-frequency coding work. It is further documented for inline completions and multi-line editing.
Capabilities
- Function calling
- Reasoning
- Streaming
- Structured outputs
- Web search
Codestral 2508 API pricing
| Usage | Price | Unit |
|---|---|---|
| Input | $0.3174 | 1M tokens |
| Output | $0.9522 | 1M tokens |
| Cached input | $0.0317 | 1M tokens |
Prices from the AI/ML API price list, checked on Nov 4, 2026.
Codestral 2508 vs other models: token prices
AI/ML API input and output rates for 5 models, per million tokens.
| Model | Input | Output |
|---|---|---|
| $0.3174 | $0.9522 | |
| $0.1984 | $0.7935 | |
| Venice Uncensored | $0.2116 | $0.9522 |
| $1.36 | $4.18 | |
| $1.59 | $7.93 |
How to use the Codestral 2508 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/codestral-2508",
"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/codestral-2508",
"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/codestral-2508",
"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
Codestral 2508 FAQ
What is the context window of Codestral 2508?
Codestral 2508 has a 256,000 tokens context window.
What inputs and outputs does Codestral 2508 support?
Codestral 2508 takes image, text as input and returns text.
What is the model ID for Codestral 2508?
Use mistralai/codestral-2508 as the model id. Requests go to https://api.aimlapi.com/v1/chat/completions.
How much does Codestral 2508 cost?
Codestral 2508 costs $0.3174 input and $0.9522 output per 1M tokens on AI/ML API, billed as you go with no subscription.
Does Codestral 2508 support streaming?
Yes, Codestral 2508 can stream responses as they are generated.
Can Codestral 2508 read images?
Yes, Codestral 2508 accepts image input alongside text.
Who created Codestral 2508?
Codestral 2508 was built by Mistral AI.
Can Codestral 2508 make function or tool calls?
Yes, it supports function calling and tool use, including parallel tool calls.
Does Codestral 2508 have web search capability?
Yes, web search is listed among its supported features and capabilities.

