Codestral — Free AI Model & API

mistral-ai/codestral
chat coding
Context Window 256K
Max Output 256K
Rate Limit ~1 RPS, 500K TPM
Cost $0.00 FREE
Free Period Since May 10, 2026
Credit Card Not required
Status Online

Overview

"Codestral, developed by Mistral AI, is a versatile LLM for text and coding tasks. Ideal for chat and coding scenarios, it excels with 256,000 tokens of context. Note its rate limit of 1 request per second and API compatibility with OpenAI." (99 words)

Model ID
codestral
Base URL
https://api.mistral.ai/v1
Specifications
Context: 256K · Output: 256K · Modality: text, code · OpenAI Compat: Yes

Quick Start

Integrate Codestral with 3 lines of code. See the config generator for Claude Code, Cursor, and more.

from openai import OpenAI

client = OpenAI(
 base_url="https://api.mistral.ai/v1",
 api_key="YOUR_API_KEY"
)

response = client.chat.completions.create(
 model="codestral",
 messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)
import OpenAI from "openai";

const openai = new OpenAI({
 baseURL: "https://api.mistral.ai/v1",
 apiKey: "YOUR_API_KEY",
});

const completion = await openai.chat.completions.create({
 model: "codestral",
 messages: [{ role: "user", content: "Hello!" }],
});

console.log(completion.choices[0].message.content);
curl https://api.mistral.ai/v1/chat/completions \
 -H "Content-Type: application/json" \
 -H "Authorization: Bearer YOUR_API_KEY" \
 -d '{
 "model": "codestral",
 "messages": [{"role": "user", "content": "Hello!"}]
 }'

Other Free Models from Mistral AI

Rate Limits & Constraints

Rate Limit ~1 RPS, 500K TPM
Context Window 256K
Max Output Tokens 256K
Cost Free — since May 10, 2026
Credit Card Not required
OpenAI Compatible Yes — drop-in replacement

Mistral AI Platform Limitations

  • ~1 RPS is slow for concurrent or batch workloads
  • Phone verification required for signup
  • Free tier data may be used for model improvement unless opted out

Features & Use Cases

Best For

ChatCoding

Modality Support

textcode

Mistral AI Highlights

  • Access to Mistral Small, Medium, Large
  • ~1B tokens/month free
  • Codestral (code model) included
  • No credit card required (phone verification)

Playground — Test Codestral

Test Codestral directly in your browser. Your API key is sent directly to Mistral AI — never stored.

Model: Codestral Get Key

🔒 Your key is never stored — sent directly to the model provider via our server proxy.

Ready to chat with Codestral.

Frequently Asked Questions

How do I get an API key for Codestral?

Sign up at Mistral AI to get your API key. No credit card is required — just an email sign-up. Once you have the key, use the code snippets in the Quick Start section above.

Is Codestral really free?

Yes. Codestral is available on Mistral AI's free tier and has been free since May 10, 2026. Rate limits apply: ~1 RPS, 500K TPM. Always check the provider's terms for any changes to the free tier.

What are Codestral's rate limits?

~1 RPS, 500K TPM Context window: 256K. Max output: 256K. No credit card required.

What are the best free alternatives to Codestral?

Popular free alternatives include inclusionAI: Ring-2.6-1T, Baidu Qianfan: CoBuddy (free), Owl Alpha. You can also browse all 147+ free models on our site.

More questions? See our full FAQ →

Similar Free Models