Table of contents

Add secure integrations to your products and AI agents with ease via Merge.
Get a demo

How to get your Mistral AI API key (5 steps)

Jon Gitlin
Senior Content Marketing Manager
at Merge

Mistral AI, a European-based AI company, offers several cutting-edge large language models (LLMs).

To leverage any of them, you can access and use Mistral AI's APIs.

The first step in using any of their endpoints is generating your API key. We’ll help you do just that by walking you through the 5 easy steps you can take.

1. Sign in or create your account

From Mistral AI’s homepage, you’ll need to click on the “Log In” button.

Mistral AI's homepage

From there, you’ll either need to sign in or create an account.

Mistral AI login

{{this-blog-only-cta}}

2. Set up your workspace (if you’re creating an account)

If you’re creating an account, you’ll need to create a workspace, which involves giving it a name, clarifying whether it’s only for a single user or a team, and accepting Mistral AI's terms and conditions.

Mistral AI Workspace setup

3. Select API Keys from the Overview page

Under the API section on the left-hand side, you should see an “API Keys” button. Go ahead and click this.

Accessing API Keys from overview page

4. Create your key

You’ll now see an option to create a new key. 

Creating your API key

Once you select this, you’ll be asked to assign a name and expiration date to the key.

Giving the API key a name and expiration date

Related: A guide to using an AI connector

5. Copy your API key

The key would now be fully visible. You should go ahead and copy it as it won’t be shown again

Copying your API key

Other considerations for building to Mistral AI’s API

Before building to their endpoints, it’s worth familiarizing yourself with the following:

Pricing

Mistral AI’s API costs depend on factors like the model you want to access, whether you use the batch API, and the number of tokens you need to consume. 

For example, here are their costs for some of their premier models:

Mistral AI's API pricing for their premier models

Learn more about Mistral AI’s API pricing.

Rate limits 

Each workspace has a preset rate limit, which depends on your usage tier. The rate limits are also set by either requests per second or tokens per minute or month.

For instance, for each model, you may be able to make 1 request per second or consume either 500,000 tokens per minute or 1,000,000 tokens per month.

Mistral AI's API rate limits

Learn more about Mistral AI’s rate limits.

Errors to look out for

You can come across a wide range of errors; here are just a few you might run into:

  • 401 Unauthorized: This error indicates that the API request lacks valid authentication credentials. It often occurs when the API key is missing, incorrect, or associated with the wrong service
  • 400 Bad Request: This can happen when the 'role' field in the message payload is incorrect—such as setting the role to “system” instead of “user” or 'tool' 
  • 404 Not Found: You might see this when the resource and/or model doesn’t exist, or if the endpoint URL isn’t formatted correctly
  • 429 Too Many Requests: You’ve reached your rate limit and can’t make additional requests until the current window expires

Leverage Mistral AI’s models effectively with Merge Gateway

Merge Gateway is a single API and control plane for running LLM traffic in production, with built-in routing, spend controls, and request-level visibility.

Visual on Merge Gateway

It offers:

  • Efficient model selection: Automatically route each request to the right model for the job to reduce cost while protecting output quality
  • Spend controls and governance: Configure budgets and usage rules by team, project, or customer tier to prevent runaway usage
  • End-to-end observability + fallback: Review detailed logs and routing decisions for every request, with automatic failover when a provider degrades

Try Merge Gateway for free today!

Jon Gitlin
Senior Content Marketing Manager
@Merge

Jon Gitlin is the Managing Editor of Merge's blog. He has several years of experience in the integration and automation space; before Merge, he worked at Workato, an integration platform as a service (iPaaS) solution, where he also managed the company's blog. In his free time he loves to watch soccer matches, go on long runs in parks, and explore local restaurants.

Read more

How to connect to the Sentry MCP with Claude Code (5 steps)

AI

How to connect to the Google Drive MCP with Claude Code (5 steps)

AI

How to connect to the Notion MCP with Claude Code (5 steps)

AI

Subscribe to the Merge Blog

Get stories from Merge straight to your inbox

Subscribe

Start optimizing your AI spend in production

Dynamically route each request to the best-fit model (including Mistral AI’s models) to reduce spend without compromising performance via Merge Gateway.

Learn more
But Merge isn’t just a Unified 
API product. Merge is an integration platform to also manage customer integrations.  gradient text
But Merge isn’t just a Unified 
API product. Merge is an integration platform to also manage customer integrations.  gradient text
But Merge isn’t just a Unified 
API product. Merge is an integration platform to also manage customer integrations.  gradient text
But Merge isn’t just a Unified 
API product. Merge is an integration platform to also manage customer integrations.  gradient text