---
title: Mistral: Codestral 2508 API | Text Generation | ModelsLab
description: Cutting-edge LLM for code completion with 256K context window, function calling, structured outputs; $0.30/M input, $0.90/M output tokens—ideal for FIM.
url: https://modelslab.com/models/mistralai/mistralai-codestral-2508/api.md
canonical: https://modelslab.com/models/mistralai/mistralai-codestral-2508/api.md
type: product
component: Playground/LLM/Index
generated_at: 2026-04-15T02:05:30.838498Z
---

Mistral: Codestral 2508
---

 [LLMs.txt](https://modelslab.com/models/open_router/mistralai-codestral-2508/llms.txt) [.md](https://modelslab.com/models/mistralai/mistralai-codestral-2508.md)

mistralai-codestral-2508 mistralai Closed Source Model $0.600000 / call

Mistral: Codestral 2508
---

Choose a prompt below to get started or type your own message

 Explain quantum computing in simple terms

 Write a Python function to sort a list

 Create a marketing email for a SaaS product

 Compare REST vs GraphQL APIs

Send

### Mistral: Codestral 2508

mistralai mistralai-codestral-2508

Copy model ID

PricingInput $0.30 / 1M tokens

Output $0.90 / 1M tokens

API EndpointsOpenAI Compatible

`https://modelslab.com/api/v7/llm/chat/completions`Endpoint

Anthropic Compatible

`https://modelslab.com/api/v7/llm/v1/messages`Messages

`https://modelslab.com/api/v7/llm/v1/messages/count_tokens`Count Tokens

`https://modelslab.com/api/v7/llm/v1/models`Models

Use with Claude Code

cURL Example

ParametersSystem MessageYou are a helpful AI assistant specialized in providing accurate and detailed responses.

Temperature0.7

Max Tokens1000

Top P0.9

Frequency Penalty0

Presence Penalty0

Model Info

Support

Related Models
---

Discover similar models you might be interested in

 [View all LLM Models](https://modelslab.com/models?feature=llmaster)

[N3](https://modelslab.com/models/together_ai/nim-meta-llama-3.2-11b-vision-instruct)[Together AI](https://modelslab.com/models/together_ai)

 [nim/meta/llama-3.2-11b-vision-instruct

Closed Source Model](https://modelslab.com/models/together_ai/nim-meta-llama-3.2-11b-vision-instruct)

[OG](https://modelslab.com/models/open_router/openai-gpt-5.1)[Open Router](https://modelslab.com/models/open_router)

 [OpenAI: GPT-5.1

Closed Source Model](https://modelslab.com/models/open_router/openai-gpt-5.1)

[MM](https://modelslab.com/models/open_router/mistralai-mistral-large-2512)[Open Router](https://modelslab.com/models/open_router)

 [Mistral: Mistral Large 3 2512

Closed Source Model](https://modelslab.com/models/open_router/mistralai-mistral-large-2512)

[LL](https://modelslab.com/models/open_router/liquid-lfm-2.5-1.2b-instruct-free)[Open Router](https://modelslab.com/models/open_router)

 [LiquidAI: LFM2.5-1.2B-Instruct (free)

Closed Source Model](https://modelslab.com/models/open_router/liquid-lfm-2.5-1.2b-instruct-free)

[QQ](https://modelslab.com/models/open_router/qwen-qwen2.5-vl-72b-instruct)[Open Router](https://modelslab.com/models/open_router)

 [Qwen: Qwen2.5 VL 72B Instruct

Closed Source Model](https://modelslab.com/models/open_router/qwen-qwen2.5-vl-72b-instruct)

[ML](https://modelslab.com/models/meta/meta-llama-Meta-Llama-3.1-70B-Instruct-Turbo)[ModelsLab](https://modelslab.com/models/meta)

 [Meta Llama 3.1 70B Instruct Turbo

Closed Source Model](https://modelslab.com/models/meta/meta-llama-Meta-Llama-3.1-70B-Instruct-Turbo)

[ML](https://modelslab.com/models/together_ai/meta-llama-Meta-Llama-3.1-8B-Instruct-Turbo)[Together AI](https://modelslab.com/models/together_ai)

 [Meta Llama 3.1 8B Instruct Turbo

Closed Source Model](https://modelslab.com/models/together_ai/meta-llama-Meta-Llama-3.1-8B-Instruct-Turbo)

[ML](https://modelslab.com/models/open_router/meta-llama-llama-4-maverick)[Open Router](https://modelslab.com/models/open_router)

 [Meta: Llama 4 Maverick

Closed Source Model](https://modelslab.com/models/open_router/meta-llama-llama-4-maverick)

[N3](https://modelslab.com/models/together_ai/nim-meta-llama-3.1-70b-instruct)[Together AI](https://modelslab.com/models/together_ai)

 [nim/meta/llama-3.1-70b-instruct

Closed Source Model](https://modelslab.com/models/together_ai/nim-meta-llama-3.1-70b-instruct)

[AA](https://modelslab.com/models/arcee_ai/arcee_ai-arcee-spotlight)[ModelsLab](https://modelslab.com/models/arcee_ai)

 [Arcee AI Spotlight

Closed Source Model](https://modelslab.com/models/arcee_ai/arcee_ai-arcee-spotlight)

[Q7](https://modelslab.com/models/together_ai/Qwen-Qwen2.5-72B-Instruct)[Together AI](https://modelslab.com/models/together_ai)

 [Qwen2.5 72B Instruct

Closed Source Model](https://modelslab.com/models/together_ai/Qwen-Qwen2.5-72B-Instruct)

[QC](https://modelslab.com/models/open_router/qwen-qwen-2.5-coder-32b-instruct)[Open Router](https://modelslab.com/models/open_router)

 [Qwen2.5 Coder 32B Instruct

Closed Source Model](https://modelslab.com/models/open_router/qwen-qwen-2.5-coder-32b-instruct)

[N3](https://modelslab.com/models/together_ai/nim-meta-llama-3.2-90b-vision-instruct)[Together AI](https://modelslab.com/models/together_ai)

 [nim/meta/llama-3.2-90b-vision-instruct

Closed Source Model](https://modelslab.com/models/together_ai/nim-meta-llama-3.2-90b-vision-instruct)

[ZG](https://modelslab.com/models/open_router/z-ai-glm-4.5-air-free)[Open Router](https://modelslab.com/models/open_router)

 [Z.ai: GLM 4.5 Air (free)

Closed Source Model](https://modelslab.com/models/open_router/z-ai-glm-4.5-air-free)

[QQ](https://modelslab.com/models/open_router/qwen-qwen3-next-80b-a3b-instruct)[Open Router](https://modelslab.com/models/open_router)

 [Qwen: Qwen3 Next 80B A3B Instruct

Closed Source Model](https://modelslab.com/models/open_router/qwen-qwen3-next-80b-a3b-instruct)

[TC](https://modelslab.com/models/open_router/thedrummer-cydonia-24b-v4.1)[Open Router](https://modelslab.com/models/open_router)

 [TheDrummer: Cydonia 24B V4.1

Closed Source Model](https://modelslab.com/models/open_router/thedrummer-cydonia-24b-v4.1)

[L4](https://modelslab.com/models/together_ai/meta-llama-Llama-4-Scout-17B-16E)[Together AI](https://modelslab.com/models/together_ai)

 [Llama 4 Scout (17Bx16E)

Closed Source Model](https://modelslab.com/models/together_ai/meta-llama-Llama-4-Scout-17B-16E)

[CC](https://modelslab.com/models/open_router/cohere-command-r7b-12-2024)[Open Router](https://modelslab.com/models/open_router)

 [Cohere: Command R7B (12-2024)

Closed Source Model](https://modelslab.com/models/open_router/cohere-command-r7b-12-2024)

About Mistral: Codestral 2508
---

Mistral's cutting-edge language model for coding released end of July 2025. Codestral specializes in low-latency, high-frequency tasks such as fill-in-the-middle (FIM), code correction and test generation. \[Blog Post\](https://mistral.ai/news/codestral-25-08)

### Technical Specifications

Model IDmistralai-codestral-2508CategoryLLM ModelsTaskText GenerationPrice$0.600000 per million tokensAddedFebruary 20, 2026

### Key Features

- Chat completion and multi-turn conversation API
- Streaming response with token-by-token output
- Function calling and tool use support
- System prompts and role-based messaging
- JSON mode and structured output

### Quick Start

Integrate Mistral: Codestral 2508 into your application with a single API call. Get your API key from the [pricing page](https://modelslab.com/pricing) to get started.

PythonJavaScriptcURLPHP

```
<code>import requests
import json

url = "https://modelslab.com/api/v7/llm/chat/completions"

headers = {
    "Content-Type": "application/json"
}

data = {
        "model_id": "mistralai-codestral-2508",
        "messages": [
            {
                "role": "user",
                "content": "Hello!"
            }
        ],
        "max_tokens": 1000,
        "key": "YOUR_API_KEY"
    }

try:
    response = requests.post(url, headers=headers, json=data)
    response.raise_for_status()  # Raises an HTTPError for bad responses (4XX or 5XX)
    result = response.json()
    print("API Response:")
    print(json.dumps(result, indent=2))
except requests.exceptions.HTTPError as http_err:
    print(f"HTTP error occurred: {http_err} - {response.text}")
except Exception as err:
    print(f"Other error occurred: {err}")</code>
```

View the [full API documentation](https://modelslab.com/models/mistralai/mistralai-codestral-2508/api) for SDKs, code examples in Python, JavaScript, and more.

### Pricing

Mistral: Codestral 2508 API costs $0.600000 per million tokens. Pay only for what you use with no minimum commitments. [View pricing plans](https://modelslab.com/pricing)

### Use Cases

- AI chatbots and virtual assistants
- Code generation and developer tools
- Content writing and copywriting automation
- Data analysis, summarization, and extraction

[Browse LLM Models](https://modelslab.com/models?feature=llmaster) [More from Mistralai](https://modelslab.com/models/open_router) [View Pricing](https://modelslab.com/pricing)

Mistral: Codestral 2508 FAQ
---

### What is Mistral: Codestral 2508?

Mistral's cutting-edge language model for coding released end of July 2025. Codestral specializes in low-latency, high-frequency tasks such as fill-in-the-middle (FIM), code correction and test generation. \[Blog Post\](https://mistral.ai/news/codestral-25-08)

### How do I use the Mistral: Codestral 2508 API?

You can integrate Mistral: Codestral 2508 into your application with a single API call. Sign up on ModelsLab to get your API key, then use the model ID "mistralai-codestral-2508" in your API requests. We provide SDKs for Python, JavaScript, and cURL examples in the API documentation.

### How much does Mistral: Codestral 2508 cost?

Mistral: Codestral 2508 costs $0.600000 per million tokens. ModelsLab uses pay-per-use pricing with no minimum commitments. A free tier is available to get started.

### What is the Mistral: Codestral 2508 model ID?

The model ID for Mistral: Codestral 2508 is "mistralai-codestral-2508". Use this ID in your API requests to specify this model.

### Does Mistral: Codestral 2508 have a free tier?

Yes, ModelsLab offers a free tier that lets you try Mistral: Codestral 2508 and other AI models. Sign up to get free API credits and start building immediately.

---

*This markdown version is optimized for AI agents and LLMs.*

**Links:**
- [Website](https://modelslab.com)
- [API Documentation](https://docs.modelslab.com)
- [Blog](https://modelslab.com/blog)

---
*Generated by ModelsLab - 2026-04-15*