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

# Mistral AI

> Learn how to integrate Mistral AI with HoneyHive

export const integrationType_1 = "Mistral"

export const integrationType_0 = "Mistral"

Mistral is a French model provider that develops open, efficient, helpful, and trustworthy AI models through ground-breaking innovations in natural language processing.

With HoneyHive, you can trace all your {integrationType_0} operations using a single line of code. Find a list of all supported integrations [here](/introduction/troubleshooting#latest-package-versions-tested).

## HoneyHive Setup

Follow the [HoneyHive Installation Guide](/integrations/integration-prereqs) to get your API key and initialize the tracer.

## Mistral Setup

Go to [La Plateforme](https://console.mistral.ai/api-keys/) to get your Mistral API key.

Note: please use version `mistralai==0.2.0` for Python.

## Example

Here is an example of how to trace your {integrationType_1} code in HoneyHive.

<CodeGroup>
  ```python Python    theme={null}
  from mistralai.client import MistralClient
  import os
  from honeyhive import HoneyHiveTracer

  tracer = HoneyHiveTracer.init(
      api_key="MY_HONEYHIVE_API_KEY",
      project="MY_HONEYHIVE_PROJECT_NAME",
  )

  s = MistralClient(
      api_key=os.getenv("MISTRAL_API_KEY", ""),
  )

  res = s.chat(
      model="mistral-small-latest", messages=[
      {
          "content": "What is your name and model type? Answer in one short sentence.",
          "role": "user",
      },
  ])

  if res is not None:
      print(res.choices[0].message.content)
  ```

  ```typescript TypeScript theme={null}
  import { Mistral } from "@mistralai/mistralai";
  import process from "node:process";
  import { HoneyHiveTracer } from 'honeyhive';

  const tracer = await HoneyHiveTracer.init({
      apiKey: "MY_HONEYHIVE_API_KEY",
      project: "MY_HONEYHIVE_PROJECT_NAME",
      sessionName: "mistral",
  });

  const mistral = new Mistral({
      apiKey: process.env["MISTRAL_API_KEY"] ?? "",
  });

  async function run(input: string): Promise<any> {
      const result = await mistral.chat.complete({
          model: "mistral-small-latest",
          messages: [
              {
                  role: "user",
                  content: input,
              },
          ],
      });

      // Handle the result
      console.log(result);
      return result;
  }

  const tracedRun = tracer.traceFunction()(run);
  await tracedRun("Who is the best French painter? Answer in one short sentence.");
  ```
</CodeGroup>

## View your Traces

Once you run your code, you can view your execution trace in the HoneyHive UI by clicking the `Log Store` tab on the left sidebar.
