Anthropic integration

Our SDKs include automatic integration with Anthropic's modules.

1

Setup the SDK

2

Monitor OpenAI

With our SDKs, tracking Anthropic calls is super simple.

import Anthropic from "@anthropic-ai/sdk"
import { monitorAnthropic } from "lunary/anthropic"

// Simply call monitor() on the Anthropic class to automatically track requests
const anthropic = new Anthropic()
const anthropic = monitorAnthropic(new Anthropic())

3

Tag requests and identify users

You can now tag requests and identify users.

const result = await anthropic.messages.create({
  model: "claude-3-5-sonnet-20240620",
  temperature: 0.9,
  tags: ["chat", "support"],  // Optional: tags
  user: "user_123",  // Optional: user ID
  userProps: { name: "John Doe" },  // Optional: user properties
  system: "You are an helpful assistant",
  messages: [
    { role: "user", content: "Hello friend" },
  ],
})

Questions? We're here to help.

Email