> For the complete documentation index, see [llms.txt](https://cleyrop.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cleyrop.gitbook.io/docs/documentation-fr-en/administration/gerer-les-modeles-et-les-cles-api.md).

# Manage models and API keys

As a Platform Manager, you can connect your own AI model providers (OpenAI, Mistral, Anthropic, OVH, etc.), define the default models used by Le Druide and the corpora, and make other models available to developers via the PyAI library.

<figure><img src="/files/13111b93bd994168dbdbd72db9f61d88af3d21e5" alt=""><figcaption></figcaption></figure>

***

### API key types

Two types of keys coexist in the interface:

**Client keys** : added by the Platform Manager, fully editable and deletable.

**Cleyrop keys** : preconfigured by Cleyrop. Their models can be used and can be set as default models. They cannot be deleted.

### Add an API key

1. Click **+ Add**
2. Enter the **clear**, the '**API URL** and the **API key**
3. Click **Discover models** to automatically retrieve the list of models available from this provider, or add them manually
4. Add a **display name** for each model if necessary
5. Confirm

The key appears in the list with its associated models.

{% hint style="info" %}
The technical name (techname) of a model can only be changed at creation time and only for models added manually.
{% endhint %}

### Configure default models

Three default models can be defined for the platform:

* **Instruct model (general-model)** — used by Le Druide for conversations. Accessible in PyAI via `"default-instruct"`.
* **Embedding model (emb-model)** — used to vectorize corpora. Accessible in PyAI via `"default-embedding"`.
* **Coder model** — used for code features (MCP Dataset). Accessible in PyAI via `"default-coder"`.

The change of default model is **effective immediately** across the entire platform.

{% hint style="warning" %}
A corpus created with a given embedding model cannot be used with another embedding model. Make sure not to change the default embedding model if existing corpora depend on it.
{% endhint %}

### Edit or delete an API key

* **Edit** : open the key, modify the desired fields and save. A model defined as a default model cannot be deleted while it is in use — a clear message prompts you to change the default model first.
* **Delete** : a modal displays the impacted items (assistants, corpora, Dataflows) before confirmation.

### Track token consumption

From **Administration > Monitoring**, tab **Tokens**, you can track token consumption of your LLM models.

The page displays for the selected period:

* **Prompt tokens** : tokens sent to the models
* **Completion tokens** : tokens generated in response
* **Total tokens** : sum of the two

A trend chart is displayed for each configured model, with the model name and associated provider. You can navigate between periods using the navigation arrows.
