Skip to main content
Codestral is Mistral’s specialized model for code generation, currently available for free.

Overview

Mistral Codestral is a specialized language model designed specifically for code generation and completion tasks. It’s currently available for free through a monthly subscription model.

Requirements

Phone Number Verification Required: You must verify your phone number to access Codestral.

Rate Limits

Limit TypeFree Tier
Requests per minute30
Requests per day2,000
Codestral is currently free to use on a monthly subscription basis.

Available Models

  • Codestral - Specialized for code generation, completion, and understanding

API Usage

from mistralai import Mistral

client = Mistral(api_key="YOUR_CODESTRAL_API_KEY")

response = client.chat.complete(
    model="codestral-latest",
    messages=[
        {
            "role": "user",
            "content": "Write a Python function to calculate fibonacci numbers"
        }
    ]
)

print(response.choices[0].message.content)

Getting Started

1

Create Account

2

Verify Phone Number

Complete phone number verification
3

Subscribe to Free Plan

Activate the free monthly subscription
4

Generate API Key

Create an API key from your dashboard
5

Start Coding

Use the API for code generation tasks

Use Cases

Code Generation

Generate complete functions and code snippets

Code Completion

Autocomplete code in your development workflow

Code Explanation

Understand and document existing code

Bug Fixing

Identify and fix issues in your code

Key Features

  • Specialized for code generation and understanding
  • Supports multiple programming languages
  • Optimized for software development workflows
  • Currently free with generous rate limits

Additional Resources

Codestral Platform

Access the platform

Mistral Documentation

API documentation

Build docs developers (and LLMs) love