We use cookies. Cookies and browser storage keep you signed in and remember your preferences. With your permission we also measure how the site is used. You can any time. See our cookie policy.

Mistral: Codestral 2508

mistralai/codestral-2508
TextInput: text · fileTools256KAdded Aug 1, 2025

Try Mistral: Codestral 2508 now

Runs on your balance at the prices above. New accounts start with free usage.

One API. Every model.

5 of 5 free messages left today. A free account adds free usage and an API key.Create free accountSign in

Session cost $0.00

Mistral: Codestral 2508 at a glance

  • Input price is 33% lower than the median of 434 Text models.
  • Context window of 256,000 tokens, enough for long documents and multi-turn conversations.
  • Supports tool (function) calling for agents and integrations.
  • Supports structured JSON output with a schema.
  • A typical request (1,000 input / 500 output tokens) costs about $0.00262.

About Mistral: Codestral 2508

Mistral: Codestral 2508 is a text generation model from Mistral, released by the provider on 1 August 2025. It belongs to the Codestral family, which Mistral describes as its language model line for coding, and it was built for low latency, high frequency developer tasks. The model id on api14 is mistralai/codestral-2508.

The model accepts text and file inputs and returns text. Its context window is 256,000 tokens, and the maximum output is 204,800 tokens, so long source files, whole repositories worth of context or extended generated code can fit in a single request. Its knowledge cutoff is 31 March 2025. Mistral highlights three areas in particular: fill in the middle (FIM), code correction and test generation. Those are the tasks the model was tuned around, rather than general conversation.

Because of that focus, the natural fits are developer tooling and automation. Fill in the middle suits editor integrations that complete code between a prefix and a suffix. Code correction suits review bots, linting assistants and pipelines that propose fixes for broken or outdated code. Test generation suits workflows that need unit tests written alongside an implementation. The large context window also helps when a task depends on several files at once, such as refactoring across a module or answering questions about an unfamiliar codebase. File input means you can pass source material directly rather than pasting it into the prompt as plain text.

You call it through api14's OpenAI-compatible API using the model id mistralai/codestral-2508, so existing OpenAI SDKs and clients work with only the base URL and model name changed. The request parameters it supports are frequency_penalty, max_tokens, prediction, presence_penalty, response_format, seed, stop, structured_outputs, temperature, tool_choice, tools and top_p. The tools and tool_choice parameters allow function calling, structured_outputs and response_format let you constrain the shape of the reply, prediction supports speculative-style workflows where you supply an expected continuation, and seed helps make sampling reproducible.

One thing to weigh is scope. Codestral 2508 is a text model, so it does not take image or audio input, and its output is text only. If your task is not code related, or if you need multimodal input, a different model on api14 will likely fit better. For code-centric work where latency and throughput matter, this model is aimed squarely at that case.

How to call the Mistral: Codestral 2508 API

  1. Create an API key in your dashboard.
  2. Install the official openai SDK for your language.
  3. Set baseURL to https://api14.com/api/v1 and model to "mistralai/codestral-2508".
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api14.com/api/v1",
  apiKey: process.env.API14_API_KEY,
});

const result = await client.chat.completions.create({
  "model": "mistralai/codestral-2508",
  "messages": [
    {
      "role": "user",
      "content": "Explain vector databases in two sentences."
    }
  ]
});
console.log(result.choices[0].message.content);

Supported parameters

frequency_penaltymax_tokenspredictionpresence_penaltyresponse_formatseedstopstructured_outputstemperaturetool_choicetoolstop_p

Specifications

Context length
256,000
Max output
204,800
Input
text, file
Output
text
Knowledge cutoff
2025-03-31

Requests on api14 · last 7 days

10-1610-1710-1810-1910-2010-2110-22

Mistral: Codestral 2508: frequently asked questions

How much does the Mistral: Codestral 2508 API cost?
Mistral: Codestral 2508 costs Input $1.05 / 1M tokens. It is charged from your USD balance only for successful requests; failed requests are free.
What is the context window of Mistral: Codestral 2508?
Mistral: Codestral 2508 reads up to 256,000 tokens per request: prompt, history and documents together. It writes up to 204,800 output tokens per response.
What can Mistral: Codestral 2508 do?
Mistral: Codestral 2508 accepts text, file and returns text. It supports tool calling, structured JSON output.
How do I call Mistral: Codestral 2508 from my code?
Point any OpenAI SDK at https://api14.com/api/v1 and set the model to "mistralai/codestral-2508". No other code changes. Copy a ready example from the code panel on this page.
What are alternatives to Mistral: Codestral 2508?
Comparable Text models at a similar price: Z.ai: GLM 4.6V, DeepSeek: DeepSeek V3.1, Mistral: Mistral Medium 3.1 (batch). Each runs through the same API key, so switching is one string.

Mistral: Codestral 2508 community

New topic

This community has no topics yet. Open the first one about Mistral: Codestral 2508.