OpenAI integration

Our SDKs include automatic integration with OpenAI's modules.


Monitor OpenAI

With our SDKs, tracking OpenAI calls is super simple.

import OpenAI from "openai"
import { monitorOpenAI } from "lunary/openai"
// Simply call monitor() on the OpenAIApi class to automatically track requests
const openai = new OpenAI()
const openai = monitorOpenAI(new OpenAI())

Tag requests and identify users

You can now tag requests and identify users.

const result = await{
model: "gpt-4o",
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" },

Questions? We're here to help.