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

> Sử dụng hướng dẫn này để cấu hình gptme 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.

[gptme](https://github.com/ErikBjare/gptme) là một trợ lý AI chạy trong terminal. Hãy cấu hình nó để sử dụng CometAPI bằng cách chỉnh sửa tệp `config.toml`.

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

* Đã cài đặt [gptme](https://github.com/ErikBjare/gptme)
* 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="Get your CometAPI API key">
    Đă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="CometAPI API key và base URL" width="2434" height="1232" data-path="images/overview/810968_364193.png" />
    </Frame>
  </Step>

  <Step title="Edit config.toml">
    Mở `~/.config/gptme/config.toml` (tạo tệp nếu chưa tồn tại). Đặt `url` thành `https://api.cometapi.com/v1` và dán CometAPI key của bạn làm API key.

    <Frame>
      <img src="https://mintcdn.com/cometapi/mA1ovj6s0e3RM42l/images/integrations/810968_351553.png?fit=max&auto=format&n=mA1ovj6s0e3RM42l&q=85&s=07a12c20d1fe1aed2f3d1832a27e8f1d" alt="gptme config.toml — các trường URL và API key" width="526" height="92" data-path="images/integrations/810968_351553.png" />
    </Frame>
  </Step>

  <Step title="Test the connection">
    Chạy `gptme` trong terminal của bạn và gửi một prompt thử nghiệm. 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/gptme#howto",
        "name": "Sử dụng gptme với CometAPI",
        "description": "Sử dụng hướng dẫn này để cấu hình gptme 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/gptme#step-1",
            "position": 1,
            "name": "Lấy CometAPI API key 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/gptme#step-2",
            "position": 2,
            "name": "Chỉnh sửa config.toml",
            "text": "Hoàn thành bước Chỉnh sửa config.toml trong hướng dẫn Sử dụng gptme với CometAPI."
          },
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/gptme#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 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 gptme với CometAPI",
            "item": "https://apidoc.cometapi.com/integrations/gptme"
          }
        ]
      }
    ]
    }
    `}
</script>
