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

# Mistral Integration

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

## Get Started

The integration is compatible with

* Mistral Python SDK client `>=0.1.0`
* Mistral JS/TS SDK client `>=0.1.0`

**Python**

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

```python
from mistralai.client import MistralClient
import dokumetry

mistral = MistralClient(
  api_key="YOUR_MISTRAL_API_KEY"
)

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

**Javascript**

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

```javascript
import MistralClient from '@mistralai/mistralai';
import DokuMetry from 'dokumetry';

const mistral = new MistralClient("YOUR_MISTRAL_API_KEY");

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

## Supported Endpoints

The following Mistral Endpoints are supported for monitoring with DokuMetry

* [chat](https://dokulabs.mintlify.site/0.1/integrations/mistral/examples/mistral-chat.md)
* [embedding](https://dokulabs.mintlify.site/0.1/integrations/mistral/examples/embedding.md)

## Parameters

**Python**

| Parameter | Description | Required |
| - | - | - |
| llm | Mistral 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 | Mistral 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.