How to Use Mistral Medium 3 in opencode
Mistral Medium 3 suits code review, STEM explanations, and questions over supplied text. It is the May 2025 model with a 128k context window, so leave room for the answer when providing long material.
Prompts to try with Mistral Medium 3 in opencode
Copy an example into opencode, or ask in your own words.
Use Mistral Medium 3 to review the current diff for logic errors. For each finding, identify the file, explain a reproducible failure case, and propose the smallest fix.
Use Mistral Medium 3 to draft tests for the project's input-validation functions. Cover empty values, boundary values, and malformed input; derive expected results from the existing specification.
Use Mistral Medium 3 to explain the calculation code in this project. Track units through each formula and flag assumptions that the code does not check.
Use Mistral Medium 3 to compare the README's documented behavior with the implementation. Return a table of discrepancies with file references and supporting excerpts.
Use Mistral Medium 3 to extract the public functions from the relevant source files into JSON containing name, purpose, inputs, and return value. Use null for undocumented details and temperature 0.2 for focused output.
How to set up Mistral Medium 3 in opencode
Pick the way that suits you. Each takes about two minutes.
Use Spiral's MCP server
- Add the server
Leave out --global to add Spiral to the current project only. No header and no client ID or secret: opencode registers itself with Spiral.
opencode mcp add spiral --global --url https://api.spiral.ai/mcp
- Sign in
Your browser opens. Sign in to Spiral, pick the organization and click Authorize, then return to the terminal. No API key. Inside opencode, /mcps starts the same sign-in.
opencode mcp auth spiral
- Check it
Spiral shows as connected.
opencode mcp list
Use the Spiral skill
- Send opencode 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 Mistral Medium 3
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/mistral-medium-3", "input": { "messages": [ { "role": "system" } ] } }'
Then paste one of the prompts above: opencode finds Mistral Medium 3 on Spiral, shows the price and runs it.
Mistral Medium 3 providers and prices
Spiral runs Mistral Medium 3 through OpenRouter. Open a card for today's price, with every fee included.
Up to $0.011736 per run at the default inputs. $0.572 per 1M input tokens, $2.86 per 1M output tokens.
Settings you can ask for
Ask opencode 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 104857 | 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: Mistral Medium 3 is on its tool page: open its card above.
What can you do with Mistral Medium 3 in opencode?
Turn project code and requirements into review findings, test drafts, and technical explanations with Mistral Medium 3. Give it the relevant files and request concrete evidence for each proposed change.
Review a proposed code change
Ask Mistral Medium 3 to inspect a diff for logic errors and missing edge cases. Request a concrete failure example for each finding.
Draft tests from requirements
Give Mistral Medium 3 a function contract and ask for normal, boundary, and invalid-input tests with expected results.
Explain a technical calculation
Provide the formula, quantities, and units. Ask Mistral Medium 3 to explain the calculation and identify assumptions that need checking.
Answer questions from supplied documentation
Give Mistral Medium 3 relevant text and ask it to support each answer with a short source excerpt. Require it to identify unanswered questions.
Extract records from business text
Ask Mistral Medium 3 to turn support messages or meeting notes into JSON records. Define missing values and include a completed example.
Prepare multilingual support drafts
Ask Mistral Medium 3 to draft French, German, or Spanish replies from supplied policy text. Provide approved terminology and review the translation before sending.
Explain results returned by a tool
Pass a completed lookup result to Mistral Medium 3 and ask for a plain-English explanation that preserves the returned values and identifies missing information.
More on Mistral Medium 3 and opencode
Overview
Mistral Medium 3 in other agents
Questions about Mistral Medium 3 in opencode
Can opencode use Mistral Medium 3?
Yes. Add Spiral to opencode as an MCP server, and opencode can find and run Mistral Medium 3 like any built-in tool.
How much does Mistral Medium 3 cost in opencode?
Up to $0.010668 per run at the default inputs. $0.52 per 1M input tokens, $2.60 per 1M output tokens. You pay from your Spiral balance as you go, with no subscription, and a failed run is not charged. Your opencode plan is separate.
Do I need an OpenRouter account to use Mistral Medium 3 in opencode?
No. Spiral runs Mistral Medium 3 on its own OpenRouter account. You sign in to Spiral once and never paste a key.
How long does it take to set up Mistral Medium 3 in opencode?
About two minutes: add the server, then sign in, then check it.
Does opencode wait while Mistral Medium 3 runs?
Mistral Medium 3 runs in the background. opencode starts the run, checks on it and gives you the text, json when it's ready.
What is Mistral Medium 3 good at?
Mistral identifies coding and STEM as particular strengths. Try it for reviewing a function, explaining a technical calculation, or drafting tests from a specification.
How much text can Mistral Medium 3 handle?
Its context window is 128k tokens. Input and output share that budget, so reserve space for the answer instead of filling the window with source material.
Can I trust an answer because it is valid JSON?
Check the contents against the source material. Mistral's guidance recommends evaluating generated answers for faithfulness to documents, even when the output has the requested structure.
How should I prompt Mistral Medium 3 for extraction?
State what to extract, define how to represent missing information, and include a completed example. For JSON output, explicitly request JSON and describe the required structure.
Which setting matters most for focused answers?
Start with a low temperature, such as 0.2, for extraction or code review. Higher values, such as 0.7, make output more random and can suit drafting alternatives.
Start using Mistral Medium 3 in opencode
One Spiral account for every tool your agent needs. No subscription; you pay per run.
Paste this into opencode:
set up https://spiral.ai/SKILL.md


