> ## 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 AnythingLLM với CometAPI

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

[AnythingLLM](https://anythingllm.com/) là một ứng dụng AI desktop tất-cả-trong-một. Bằng cách chọn **Generic OpenAI** làm provider, bạn có thể kết nối ứng dụng này với CometAPI và truy cập hơn 500 model.

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

* Đã cài đặt [AnythingLLM](https://anythingllm.com/) trên máy của bạn
* Một tài khoản [CometAPI](https://www.cometapi.com) với 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 URL cơ sở 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à URL cơ sở của CometAPI" width="2434" height="1232" data-path="images/overview/810968_364193.png" />
    </Frame>
  </Step>

  <Step title="Cấu hình nhà cung cấp LLM">
    Mở **Settings** → **AI Providers** → **LLM Preferences** trong AnythingLLM. Chọn **Generic OpenAI** làm nhà cung cấp model và nhập `https://api.cometapi.com/v1` vào trường **URL**.
  </Step>

  <Step title="Thêm API key và model của bạn">
    Dán key CometAPI của bạn vào trường **API Key**. Đặt **Token Context Window** và **Max Tokens** khớp với model bạn đã chọn, sau đó nhập model ID hiện tại mà bạn muốn sử dụng.

    <Frame>
      <img src="https://mintcdn.com/cometapi/E4FFvyMYmaOZoldp/images/integrations/810968_360336.png?fit=max&auto=format&n=E4FFvyMYmaOZoldp&q=85&s=499826a1508a3749bf0815fe3c7e03df" alt="Tùy chọn LLM Preferences của AnythingLLM với Generic OpenAI được chọn" width="2014" height="985" data-path="images/integrations/810968_360336.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/cometapi/E4FFvyMYmaOZoldp/images/integrations/810968_360337.png?fit=max&auto=format&n=E4FFvyMYmaOZoldp&q=85&s=0e882f3675ff64c5c688e95b9629a2d9" alt="Các trường URL cơ sở và API key đã được điền" width="1905" height="1024" data-path="images/integrations/810968_360337.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/cometapi/E4FFvyMYmaOZoldp/images/integrations/810968_360338.png?fit=max&auto=format&n=E4FFvyMYmaOZoldp&q=85&s=7c1f49711b3c429b74c9934f69caa7d9" alt="Tên model và cài đặt token đã được cấu hình" width="1944" height="971" data-path="images/integrations/810968_360338.png" />
    </Frame>
  </Step>

  <Step title="Kiểm tra kết nối">
    Mở một workspace và gửi một tin nhắn thử nghiệm. Nếu nhận được phản hồi thành công, điều đó xác nhận tích hợp đang hoạt động.

    <Frame>
      <img src="https://mintcdn.com/cometapi/E4FFvyMYmaOZoldp/images/integrations/810968_360340.png?fit=max&auto=format&n=E4FFvyMYmaOZoldp&q=85&s=8d084b71b4df10e71d4ae9c40baf7766" alt="Chat AnythingLLM hiển thị phản hồi thành công" width="915" height="740" data-path="images/integrations/810968_360340.png" />
    </Frame>
  </Step>
</Steps>

<Tip>
  Bạn có thể thêm nhiều tên model trên cùng một trang cấu hình. Xem [danh sách model CometAPI](/vi/overview/models) để biết các định danh được hỗ trợ.
</Tip>

<script type="application/ld+json">
  {`
    {
    "@context": "https://schema.org",
    "@graph": [
      {
        "@type": "HowTo",
        "@id": "https://apidoc.cometapi.com/integrations/anythingllm#howto",
        "name": "Sử dụng AnythingLLM với CometAPI",
        "description": "Sử dụng hướng dẫn này để cấu hình AnythingLLM với CometAPI bằng cách thiết lập URL cơ sở, API key và các tùy chọn model hoặc nhà cung cấp.",
        "step": [
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/anythingllm#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/anythingllm#step-2",
            "position": 2,
            "name": "Cấu hình nhà cung cấp LLM",
            "text": "Hoàn thành bước Cấu hình nhà cung cấp LLM trong hướng dẫn Sử dụng AnythingLLM với CometAPI."
          },
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/anythingllm#step-3",
            "position": 3,
            "name": "Thêm API key và model của bạn",
            "text": "Hoàn thành bước Thêm API key và model của bạn trong hướng dẫn Sử dụng AnythingLLM với CometAPI."
          },
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/anythingllm#step-4",
            "position": 4,
            "name": "Kiểm tra kết nối",
            "text": "Chọn một model ID hiện tại từ trang CometAPI Models, sau đó gửi một yêu cầu thử nghiệm 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 AnythingLLM với CometAPI",
            "item": "https://apidoc.cometapi.com/integrations/anythingllm"
          }
        ]
      }
    ]
    }
    `}
</script>
