Codestral API

Discover Codestral API – a fast, lightweight solution for real-time code generation in 80+ languages.

Mistral AI

Codestral 25.01

Codestral 25.01 is a SOTA coding model by Mistral AI optimized for Fill-in-the-Middle (FIM) tasks, featuring a 256k context window, improved tokenizer, and 2x faster code generation. It supports over 80 programming languages with low latency for high-frequency coding tasks.

Meta llama 3 introduction

Fill-in-the-Middle (FIM) Capabilities

Achieves state-of-the-art performance in FIM tasks with an average of 85.89% across Python, Java, and JavaScript, and an impressive 95.3% pass@1 rate for FIM benchmarks.

Extended Context Length

Processes up to 256,000 tokens at once (8x increase from 32k), enabling analysis and modifications of extensive source code files and entire modules simultaneously.

Multi-Language Support

Expertise in 80+ programming languages, with particularly strong performance in Python (86.6% on HumanEval), JavaScript (82.6%), and TypeScript (82.4%) benchmarks.

Llama 3 intro
New Level

Codestral 25.01 Beats DeepSeek and OpenAI

Codestral 25.01 outperforms DeepSeek and OpenAI in major benchmarks, while delivering 8x larger context and substantial improvements over its predecessor Codestral-2405 22B.

Mixtral icon

Versus Codellama 70B Instruct

Codestral 25.01 is reported to outperform across all metrics, most notably in HumanEval Python (86.6% vs 67.1%) and context length capabilities (256k vs 4k), demonstrating superior code generation and understanding capabilities.

Google Icon

Versus DeepSeek Coder V2

Codestral 25.01 has demonstrated superior performance over DeepSeek Coder V2
in overall language support with a HumanEval average of 71.4% vs 65.9%, though DeepSeek leads in SQL tasks with Spider benchmark.

OpenAI Icon

Versus OpenAI FIM API (GPT 3.5 Turbo)

Codestral 25.01 achieves higher FIM accuracy across languages with an average of 85.89% compared to OpenAI FIM API's 83.7%, and notably surpasses it in FIM pass@1 rates with 95.3% vs 92.7%.

Developing with
Codestral 25.01 API

Gain instant access to Codestral 25.01 through production API: AI/ML API provides direct connectivity to Codestral 25.01.
Access Codestral 25.01 Model Card.
Try Playground.

AIML API Integration
100+ AI Models
AIML API Data Enrichment
Cost-Effective API
Seamless data with AIML API
High Performance
AIML API webhooks icon
Serverless Architecture
import os
from openai import OpenAI

client = OpenAI(
    base_url="<YOUR_API_KEY>",
    api_key="https://api.aimlapi.com/v1",    
)

response = client.chat.completions.create(
    model="deepseek/deepseek-chat",
    messages=[
        {
            "role": "system",
            "content": "You are an AI assistant who knows everything.",
        },
        {
            "role": "user",
            "content": "Tell me, why is the sky blue?"
        },
    ],
)

message = response.choices[0].message.content

print(f"Assistant: {message}")

How to Get an API Key with AI/ML API

Sign Up

Begin by signing up on our AI/ML API platform. Create your account to gain access to a wide range of powerful AI models and tools.

SignUP page  image

Create API Key

In the Playground, navigate to the Key Management section and click on Create API Key. You can easily activate or deactivate your keys as needed.

API key management page Image

Integrate AI

After creating your API key, you can integrate AI models into your application by following the guidelines provided in our API reference.

AI APP integration image
Get Codestral 25.01 API Soon

Ready to get started? Get Your API Key Now!

Get API Key