Learning resourcesReviewed · Mistral AI

Mistral quickstart: send your first API request

A short Mistral documentation quickstart that shows beginners and developers how to send a first chat completion request to a Mistral model in Python, TypeScript or curl; the main catch is that you need your own Mistral API key and the page does not state what usage costs.

Researched 14 Nov 2026

In short.

This is a short Mistral documentation quickstart for beginners and developers who want to send a first chat completion request to a Mistral model. The main catch is that you need a Mistral API key, and the page says nothing about pricing. It gives setup commands and a minimal request in three forms: Python (the mistralai package, managed with uv), TypeScript (@mistralai/mistralai, run with tsx) and curl. Each route sends one user message to mistral-small-latest. Python and TypeScript print the answer; curl returns JSON containing the answer in choices[0].message.content. The page says this takes about 5 minutes. It also shows a sample of the expected output and a two-row error table for 401 and 429 responses. The documented commands, output and error behavior have not been independently verified.

Researched and written by an AI model and checked by a second AI model. How it works

The scope is the complete single documentation page at [https://docs.mistral.ai/inference/quickstarts/send-your-first-request.md]. Pages it links to are outside this scope: the API key creation page, the chat completions reference, and the function calling, structured output and image analysis quickstarts. The page includes no licence, pricing, changelog or SDK source, so costs and reuse rights are reported as unknown. The documented commands, code, sample output, timing and error behavior have not been independently verified; they are reported as the publisher documents them.

The overview

What this resource is

This is a single documentation page titled Quickstart: send your first API request, on Mistral's documentation site at [https://docs.mistral.ai/inference/quickstarts/send-your-first-request.md]. It says its purpose is to install the Mistral SDK and get a first answer from a Mistral model in Python, TypeScript or curl in about 5 minutes.

It is a tutorial, not a software package, model or tool, which is why it counts as a learning resource. What it teaches you to use is the Mistral chat completions API and the Mistral SDK for Python and TypeScript.

Overall assessment

Based on its content, this is a clear, focused first-step guide. It does one thing: send a single chat message and get the answer back. It gives complete commands and code for three routes, shows what success looks like and includes a short troubleshooting table.

It is deliberately minimal. It does not cover streaming, system prompts, multi-turn conversations, model choice, pricing or production concerns. The page links to four other pages: function calling, structured output, image analysis and the chat completions reference. What those pages contain is not shown on this page and is unknown here. The page's claims about timing and output come from the publisher and have not been independently verified.

Who it is for

It suits people who are new to the Mistral API and want a minimal route to a working request. That includes developers who are comfortable in a terminal and beginners who can follow commands exactly. Because there are three routes, you can pick the language you already use, or use curl with no language setup at all.

It suits people less well if they need advanced features, a comparison between providers, or guidance on pricing or deployment, because the page does not cover those topics. It gives no numeric rate limits, but it does explain what a 429 rate-limit error means and how to respond to one.

What it teaches you to do

The page teaches one task: send a chat completion request that names a model and carries one user message, then read the reply. The example message is In one sentence, what is an API key? and the model is mistral-small-latest.

In Python and in TypeScript, you read the reply from response.choices[0].message.content. With curl, the answer is the content field of choices[0].message in the JSON response.

It also explains two common errors. A 401 with the body {"detail":"Invalid API Key"} means the key is missing, incomplete or revoked. A 429 Too Many Requests means you hit a rate limit, and the page advises waiting, then retrying with exponential backoff.

Using it

What you need

Every route needs a Mistral API key exported as the environment variable MISTRAL_API_KEY. The page links to a separate page for creating one. The key-creation steps are not on this page, so they are unknown here.

For Python you need Python 3.10 or later and uv, a Python package and project manager. For TypeScript you need Node.js and npm; the page gives no minimum Node.js version. For curl you need nothing else.

The page does not say which operating systems it assumes, but its commands are written for a Unix-style shell (export, echo $MISTRAL_API_KEY and line continuations with a backslash). It does not cover Windows.

How it works

Each route sends an HTTPS request to the Mistral chat completions endpoint. The curl example shows the address directly: [https://api.mistral.ai/v1/chat/completions]. It authenticates with an Authorization: Bearer header carrying your API key, and it sends a JSON body with a model name and a messages array.

The Python and TypeScript routes wrap the same call in Mistral's client libraries. The Python code imports Mistral from mistralai.client, builds a client with the key from the environment and calls client.chat.complete(model=..., messages=[...]). The TypeScript code imports Mistral from @mistralai/mistralai, builds a client with process.env.MISTRAL_API_KEY and awaits client.chat.complete({ model, messages }). The page says the TypeScript SDK is published as an ES module, so the project must set "type": "module". It uses tsx to run the .ts file directly.

The model name ends in -latest. The page does not explain what that suffix means for version stability, so it does not establish whether the underlying model changes over time.

Setup steps as documented

Python: run uv init first-request --python 3.12, change into the new folder, then run uv add mistralai. Create quickstart.py with the code shown, then run uv run quickstart.py.

TypeScript: create a folder and change into it, run npm init -y and npm pkg set type=module, then run npm install @mistralai/mistralai and npm install --save-dev tsx. Create quickstart.ts with the code shown, then run npx tsx quickstart.ts.

curl: no setup. Run the curl command shown; the request body is in its -d argument.

The install commands do not pin SDK versions, so the version you get depends on what the package registries serve at the time. The page does not say which SDK versions it was written for.

Worked example from the page

The Python version is a short script. It imports os and Mistral, creates the client from the MISTRAL_API_KEY variable, calls client.chat.complete with model mistral-small-latest and one user message, and prints the message content of the first choice.

The page says you should see a one-sentence answer in your terminal and that the wording varies between runs. Its sample is: An API key is a unique identifier used to authenticate and authorize access to an API. This sample comes from the page and has not been independently verified.

If the request fails with a 401, the page tells you to run echo $MISTRAL_API_KEY in the same terminal, then export the full key again. For a 429, it tells you to wait, then retry with exponential backoff.

Assessment & evidence

Limitations and risks

The page covers only a first request. It does not cover streaming, system messages, multi-turn chats, parameters such as temperature, token limits, model selection beyond one example, or error handling beyond two cases.

Rate limits exist, as the 429 Too Many Requests row in the error table shows, but the page gives no numeric limits. Its only guidance is to wait, then retry with exponential backoff.

Your API key is a secret. The examples read it from an environment variable instead of writing it into the code, which is the safer pattern. The page does not discuss how to store or rotate a key, or what to do if one leaks.

The message you send goes to Mistral's hosted API. The page does not describe data handling, retention or privacy, so those are unknown. It also gives no guidance on how accurate the model's answers are.

The documented commands, output and error behavior have not been independently verified. It is not established whether the commands work with current package versions, your Node.js version or your operating system. One detail to watch: the Python import path is from mistralai.client import Mistral. If that import fails with the SDK version you install, compare it with Mistral's current SDK documentation.

Reasoning behind the assessment

The assessment rests on the page's content. It gives exact commands, complete code for each language, the prerequisites, an expected result and the causes of common failures. That is enough to describe specifically what a reader will do.

The page is short and covers a narrow task, so the assessment applies only to that task. The timing (about 5 minutes), the sample output and the error handling come from the page itself and have not been independently verified.

Alternatives and next steps

The page offers three alternative routes. Python uses the mistralai package and uv. TypeScript uses @mistralai/mistralai and tsx. curl needs nothing beyond the API key. You can choose the language you already use, or choose curl to skip language setup.

The page links to four next steps: call your own functions, get structured output, analyze an image, and the Chat completions reference. It does not describe what they contain, so their contents are unknown here.

The page covers only Mistral's hosted API, so it will not help if you need a different vendor or want to run a model locally.

Evidence base

The evidence is the full text of the documentation page at [https://docs.mistral.ai/inference/quickstarts/send-your-first-request.md]. It supplies the prerequisites, commands, code examples, sample output and error table described above. The documented commands, output and error behavior have not been independently verified.

The page includes no licence, pricing, publication date or update date. It also includes no changelog and no SDK source.

Access & freshness

Costs

The page states no price, free tier, credit allowance or billing terms. It does not say whether sending the example request is free or charged, or how much it costs. It also does not describe what you must sign up for to get an API key.

uv, Node.js and npm are prerequisites you must already have. The page's commands install the Mistral SDKs (mistralai for Python and @mistralai/mistralai for TypeScript) and, for TypeScript, tsx. The page states no licences or costs for any of this software.

Rights and reuse

The page shows no licence or reuse terms for its text or its code snippets. It also does not describe the terms for using the Mistral API or the output the API generates, so those terms are unknown here. Check Mistral's own terms before relying on either.

Because the page states no licence, nothing on it supports republishing or redistributing its text or code beyond ordinary linking and reading.

Freshness

The page shows no publication date, last-updated date or version number, so its age is unknown.

Several things are unknown: whether its commands and code work with current SDK releases, whether the model alias mistral-small-latest is still available, and whether the API endpoint and the linked key-creation steps are still current. Check the live page before you follow it.

Suggested actions

If you want to try the Mistral API, first check Mistral's current pricing and usage terms, because this page does not give them. Then create an API key through Mistral's own key page, export it as MISTRAL_API_KEY and follow the route that matches your language.

Keep the key out of source code and version control. If a request returns 401, export the full key again in the same terminal. If it returns 429, wait, then retry with backoff. Once your first request works, you can move on to the page's linked next steps for functions, structured output or images, after confirming those pages are current.

Evidence for this report

selected-page.txtselected · checked 2026-11-14