Our Python SDK includes automatic integration with OpenAI's module.
With our SDKs, tracking OpenAI calls is super simple.
from openai import OpenAIfrom llmonitor import monitor client = OpenAI( # defaults to os.environ.get("OPENAI_API_KEY") api_key="My API Key",) monitor(client) # This line sets up monitoring for all calls made through the 'openai' module chat_completion = client.chat.completions.create( model="gpt-3.5-turbo", messages=[{"role": "user", "content": "Hello world"}] )
You can now tag requests and identify users.
chat_completion = client.chat.completions.create( model="gpt-3.5-turbo", user_id="user_123", # Optional: user ID user_props={"name": "John Doe"}, # Optional: user properties tags=["chat", "support"], # Optional: tags messages=[{"role": "user", "content": "Hello world"}] )