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

# Mistral AI

You can use the Literal AI platform to instrument Mistral AI API calls. This allows you to track and monitor the usage of Mistral AI API calls in your application and replay them in the Prompt Playground.

<Check>The Mistral AI instrumentation supports sync, async, streamed and regular responses!</Check>

## Instrumenting Mistral AI API calls

<CodeGroup>
  ```python Python theme={null}
  from mistralai import Mistral, UserMessage
  import json, os
  from literalai import LiteralClient

  literalai_client = LiteralClient(api_key="")
  literalai_client.instrument_mistralai()

  client = Mistral(api_key="")

  model = "mistral-large-latest"

  messages = [
      {
          "role": "user",
          "content": "What is the best French cheese?",
      }
  ]

  # With streaming
  stream_response = client.chat.stream(
      model = model,
      messages = messages,
  )

  for chunk in stream_response:
      print(chunk.data.choices[0].delta.content)

  # Now you can use the OpenAI API as you normally would
  ```
</CodeGroup>
