Devstral 2 API: Endpoint & Pricing
Deprecated 22 May 2026Devstral 2 2512 is a 123B-parameter open-source large language model from Mistral AI, optimized for agentic coding and long-context software engineering workflows.
What is Devstral 2 2512?
Devstral 2 2512 is a 123B-parameter dense transformer model by Mistral AI specializing in agentic coding with a roughly 256K–262K token context window. It is primarily used for software engineering agents that can explore large codebases, orchestrate changes across multiple files, and handle tasks like bug fixing or modernizing legacy systems while maintaining architecture-level context. It is also applied to general coding assistance, complex reasoning over long technical documents, and workflows that integrate external tools and APIs. Devstral 2 belongs to Mistral’s Devstral family of open-weight code-focused models, following earlier Devstral and Devstral Small/Medium releases.
Can you self-host Devstral 2 2512?
No. We found no public weights for Devstral 2 2512 on Hugging Face, so there is nothing to download, quantize or serve on your own GPUs: no VRAM budget, no vLLM or GGUF build to plan for. The only way to run it is over an API.
Skip the deploy — use LLM.API as your endpoint
No GPUs, no quantization trade-offs. Same model, OpenAI-compatible, up to 30% below list price.
Providers
Different companies host the same model. OpenRouter routes your request to one of them based on the routing mode you pick — Balanced (price + speed), Nitro (fastest), or Exacto (highest tool-calling accuracy).
List price by provider
InputOutputProvider list prices; the LLM.API discount applies on top.
| Provider | Input | Output | Cache read /M | Latency | Throughput | Uptime |
|---|---|---|---|---|---|---|
| mistral | in $0.4; out $2 per 1M tokens | 262K tokens | tools, streaming, JSON, structured |
Prices and availability from the LLMAPI catalogue, updated nightly. Last updated 8 Oct 2026.
Try this model
Test Devstral 2 2512 right here — free to start.
Suggestions for your first prompt
Code snippet
Call the model through the OpenAI-compatible API.
Switching from OpenAI? Change 2 lines.
- base_url="https://api.openai.com/v1"
- api_key="YOUR_OPENAI_KEY"
+ base_url="https://api.llmapi.ai/v1"
+ api_key="YOUR_LLMAPI_KEY"Everything else stays the same — SDK, message format, tools, streaming. Set model to devstral-2512 and the call runs unchanged.
curl https://api.llmapi.ai/v1/chat/completions \
-H "Authorization: Bearer $LLMAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "devstral-2512",
"messages": [
{"role": "user", "content": "Give me three crisp launch checklist items."}
]
}'from openai import OpenAI
client = OpenAI(
api_key="YOUR_LLMAPI_KEY",
base_url="https://api.llmapi.ai/v1",
)
resp = client.chat.completions.create(
model="devstral-2512",
messages=[
{"role": "system", "content": "You are a precise product assistant."},
{"role": "user", "content": "Give me three crisp launch checklist items."},
],
)
print(resp.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.LLMAPI_KEY,
baseURL: "https://api.llmapi.ai/v1",
});
const resp = await client.chat.completions.create({
model: "devstral-2512",
messages: [
{ role: "user", content: "Give me three crisp launch checklist items." },
],
});
console.log(resp.choices[0].message.content);stream = client.chat.completions.create(
model="devstral-2512",
messages=[{"role": "user", "content": "Write a haiku about latency."}],
stream=True,
)
for chunk in stream:
delta = chunk.choices[0].delta.content
if delta:
print(delta, end="", flush=True){
"model": "devstral-2512",
"messages": [
{"role": "system", "content": "You are a precise product assistant."},
{"role": "user", "content": "Give me three crisp launch checklist items."}
]
}ENDPOINTS
Supported endpoints & features
Base URL https://api.llmapi.ai/v1 · model ID devstral-2512 · OpenAI-compatible.
POST /v1/chat/completionsChat Completions — supported
| Feature | Status | How to set it |
|---|---|---|
| Function calling (tools) | Supported | tools, tool_choice |
| Parallel tool calls | Not supported | parallel_tool_calls |
| JSON mode | Supported | response_format: {"type": "json_object"} |
| Structured outputs | Supported | response_format: {"type": "json_schema", …} |
| Streaming | Supported | stream: true |
| Vision (image input) | Not supported | image_url content parts |
| Web search | Not supported | web_search |
ERRORS
Errors & fallback routing
| Code | What it means | What to do |
|---|---|---|
401 | Missing or invalid API key. | Send Authorization: Bearer YOUR_LLMAPI_KEY and check the key is active. |
429 | Rate limited, or the upstream provider is throttling the request. | Back off and retry with jitter; the gateway also retries the request on another provider where one is available. |
5xx | Upstream provider error or timeout. | Retry; fallback routing sends the retry to the next healthy provider for this model. |
When a provider fails or throttles, the request is routed to the next provider serving this model — the ones listed in the providers table above.
Devstral 2 in production
What the model is good at.
-
General Assistance
Engages in multi-turn conversations, answering questions, explaining concepts, and following instructions across many everyday and technical topics.
-
Code Reasoning
Understands and generates source code, explains programming concepts, and helps debug or refactor snippets in common programming languages.
-
Text Translation
Translates between multiple natural languages while preserving meaning, tone, and important domain-specific terminology when possible.
-
Image Analysis
Interprets images to identify objects, scenes, and visual relationships, and provides concise natural-language descriptions of visual content.
-
Text Extraction
Reads text from images or documents, extracting machine-usable content from screenshots, scans, or photos of printed materials.
What you get when you call Devstral 2 through LLM.API.
-
Unified AI Routing
Dynamically route each request across multiple providers and models based on cost, latency, and quality—without changing your integration code.
One endpoint, every model -
Cost-Aware Optimization
Control spend with per-route cost policies, automatic model downshifts, and clear usage insights so you never overpay for simple workloads.
Cut costs, not coverage -
Resilient Fallback Logic
Define automatic failover chains so if a provider is down, rate-limited, or slow, your requests seamlessly retry against alternative models.
Stay online, automatically -
End-to-End Observability
Trace every request across models and providers with logs, metrics, and latency breakdowns to debug issues and tune performance in production.
See every token hop -
Task-Native Abstractions
Use high-level task APIs—chat, tools, RAG, workflows—instead of provider-specific primitives, so you can swap or compose models without refactoring.
Code to tasks, not vendors -
High-Throughput Batch
Process massive job queues with async, fault-tolerant batch execution, smart chunking, and automatic retries to fully utilize model capacity.
Scale from 10 to millions
When to Use — When NOT to Use
Use it if...
- You need a strong general-purpose LLM from Mistral for versatile application prototyping.
- You need good balance between reasoning, coding, and language tasks in one model.
- Your use case involves integrating with the Mistral ecosystem and existing Devstral tooling.
- You need an LLM suitable for typical chatbot, assistant, and productivity-style applications.
- Your use case involves experimenting with newer Mistral releases to evaluate capability improvements.
Avoid if...
- You need guaranteed best-in-class reasoning beyond what standard frontier Mistral models offer.
- Your workload requires strict, audited compliance certifications that Devstral 2 2512 may not hold.
- You need a tiny, on-device model optimized for mobile or embedded deployments.
- Your workload requires a fully open-weights model for self-hosting and offline control.
- You need long-term model stability with frozen behavior rather than frequently updated variants.
COMMUNITY
What developers say about Devstral 2 2512
Summarised from public developer discussions and write-ups. Opinions are the sources’, not LLM.API’s.
- Developers report that the model is highly effective for tasks requiring strict adherence to schemas and JSON formatting, citing its perfect internal scores for structured output and constrained rewriting.
- Technical users observe that while initial output generation can feel slower, the model often reduces total rework cycles by producing more consistent, deliberate plans for complex architecture and debugging tasks.
- Engineers note a practical limitation where the 262K context window effectively handles approximately 80K tokens of actual code before reaching functional performance limits for multi-file repository analysis.
SOURCES
Frequently Asked Questions
-
What is Devstral 2 2512?
Devstral 2 2512 is a Mistral language model accessible via LLM.API, designed for general-purpose text generation and reasoning workloads.
-
What is Devstral 2 2512 best suited for?
Devstral 2 2512 is best for building chatbots, code assistants, and knowledge retrieval tools that require strong reasoning and instruction-following.
-
How is Devstral 2 2512 priced on LLM.API?
Devstral 2 2512 uses LLM.API’s unified token-based pricing; check your LLM.API dashboard or pricing docs for current per-token input and output rates.
-
What context window does Devstral 2 2512 support?
Devstral 2 2512 supports a context window defined by LLM.API’s Mistral configuration; refer to the model card in LLM.API for the exact token limit.
-
How fast is Devstral 2 2512 on LLM.API?
Typical latency is low and suitable for interactive applications, but exact speeds depend on your region, load, and chosen LLM.API deployment options.
-
Which modalities does Devstral 2 2512 support?
Devstral 2 2512 is exposed on LLM.API as a text-only model, accepting and returning UTF-8 text content.
-
How do I call Devstral 2 2512 through LLM.API?
Use the standard LLM.API chat or completion endpoint, specifying the model identifier for Devstral 2 2512 and including your messages array.
-
How does Devstral 2 2512 compare to other Mistral models on LLM.API?
Devstral 2 2512 targets strong general-purpose performance, while lighter Mistral variants may be cheaper or faster but somewhat less capable.
-
What are the main limitations of Devstral 2 2512?
Devstral 2 2512 can hallucinate, lacks real-time knowledge, and should not be used as the sole basis for safety-critical or legal decisions.
-
Does Devstral 2 2512 support streaming responses on LLM.API?
Yes, you can enable streaming via the LLM.API request parameters to progressively receive Devstral 2 2512’s output tokens.
COMPARE
Competitive Models
GLM-4.6
$0.43 in / $1.74 out per 1M tokens, 204,800 context — the closest current alternative to Devstral 2.
Mistral Large 3
$0.5 in / $1.5 out per 1M tokens, 262,144 context — the closest current alternative to Devstral 2.
Qwen 3.5 397B A17B
$0.6 in / $3.6 out per 1M tokens, 262,144 context — the closest current alternative to Devstral 2.
Claude Sonnet 4.6 is Anthropic’s most capable Sonnet‑tier large language model, offering Opus‑class performance in coding, computer use, and long‑context reasoning with a 1 million token context window in beta.
MiniMax M2.5
Up to 30%MiniMax M2.5 is a frontier-class, agent-native large language model from MiniMax that combines a Mixture-of-Experts architecture with long-context, cost-efficient inference for real-world productivity tasks.
Nano Banana 2 (Gemini 3.1 Flash Image Preview)
Nano Banana 2 (Gemini 3.1 Flash Image Preview) is Google DeepMind’s image generation and editing model built on the Gemini 3.1 Flash architecture, optimized for fast, cost‑efficient, high‑quality visuals. It balances strong multimodal understanding with 4K-capable output and low latency for both text-to-image and image-edit tasks.
Get one key to every model
Swap your API key. Keep your code.