Our SDKs include automatic integration with OpenAI's modules.
With our SDKs, tracking OpenAI calls is super simple.
import OpenAI from "openai"import { monitorOpenAI } from "llmonitor/openai" // Simply call monitor() on the OpenAIApi class to automatically track requestsconst openai = new OpenAI({ apiKey: ... })const openai = monitorOpenAI(new OpenAI({ apiKey: ... }))
You can now tag requests and identify users.
const result = await openai.chat.completions.create({ model: "gpt-3.5-turbo", temperature: 0.9, tags: ["chat", "support"], // Optional: tags user: "user_123", // Optional: user ID userProps: { name: "John Doe" }, // Optional: user properties messages: [ { role: "system", content: "You are an helpful assistant" }, { role: "user", content: "Hello friend" }, ],})