Model setup recipes

Start with Mistral Studio’s Free API: Send a Request to Small 4

Send a text request to `mistral-small-2603` through Mistral Studio Free mode.

Mistral Studio Free mode provides a development API1. This guide asks Small 4 to summarize a notice and reads the answer in the terminal.

Requirements and key details
  • Free mode is enabled by default, and API access and key creation can start without a card.
  • Free-mode inputs and outputs may be used for training. Set the Studio/API opt-out in Admin’s Privacy menu.

Free mode is a limited API route for development

The Mistral Studio API accepts messages and a model ID over HTTPS, then returns a response from a hosted model. Free mode is enabled by default for new accounts, and you can start issuing API keys and making calls without a card. This route is for evaluation and prototyping, with usage limits.

API limits cover requests per second, tokens2 per minute, and tokens per month. Values vary by model and organization, so check the current limits in Mistral Admin’s Limits page.

A compact computer connects to a browser, file box, calendar, and chat window
Send a public notice to the model and read its completed summary in the terminal.

Check Small 4’s API model ID

Mistral Small 4 handles instruction following, reasoning and coding in one model. Its weights are released under Apache 2.0, and its API model ID is mistral-small-2603. Check whether this ID is available in Free mode in Playground and Admin, then review current limits in Admin’s Limits page. The example asks for a summary of a public notice.

Review input-data settings before creating a key

In Free mode, API inputs and responses may be used to train Mistral models. To opt out, disable the Anonymous improvement data toggle under Privacy in Mistral Admin. Use short, non-sensitive text for the example.

In a macOS or Linux shell, check with python3 --version that Python 3.10 or later is installed. Issue an API key in Studio’s API Keys menu and store it securely, then create a virtual environment3 and install the official mistralai SDK.

Install the virtual environment and Mistral SDK
python3 --version
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip mistralai
Run the Python file below from this same virtual environment.
A person checks progress indicators and an organized stack of documents on a monitor
A successful response confirms that the SDK setup and model selection work together.

Ask Small 4 to summarize a short notice

Save the following as quickstart.py. getpass reads the key without displaying it. The script asks the model to summarize a public notice in two points, then prints the completed summary and finish_reason in the terminal.

Send a summary request to Small 4
# quickstart.py
from getpass import getpass
from mistralai.client import Mistral

client = Mistral(api_key=getpass("Mistral API key: "))
response = client.chat.complete(
    model="mistral-small-2603",
    messages=[
        {
            "role": "user",
            "content": (
                "Summarize this notice in two bullet points: "
                "The library closes at 5 p.m. on Friday and reopens Monday at 9 a.m."
            ),
        }
    ],
    max_tokens=512,
)

choice = response.choices[0]
print(choice.message.content or "(No response text returned)")
print(f"finish_reason={choice.finish_reason}")
Run `python quickstart.py` to print the summary and response completion status.
Run the request file
python quickstart.py
The summary and `finish_reason` appear in the terminal.

Check the First Response and Common Startup Errors

On success, the two-item summary appears in choice.message.content, and finish_reason shows the completion status. For 401, recheck the Studio API key. For 402, first check that the account is in Free mode and that the selected model is currently available for free development access in Playground and Admin. To stay on the free route, verify the model and plan before adding payment details.

A 429 appears when request frequency or token limits are reached. Check requests per second, tokens per minute, and monthly tokens in Admin’s Limits page; then space out requests or shorten the input. Free mode is a starting point for small evaluations and is suited to checking SDK connectivity and response format within the displayed limits.

A robot inside a clear enclosure sits beside a router, storage box, and documents
When managing an API key, review its access scope and the input-data settings too.

Terminology notes

  1. API — A defined interface that lets other code call a program’s functions.

    Back to the text
  2. Token — A unit into which a model divides input or output for processing.

    Back to the text
  3. Python virtual environment — An isolated space for installing Python packages per project, helping reduce package-version conflicts.

    Back to the text

Frequently asked questions

What should you check first in this article?
Mistral Studio Free mode provides a development API. This guide asks Small 4 to summarize a notice and reads the answer in the terminal.
Where can you check the conditions and sources?
Mistral Small 4 handles instruction following, reasoning and coding in one model. Its weights are released under Apache 2.0, and its API model ID is `mistral-small-2603`. Check whether this ID is available in Free mode in Playground and Admin, then review current limits in Admin’s `Limits` page. The example asks for a summary of a public notice.