> ## Documentation Index
> Fetch the complete documentation index at: https://ngrok.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Mistral AI with the AI Gateway

> Call Mistral AI models through the ngrok AI Gateway by adding your own Mistral API key to ngrok.ai and assigning it to an access key.

[Mistral AI](https://mistral.ai) serves its own models and open models from other labs through its API.

Mistral AI supports Chat Completions requests.

> [!NOTE]
>
> Even though Mistral AI is a **built-in provider**, it still requires you to **bring your own key** because you can't pay for it with credits at this time.

## Setup

### 1. Create an access key

Follow the [quickstart](https://ngrok.com/docs/ai-gateway/quickstart.md) to create an access key in [app.ngrok.ai](https://app.ngrok.ai).

### 2. Store your Mistral AI API key

Create an API key in your [Mistral AI](https://mistral.ai) account.
Then [add a provider key](https://ngrok.com/docs/ai-gateway/guides/attaching-provider-keys.md#add-a-provider-key).

### 3. Create a configuration

[Create an access key configuration](https://ngrok.com/docs/ai-gateway/guides/access-key-configurations.md#create-a-configuration) with a `mistral` routing rule and allow Mistral AI in the access scope.

### 4. Assign and send requests

Assign the configuration to your access key and send requests with your access key:

```python theme={"theme":{"light":"css-variables","dark":"css-variables"}}
from openai import OpenAI

client = OpenAI(
    base_url="https://gateway.ngrok.ai/v1",
    api_key="ng-xxxxx-g1-xxxxx",
)

response = client.chat.completions.create(
    model="mistral:z-ai/glm-5.3",
    messages=[{"role": "user", "content": "Hello!"}]
)
```

Other providers also serve GLM-5.3, so the `mistral:` prefix keeps the request on Mistral AI.

## Available models

See the [model catalog](https://ngrok.com/docs/ai-gateway/reference/model-catalog.md#mistral-ai).
To call a Mistral AI model that isn't in the catalog yet, send its ID with the `mistral:` prefix.
See [catalog updates](https://ngrok.com/docs/ai-gateway/reference/model-catalog.md#catalog-updates).

## Next steps

* [Provider keys](https://ngrok.com/docs/ai-gateway/guides/attaching-provider-keys.md)
* [Access key configurations](https://ngrok.com/docs/ai-gateway/guides/access-key-configurations.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.