Our Python SDK includes automatic integration with Mistral via OpenAI’s package.

2

Monitor your client

With our SDKs, tracking Mistral calls is super simple.

import os
from openai import OpenAI
import lunary

MISTRAL_API_KEY = os.environ.get("MISTRAL_API_KEY")

client = OpenAI(api_key=MISTRAL_API_KEY, base_url="https://api.mistral.ai/v1/")

lunary.monitor(client)  # This line sets up monitoring for all calls made through the 'openai' module

chat_completion = client.chat.completions.create(
  model="mistral-small-latest",
  messages=[{"role": "user", "content": "Hello world"}]
)