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

Get Started

The integration is compatible with
  • OpenAI Python SDK client >=1.13.0
  • OpenAI JS/TS SDK client >=4.28.0
pip install dokumetry==0.1.1
from openai import OpenAI
import dokumetry

client = OpenAI()

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

Supported Endpoints

The following OpenAI Endpoints are supported for monitoring with DokuMetry

Parameters

ParameterDescriptionRequired
llmOpenAI 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