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

# Use LibreChat with CometAPI

> Use this guide to configure LibreChat with CometAPI by setting the base URL, API key, and model or provider options.

[LibreChat](https://www.librechat.ai/) is an open-source chat UI that supports multiple AI providers. Connect it to CometAPI by configuring it as an OpenAI-compatible endpoint.

## Prerequisites

* LibreChat — [cloud](https://librechat-librechat.hf.space/), [self-hosted](https://github.com/danny-avila/LibreChat), or local
* A [CometAPI](https://www.cometapi.com) account with an active API key

## Setup

<Steps>
  <Step title="Get your CometAPI API key">
    Log in to the [CometAPI dashboard](https://www.cometapi.com/console). Click **Add API Key** and copy your key and base URL (`https://api.cometapi.com`).

    <Frame>
      <img src="https://mintcdn.com/cometapi/SZhlxZhCnMLn__BW/images/overview/810968_364191.png?fit=max&auto=format&n=SZhlxZhCnMLn__BW&q=85&s=aef81a83f29f8eb16655ed4060425f50" alt="CometAPI dashboard — Add API Key" width="3824" height="1892" data-path="images/overview/810968_364191.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/cometapi/HhtmQffktazbxUvS/images/overview/810968_364193.png?fit=max&auto=format&n=HhtmQffktazbxUvS&q=85&s=d893f659267150d0faf45f99eb5dffc1" alt="CometAPI API key and base URL" width="2434" height="1232" data-path="images/overview/810968_364193.png" />
    </Frame>
  </Step>

  <Step title="Configure the OpenAI endpoint">
    In LibreChat, go to **Settings** → **OpenAI**. Enter `https://api.cometapi.com` in the **URL** field, paste your key into **API Key**, and click **Save**.

    <Frame>
      <img src="https://mintcdn.com/cometapi/mA1ovj6s0e3RM42l/images/integrations/810968_351621.png?fit=max&auto=format&n=mA1ovj6s0e3RM42l&q=85&s=5d45cd43d93da40b2a2e0242aae24b04" alt="LibreChat settings — OpenAI URL and key fields" width="1024" height="496" data-path="images/integrations/810968_351621.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/cometapi/mA1ovj6s0e3RM42l/images/integrations/810968_351622.png?fit=max&auto=format&n=mA1ovj6s0e3RM42l&q=85&s=618a09316772d953db084f36234fd8d5" alt="LibreChat chat interface after CometAPI has been configured" width="1265" height="607" data-path="images/integrations/810968_351622.png" />
    </Frame>
  </Step>

  <Step title="Test the connection">
    Start a conversation in LibreChat. A successful reply confirms the integration is working.
  </Step>
</Steps>
