OverpayingForAIPricing desk

Lesson 5 of 8 · 9 min read · Beginner

Prompting basics for Mistral

How to write prompts that get a good answer from Mistral models the first time, with three before-and-after examples and the token cost of getting it wrong.

In this lesson you will

  • Structure a prompt into role, task, context, constraints and output format
  • Rewrite a vague prompt into one that saves a second round-trip
  • Use system prompts and JSON output on the API to reduce wasted tokens

Mistral models respond well to plain, explicit instructions. They do not need tricks or magic phrases. What they need is the same thing a new colleague needs: who you are, what you want, the material to work from, the rules, and what the finished result should look like. Every missing piece costs you a second prompt, and on the API a second prompt is a second bill.

Anatomy of a prompt that works first timeFive parts. Most bad answers are missing two of them.RoleWho the model should be
“You are a pricing analyst…”
TaskThe one thing you want
“Rank these 4 plans by cost per 1K tokens.”
ContextFacts it cannot guess
paste the plan table, your usage
FormatShape of the answer
“a table, then a 2-line verdict”
ConstraintsWhat to avoid
“no marketing language; cite the source”
Cost angleA precise prompt costs a few hundred tokens more and saves the two or three retries that cost thousands.Asking for a short format (“3 bullets”) cuts output tokens — the expensive kind — by half or more.
Figure 1.A complete prompt: role, task, context, constraints, output format. Skipping any of them is the usual reason a first answer is wrong.

The five parts

  • Role: who the model should be. "You are a payroll specialist for a UK SME."
  • Task: one verb, one deliverable. "Rewrite this policy in plain English."
  • Context: the material. Paste it, or upload it in Le Chat. Do not paste the whole archive; pass what is needed.
  • Constraints: length, tone, what to leave out. "Under 200 words. No legal disclaimers."
  • Output format: bullets, a table, JSON, a subject line plus body. Naming the shape is the single biggest saver of follow-up prompts.

Worked example 1: the email

Before: "Make this email better." Mistral will guess at tone, length and audience, and you will probably ask again.

After: "You are my assistant. Rewrite the email below to a supplier who missed a delivery date. Keep it firm but polite, under 120 words, and end with a specific request for a new date by Friday. Return only the email body." One round-trip, and the output has no preamble to trim.

Worked example 2: the document summary

Before: "Summarise this." You get a generic paragraph that restates the introduction.

After: "Summarise the attached 40-page tender for a procurement manager who will decide whether to bid. Give: 1) deadline and submission format, 2) mandatory requirements as a checklist, 3) scoring weights, 4) three risks. Use headings and bullets. Do not exceed 300 words." The output is usable as-is, and on the API the output cap keeps the bill predictable.

Worked example 3: the code fix

Before: "Why doesn't this work?" followed by a 400-line file. The model rewrites everything and you cannot see what changed.

After: "This Python function should return the median of a list but returns the mean for even-length lists. Fix only the bug, keep the function signature, and return the corrected function plus a one-line explanation. Do not add tests or comments." Passing only the function, not the file, also cuts input tokens by roughly ten times.

Two API-specific habits

Put standing instructions in the system message and keep the user message for the changing part. Mistral's API supports a system role in the OpenAI-compatible shape, so your role, tone and format rules live in one place. And when a program will read the answer, ask for JSON and use the response format option so you are not paying for prose around the data. See the official docs for the current parameter names.

Knowledge check

Which single change most often removes the need for a second prompt?

Lesson FAQ

Does Mistral support system prompts?

Yes. The API accepts a system role message in the standard chat format, and Le Chat lets you set custom instructions that act the same way for every chat.

Can Mistral return JSON?

Yes. The API has a response format option for JSON output on supported models. Check the official docs for the exact parameter and which models support it.

Do longer prompts give better answers?

Only if the extra text is relevant. Irrelevant context costs input tokens and can distract the model. Pass the section the model needs, and state the format you want.

Finished reading?

Mark it done to track your progress through the course.

Compare, calculate, decide — for Mistral (Le Chat)

If our calculators helped you cut down on hidden AI wallet leaks, consider buying us a coffee. A tiny fraction of your savings keeps our pricing indexes updated daily.

Not sure which AI is cheapest for your use case? Find out in 30 seconds — no signup required.

AI cost intelligence

Stop overpaying for AI tools

Join the OverpayingForAI list for pricing updates, cheaper alternatives, and practical buying guidance.

Now tracking 50+ AI tools, models, platforms, subscriptions, coding tools, and automation products.

We use your email only for OverpayingForAI updates. Unsubscribe anytime.