1
Setup the SDK
Python
Learn how to set up the Python SDK.
2
Monitor your client
With our SDKs, tracking Mistral calls is super simple.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Setup the SDK
Monitor your client
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"}]
)