> ## 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.

# Cohere integration

DokuMetry SDKs (`dokumetry`) empowers you to effortlessly track and monitor Cohere usage data and metrics from your Python/NodeJS code.

## Get Started

The integration is compatible with

* Cohere Python SDK client `>=5.0.0`
* Cohere JS/TS SDK client `>=7.6.0`

**Python**

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

```python
import cohere
import dokumetry

co = cohere.Client('YOUR_API_KEY')

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

**Javascript**

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

```javascript
import { CohereClient } from "cohere-ai";
import DokuMetry from 'dokumetry';

const co = new CohereClient({
        token: "YOUR_COHERE_API_KEY",
});

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

## Supported Endpoints

The following Cohere Endpoints are supported for monitoring with DokuMetry

* [Chat](https://dokulabs.mintlify.site/latest/integrations/cohere/examples/cochat.md)
* [Generate](https://dokulabs.mintlify.site/latest/integrations/cohere/examples/generate.md)
* [Summarize](https://dokulabs.mintlify.site/latest/integrations/cohere/examples/summarize.md)
* [Embed](https://dokulabs.mintlify.site/latest/integrations/cohere/examples/embed.md)

## Parameters

**Python**

| Parameter | Description | Required |
| - | - | - |
| llm | Cohere 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 | Cohere 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/latest/connections/intro.md)**
>
> Connect to your existing Observablity Platform

> **[API Reference](https://dokulabs.mintlify.site/latest/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.