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

# Sử dụng LibreChat với CometAPI

> Sử dụng hướng dẫn này để cấu hình LibreChat với CometAPI bằng cách thiết lập base URL, API key và các tùy chọn model hoặc provider.

[LibreChat](https://www.librechat.ai/) là giao diện chat mã nguồn mở hỗ trợ nhiều nhà cung cấp AI. Kết nối nó với CometAPI bằng cách cấu hình CometAPI như một endpoint tương thích với OpenAI.

## Điều kiện tiên quyết

* LibreChat — [cloud](https://librechat-librechat.hf.space/), [self-hosted](https://github.com/danny-avila/LibreChat), hoặc cục bộ
* Một tài khoản [CometAPI](https://www.cometapi.com) có API key đang hoạt động

## Thiết lập

<Steps>
  <Step title="Lấy API key CometAPI của bạn">
    Đăng nhập vào [bảng điều khiển CometAPI](https://www.cometapi.com/console). Nhấp vào **Add API Key** và sao chép key cùng base URL của bạn (`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="Bảng điều khiển CometAPI — 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="API key và base URL của CometAPI" width="2434" height="1232" data-path="images/overview/810968_364193.png" />
    </Frame>
  </Step>

  <Step title="Cấu hình endpoint OpenAI">
    Trong LibreChat, vào **Settings** → **OpenAI**. Nhập `https://api.cometapi.com` vào trường **URL**, dán key của bạn vào **API Key**, rồi nhấp **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="Cài đặt LibreChat — trường URL và key OpenAI" 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="Giao diện chat LibreChat sau khi CometAPI đã được cấu hình" width="1265" height="607" data-path="images/integrations/810968_351622.png" />
    </Frame>
  </Step>

  <Step title="Kiểm tra kết nối">
    Bắt đầu một cuộc trò chuyện trong LibreChat. Phản hồi thành công xác nhận rằng việc tích hợp đang hoạt động.
  </Step>
</Steps>

<script type="application/ld+json">
  {`
    {
    "@context": "https://schema.org",
    "@graph": [
      {
        "@type": "HowTo",
        "@id": "https://apidoc.cometapi.com/integrations/librechat#howto",
        "name": "Sử dụng LibreChat với CometAPI",
        "description": "Sử dụng hướng dẫn này để cấu hình LibreChat với CometAPI bằng cách thiết lập base URL, API key và các tùy chọn model hoặc provider.",
        "step": [
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/librechat#step-1",
            "position": 1,
            "name": "Lấy API key CometAPI của bạn",
            "text": "Tạo hoặc mở tài khoản CometAPI của bạn, sau đó sao chép một API key đang hoạt động từ bảng điều khiển."
          },
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/librechat#step-2",
            "position": 2,
            "name": "Cấu hình endpoint OpenAI",
            "text": "Hoàn thành bước Cấu hình endpoint OpenAI trong hướng dẫn Sử dụng LibreChat với CometAPI."
          },
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/librechat#step-3",
            "position": 3,
            "name": "Kiểm tra kết nối",
            "text": "Chọn một model ID hiện tại từ trang Models của CometAPI, sau đó gửi một yêu cầu kiểm tra từ phần tích hợp."
          }
        ]
      },
      {
        "@type": "BreadcrumbList",
        "itemListElement": [
          {
            "@type": "ListItem",
            "position": 1,
            "name": "Tài liệu CometAPI",
            "item": "https://apidoc.cometapi.com/"
          },
          {
            "@type": "ListItem",
            "position": 2,
            "name": "Tích hợp",
            "item": "https://apidoc.cometapi.com/integrations"
          },
          {
            "@type": "ListItem",
            "position": 3,
            "name": "Sử dụng LibreChat với CometAPI",
            "item": "https://apidoc.cometapi.com/integrations/librechat"
          }
        ]
      }
    ]
    }
    `}
</script>
