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

# LibreChat

> Connect LibreChat to AIHubMix through the OpenAI-compatible endpoint.

LibreChat is an open-source multi-model chat client. After connecting AIHubMix, AIHubMix-supported OpenAI, Claude, Gemini, DeepSeek, GLM, and other models can be used under LibreChat's **OpenAI** endpoint.

## Prerequisites

Before configuration, confirm that:

* LibreChat is installed and running. Version v0.7.5 or later is recommended.
* You have created an API key in the [AIHubMix console](https://aihubmix.com/token), usually in the `sk-***` format.
* You can edit the `.env` file in the LibreChat installation directory. It is usually in the LibreChat project root, next to `package.json` and `docker-compose.yml`.
* The file path is usually `your-install-path/LibreChat/.env`. If it does not exist, copy `.env.example` in the same directory and rename it to `.env`.

## Configure `.env`

Open the `.env` file in the LibreChat project root and add or update these lines:

```env theme={null}
OPENAI_API_KEY=your_AIHubMix_key
OPENAI_REVERSE_PROXY=https://aihubmix.com/v1
```

If you do not want to store the key in `.env`, use LibreChat's user-provided mode:

```env theme={null}
OPENAI_API_KEY=user_provided
OPENAI_REVERSE_PROXY=https://aihubmix.com/v1
```

`user_provided` tells LibreChat to ask the current user for the API key in the UI. Both modes still expose AIHubMix models under the **OpenAI** endpoint.

If the primary API domain is unavailable, use the backup domain:

```env theme={null}
OPENAI_REVERSE_PROXY=https://api.inferera.com/v1
```

By default, the model list is returned by AIHubMix. You usually do not need to set `OPENAI_MODELS`. If you want LibreChat to show only specific models, add a comma-separated list:

```env theme={null}
OPENAI_MODELS=gpt-4o-mini,gpt-5.5,claude-haiku-4-5,deepseek-chat,gemini-3.5-flash,glm-5.2
```

To show the full model list supported by AIHubMix, do not configure `OPENAI_MODELS`, or keep the existing `# OPENAI_MODELS=...` line commented out.

## Restart LibreChat

After modifying `.env`, restart LibreChat so the new configuration takes effect:

* Local script: run your original LibreChat startup script again.
* Source or npm setup: open the LibreChat project root, where `.env` is located, and rerun your normal startup command.
* Docker setup: run `docker compose restart` in the directory containing `docker-compose.yml`, or restart the container.

## Result

After restarting, choose **OpenAI** in LibreChat's endpoint/model selector, then select the AIHubMix model you want to use. When `OPENAI_MODELS` is not set, the list is provided by AIHubMix.

<img src="https://mintcdn.com/aihubmix/j4q_-ouc8NkeJVBQ/public/cn/LibreChat-new-01.png?fit=max&auto=format&n=j4q_-ouc8NkeJVBQ&q=85&s=c0d1e2c385d904659570e6ab9f8a8fbf" alt="LibreChat AIHubMix model selector" width="1910" height="925" data-path="public/cn/LibreChat-new-01.png" />

## References

* AIHubMix: [aihubmix.com](https://aihubmix.com)
* LibreChat: [librechat.ai](https://www.librechat.ai/)
* LibreChat local install docs: [librechat.ai/docs/local/npm](https://www.librechat.ai/docs/local/npm)
* LibreChat `.env.example`: [github.com/danny-avila/LibreChat/blob/main/.env.example](https://github.com/danny-avila/LibreChat/blob/main/.env.example)

***

Last updated: 2026-07-03
