Skip to main content
The SDK allows you to monitor Anthropic’s Claude models with zero code changes to your logic.

Setup

Import and run the instrumentation function.
from agentbasis.llms.anthropic import instrument

# Enable Anthropic instrumentation
instrument()

Usage

Use the Anthropic client as normal. All messages.create calls are automatically traced.
from anthropic import Anthropic

client = Anthropic()

response = client.messages.create(
    model="claude-3-opus-20240229",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello there"}]
)

Captured Data

The integration automatically records:
  • Model ID (e.g., claude-3-opus-20240229)
  • System and User prompts
  • Output text
  • Token counts (input/output)
  • Request duration