> ## 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 IntelliJ Translation Plugin với CometAPI

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

[IntelliJ Translation Plugin](https://plugins.jetbrains.com/plugin/8579-translation) bổ sung khả năng dịch bằng AI trực tiếp vào các IDE JetBrains. Kết nối plugin này với CometAPI để dịch mã và văn bản mà không cần rời khỏi trình soạn thảo.

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

* [IntelliJ IDEA](https://www.jetbrains.com/idea/) hoặc một IDE JetBrains khác

* Đã cài đặt Translation Plugin — tìm kiếm **Translation** trong JetBrains Marketplace

  <Frame>
    <img src="https://mintcdn.com/cometapi/mA1ovj6s0e3RM42l/images/integrations/810968_352994.png?fit=max&auto=format&n=mA1ovj6s0e3RM42l&q=85&s=3ea7331394d52a903c9b550830689eef" alt="JetBrains Marketplace hiển thị plugin Translation" width="972" height="806" data-path="images/integrations/810968_352994.png" />
  </Frame>

* 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ủa bạn.

    <Frame>
      <img src="https://mintcdn.com/cometapi/E4FFvyMYmaOZoldp/images/integrations/810968_360264.png?fit=max&auto=format&n=E4FFvyMYmaOZoldp&q=85&s=686b18e5eda53581cd92f39b18683c01" alt="Bảng điều khiển CometAPI — phần API keys" width="1920" height="1005" data-path="images/integrations/810968_360264.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/cometapi/E4FFvyMYmaOZoldp/images/integrations/810968_360265.png?fit=max&auto=format&n=E4FFvyMYmaOZoldp&q=85&s=4a5a528f1fbbeb3da7ace18066b73bd1" alt="Hộp thoại Add API Key trong console CometAPI" width="1914" height="999" data-path="images/integrations/810968_360265.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/cometapi/E4FFvyMYmaOZoldp/images/integrations/810968_360266.png?fit=max&auto=format&n=E4FFvyMYmaOZoldp&q=85&s=8462dfff1cf0a880c44effc7dccbc131" alt="API key và base URL của CometAPI" width="1920" height="975" data-path="images/integrations/810968_360266.png" />
    </Frame>
  </Step>

  <Step title="Cấu hình engine dịch">
    Nhấp vào biểu tượng Translation Plugin trên thanh công cụ IDE → **Settings** → **Translation**. Chọn **OpenAI Translation** làm engine. Trong bảng cài đặt bên phải, nhập `https://api.cometapi.com` vào trường **API Endpoint** (trường thứ hai mặc định là `/v1/chat/completions`). Dán key CometAPI của bạn vào **API Key** và nhấp **Confirm**.

    <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 — nút Add API Key và danh sách 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="Chi tiết API key CometAPI" width="2434" height="1232" data-path="images/overview/810968_364193.png" />
    </Frame>
  </Step>

  <Step title="Kiểm tra tích hợp">
    Nhấp vào **Test Service** trong phần cài đặt plugin. Việc xác minh thành công xác nhận rằng thiết lập đang hoạt động.

    <Frame>
      <img src="https://mintcdn.com/cometapi/mA1ovj6s0e3RM42l/images/integrations/810968_352997.png?fit=max&auto=format&n=mA1ovj6s0e3RM42l&q=85&s=2acec03c1fcd4584cf8448d588cf5d68" alt="Kiểm tra IntelliJ Translation Plugin — kết quả thành công" width="1092" height="944" data-path="images/integrations/810968_352997.png" />
    </Frame>
  </Step>
</Steps>

<Tip>
  Để thêm model tùy chỉnh, nhập model ID hiện tại vào trường cấu hình model của plugin.

  <Frame>
    <img src="https://mintcdn.com/cometapi/mA1ovj6s0e3RM42l/images/integrations/810968_352998.png?fit=max&auto=format&n=mA1ovj6s0e3RM42l&q=85&s=1138ce4ff04851f6db1ff996ea91f667" alt="Cài đặt model của IntelliJ Translation Plugin hiển thị một model tùy chỉnh đã được thêm" width="1215" height="874" data-path="images/integrations/810968_352998.png" />
  </Frame>
</Tip>

<script type="application/ld+json">
  {`
    {
    "@context": "https://schema.org",
    "@graph": [
      {
        "@type": "HowTo",
        "@id": "https://apidoc.cometapi.com/integrations/intellij-translation-plugin#howto",
        "name": "Sử dụng IntelliJ Translation Plugin với CometAPI",
        "description": "Sử dụng hướng dẫn này để cấu hình IntelliJ Translation Plugin 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/intellij-translation-plugin#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/intellij-translation-plugin#step-2",
            "position": 2,
            "name": "Cấu hình engine dịch",
            "text": "Hoàn thành bước Cấu hình engine dịch trong hướng dẫn Sử dụng IntelliJ Translation Plugin với CometAPI."
          },
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/intellij-translation-plugin#step-3",
            "position": 3,
            "name": "Kiểm tra tích hợp",
            "text": "Hoàn thành bước Kiểm tra tích hợp trong hướng dẫn Sử dụng IntelliJ Translation Plugin với CometAPI."
          }
        ]
      },
      {
        "@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 IntelliJ Translation Plugin với CometAPI",
            "item": "https://apidoc.cometapi.com/integrations/intellij-translation-plugin"
          }
        ]
      }
    ]
    }
    `}
</script>
