Skip to main content
DokuMetry SDKs (dokumetry) empowers you to effortlessly track and monitor Anthropic usage data and metrics from your Python/NodeJS code.

Get Started

The integration is compatible with
  • Anthropic Python SDK client >=0.19.0
  • Anthropic JS/TS SDK client >=0.9.0
pip install dokumetry==0.1.1
from anthropic import Anthropic
import dokumetry

anthropic = Anthropic(
    api_key="anthropic_api_key",
)

dokumetry.init(llm = anthropic, doku_url = "YOUR_DOKU_INGESTER_URL", api_key = "YOUR_DOKU_TOKEN")

Supported Endpoints

The following Anthropic Endpoints are supported for monitoring with DokuMetry

Parameters

ParameterDescriptionRequired
llmAnthropic Object to trackYes
doku_urlURL of your Doku IngesterYes
api_keyYour Doku API keyYes
environmentCustom environment tag to include in your metricsOptional
application_nameCustom application name tag for your metricsOptional
skip_respSkip response from the Doku Ingester for faster executionOptional

Advanced Usage

When using DokuMetry in Production environments, It is recommened to set Skip response parameter to true for faster porcessing. To filter your LLM Usage according application or the environment, set the Application name and Environment paramaters with the actual values.

Connections

Connect to your existing Observablity Platform

API Reference

OpenAPI specification for API Endpoints in Doku