How to Use Codestral 2508 in ChatGPT
Codestral 2508 is built for code completion, filling gaps in existing code, and focused code generation. Mistral reports 50% fewer runaway generations than prior Codestral releases in its evaluation.
Prompts to try with Codestral 2508 in ChatGPT
Copy an example into ChatGPT, or ask in your own words.
Use Codestral 2508 to write a Python function that removes duplicate strings while preserving their original order. Include imports and assertions for empty input, repeated values, and case-sensitive comparisons.
Use Codestral 2508 to complete the missing section of the code I pasted. Preserve the surrounding code and return only the replacement, with no explanation.
Use Codestral 2508 to correct the pasted function using the failing example in this conversation. Show the smallest change and one regression test.
Use Codestral 2508 to write a PostgreSQL query for the schema I supplied. Return the latest order for each customer, break timestamp ties using the order ID, and explain how customers without orders are handled.
Use Codestral 2508 with low randomness to write tests for the JavaScript function I pasted. Use the test framework I named and cover normal inputs, empty inputs, and invalid values.
How to set up Codestral 2508 in ChatGPT
Pick the way that suits you. Each takes about two minutes.
Use the ChatGPT connector
- Add a custom MCP server
In ChatGPT open Plugins, then Add › Add custom MCP server. Name it Spiral, paste this URL and keep Authentication on OAuth. Tick I understand and want to continue, then click Create.
https://api.spiral.ai/mcp
- Click Connect
ChatGPT asks to connect Spiral. Connect takes you to Spiral in your browser.
- Sign in to Spiral and approve
Sign in, pick the organization ChatGPT should use and click Authorize. Spiral gives the connection its own API key; ChatGPT never sees it, and you can remove the connection under Settings › Connected apps.
Use the Spiral skill
- Send ChatGPT this message
Your agent reads Spiral's skill and sets itself up.
set up https://spiral.ai/SKILL.md
- Sign in or paste a key
Approve Spiral in the browser, or give the agent a key from the console.
Use the Spiral CLI
- Install and sign in
Installs the Spiral CLI, signs you in and adds its skill to your coding agents.
npx -y spiral-cli@latest init
Call the Spiral API
- Create an API key
In the console, under API keys.
- Run Codestral 2508
One request; the result comes back by polling or a webhook.
curl https://api.spiral.ai/v1/runs \ -H "Authorization: Bearer $SPIRAL_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "provider": "openrouter", "model": "mistralai/codestral-2508", "input": { "messages": [ { "role": "system" } ] } }'
Then paste one of the prompts above: ChatGPT finds Codestral 2508 on Spiral, shows the price and runs it.
Codestral 2508 providers and prices
Spiral runs Codestral 2508 through OpenRouter. Open a card for today's price, with every fee included.
Up to $0.004807 per run at the default inputs. $0.39 per 1M input tokens, $1.17 per 1M output tokens.
Settings you can ask for
Ask ChatGPT for any of these in your prompt.
| Setting | Allowed values | Default | Description |
|---|---|---|---|
| Seed | a whole number | ||
| Top p | 0 to 1 | ||
| Max tokens | 1 to 204800 | The most output tokens to generate. | |
| Temperature | 0 to 2 | ||
| Presence penalty | -2 to 2 | ||
| Frequency penalty | -2 to 2 |
Every API field of Mistral: Codestral 2508 is on its tool page: open its card above.
What can you do with Codestral 2508 in ChatGPT?
Codestral can turn a coding question into a proposed function, completion, or test. Paste the relevant snippet and expected results so the request contains enough context to answer.
Complete an unfinished function
Ask Codestral 2508 to fill a missing function body using the surrounding code, signature, and expected results.
Implement a small helper
Give Codestral 2508 a focused specification for a parser, validator, or data transformation. Include examples of accepted and rejected inputs.
Draft a targeted bug fix
Provide Codestral 2508 with the failing function, observed result, and expected result. Request the smallest proposed correction.
Write regression tests
Ask Codestral 2508 for tests covering a reported failure, boundary inputs, and normal behavior in your chosen test framework.
Generate a query from a schema
Supply Codestral 2508 with table definitions, the SQL dialect, and the desired result. Request one query with explicit handling of nulls and duplicates.
Complete repetitive validation code
Show Codestral 2508 an existing validation rule and ask it to complete the remaining rules in the same style, with exact error messages.
Create a runnable example
Ask Codestral 2508 to turn a narrow coding requirement into a complete example with imports, a function, and assertions for the expected results.
More on Codestral 2508 and ChatGPT
Overview
Codestral 2508 in other agents
Questions about Codestral 2508 in ChatGPT
Can ChatGPT use Codestral 2508?
Yes. Add Spiral to ChatGPT as an MCP server, and ChatGPT can find and run Codestral 2508 like any built-in tool.
How much does Codestral 2508 cost in ChatGPT?
Up to $0.004807 per run at the default inputs. $0.39 per 1M input tokens, $1.17 per 1M output tokens. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your ChatGPT plan is separate.
Do I need an OpenRouter account to use Codestral 2508 in ChatGPT?
No. Spiral runs Codestral 2508 on its own OpenRouter account. You sign in to Spiral once and never paste a key.
How long does it take to set up Codestral 2508 in ChatGPT?
About two minutes: add a custom MCP server, then click Connect, then sign in to Spiral and approve.
Does ChatGPT wait while Codestral 2508 runs?
Codestral 2508 runs in the background. ChatGPT starts the run, checks on it and gives you the text, json when it's ready.
What is Codestral best suited to?
Codestral is designed for frequent code completions, filling gaps in existing code, and generating code from instructions. Start with a bounded task, such as completing one function or implementing one helper.
Can Codestral complete code between two existing sections?
Yes. Filling gaps in partial code is a core Codestral task. Include the surrounding code and clearly identify the section you want completed.
Does Codestral support multiple programming languages?
Yes. Mistral describes Codestral 2508 as supporting a wide range of languages and tasks. Name the target language, runtime, and dependencies in your request.
Which settings matter for focused code generation?
Start with a low temperature, around 0.2, for focused completions. Mistral recommends adjusting temperature or top-p, rather than changing both together.
How much code should I include in a request?
Include the relevant function, its dependencies, and the expected behavior. Leave room for the answer: context accounting includes both your input and the generated output.
Start using Codestral 2508 in ChatGPT
One Spiral account for every tool your agent needs. No subscription; you pay per run.
Paste this into ChatGPT:
set up https://spiral.ai/SKILL.md


