API · Models
Text
Codestral
Codestral is Mistral's specialized coding model with a 256K context window, optimized for code generation, completion, and software engineering tasks.
Context 256K·Max out 256K
Quickstart
import { streamText } from 'ai';
import { createOpenAICompatible } from '@ai-sdk/openai-compatible';
const blackbox = createOpenAICompatible({
name: 'blackbox',
apiKey: process.env.BLACKBOX_API_KEY!,
baseURL: 'https://api.blackbox.ai/v1',
});
const result = streamText({
model: blackbox('blackboxai/mistral/codestral'),
prompt: 'Why is the sky blue?',
});
for await (const chunk of result.textStream) {
process.stdout.write(chunk);
}Specs & pricing
- Input $/M
- 0.3
- Output $/M
- 0.9
- Context window
- 256K
- Max output
- 256K
- Supported parameters
- tool-usejson-modestreaming
Related models
| Model | Type | Context | Input $/M |
|---|---|---|---|
| Mistral Medium 3.5 | Text | 262.1K | 1.50 |
| Devstral 2 | Text | 256K | 0.4 |
| Mistral Small | Text | 128K | 0.075 |
| Mistral Nemo | Text | 131.1K | 0.02 |
| Ministral 8B | Text | 262.1K | 0.15 |