> ## Documentation Index
> Fetch the complete documentation index at: https://dokulabs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Anthropic Integration

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`

**Python**

```shell
pip install dokumetry==0.1.1
```

```python
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")
```

**Javascript**

```shell
npm install dokumetry@0.1.1
```

```javascript
import Anthropic from '@anthropic-ai/sdk';
import DokuMetry from 'dokumetry';

const anthropic = new Anthropic({
  apiKey: 'anthropic_api_key', 
});

DokuMetry.init({llm: anthropic, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})
```

## Supported Endpoints

The following Anthropic Endpoints are supported for monitoring with DokuMetry

* [messages](https://dokulabs.mintlify.site/0.1/integrations/anthropic/examples/messages.md)

## Parameters

**Python**

| Parameter | Description | Required |
| - | - | - |
| llm | Anthropic Object to track | Yes |
| doku\_url | URL of your Doku Ingester | Yes |
| api\_key | Your Doku API key | Yes |
| environment | Custom environment tag to include in your metrics | Optional |
| application\_name | Custom application name tag for your metrics | Optional |
| skip\_resp | Skip response from the Doku Ingester for faster execution | Optional |

**NodeJS**

| Parameter | Description | Required |
| - | - | - |
| llm | Anthropic Object to track | Yes |
| dokuUrl | URL of your Doku Ingester | Yes |
| apiKey | Your Doku API key | Yes |
| environment | Custom environment tag to include in your metrics | Optional |
| applicationName | Custom application name tag for your metrics | Optional |
| skipResp | Skip response from the Doku Ingester for faster execution | Optional |

## 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](https://dokulabs.mintlify.site/0.1/connections/intro.md)**
>
> Connect to your existing Observablity Platform

> **[API Reference](https://dokulabs.mintlify.site/0.1/api-reference/introduction.md)**
>
> OpenAPI specification for API Endpoints in Doku


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.