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

# Embedding

> Monitor Mistral Embedding API Usage

**Python**

### Synchronous Usage

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

mistral = MistralClient(
  api_key="YOUR_MISTRAL_API_KEY"
)

# Pass the above `mistral` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.
dokumetry.init(llm=mistral, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")

response = mistral.embeddings(
  model="mistral-embed",
  input=["Monitor LLM Applications"]
)
print(response)
```

### Asynchronous usage

```python default
import asyncio
from mistralai.client import AsyncMistralClient
import dokumetry

mistral = AsyncMistralClient(
  api_key="YOUR_MISTRAL_API_KEY"
)

# Pass the above `mistral` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.
dokumetry.init(llm=mistral, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")

async def main() -> None:
  mistral.embeddings(
    model="mistral-embed",
    input=["Monitor LLM Applications"]
  )

  print(response)

asyncio.run(main())
```

**Javascript**

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

const mistral = new MistralClient("YOUR_MISTRAL_API_KEY");

// Pass the above `mistral` object along with your Doku Ingester URL and API key and this will make sure that all Anthropic calls are automatically tracked.
DokuMetry.init({llm: mistral, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})

async function main() {
  const input = [];
  for (let i = 0; i < 1; i++) {
    input.push('LLM Monitoring');
  }
  const embeddingsBatchResponse = await mistral.embeddings({
    model: 'mistral-embed',
    input: input,
  });
}

main();
```


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