With our SDKs, tracking Mistral calls is super simple.
Copy
import osfrom openai import OpenAIimport lunaryMISTRAL_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' modulechat_completion = client.chat.completions.create( model="mistral-small-latest", messages=[{"role": "user", "content": "Hello world"}])
Assistant
Responses are generated using AI and may contain mistakes.