Codestral 2508 API

Codestral 2508 on AIMLAPI.

Modalities
Image, TextText
In / Out price
$0.3174/$0.9522per 1M
Context window
250K tokens
Released
Aug 1, 2025

Codestral 2508 overview

The pelican test: one prompt, every text model, unedited SVG output from Nov 3, 2026.

SVG of a pelican riding a bicycle, written by Codestral 2508 through AI/ML API

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

Codestral 2508 pricing in US dollars
UsagePriceUnit
Input$0.31741M tokens
Output$0.95221M tokens
Cached input$0.03171M 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.

AI/ML API model prices in USD per million tokens
ModelInputOutput
Codestral 2508$0.3174$0.9522
Small 4$0.1984$0.7935
Venice Uncensored$0.2116$0.9522
Mistral Large 4$1.36$4.18
Medium 3.5$1.59$7.93

How to use the Codestral 2508 API

View docs

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export 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."
    }
  ]
}'

Related articles

All posts

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.

Start building with Codestral 2508

Codestral 2508 API

mistralai/codestral-2508

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export 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."
    }
  ]
}'