> For the complete documentation index, see [llms.txt](https://tailieu.smax.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tailieu.smax.ai/module-cai-dat/tich-hop/openai.md).

# OpenAI

{% hint style="warning" %}
Hướng dẫn thêm tích hợp OpenAI vào SmaxAi
{% endhint %}

Đầu tiên, bạn cần truy cập vào trang cài đặt của OpenAI [<mark style="color:purple;">**tại đây**</mark>](https://platform.openai.com/settings/organization/general), sau đó chọn vào phần Billing

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2FjapAUjeArTfpaEuzsat6%2Fimage.png?alt=media&amp;token=6272ce89-5720-488f-86c8-b61127d17261" alt=""><figcaption></figcaption></figure>

Bạn cần đảm bảo tài khoản OpenAI của bạn còn đủ số dư trong Billing, nếu không có bạn cần nạp tiền vào đây để sử dụng API của OpenAI

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2FGlirxLpsaHsI3FT6NWUq%2Fimage.png?alt=media&amp;token=be8176ab-f467-4bba-b2f1-28b9b7920517" alt=""><figcaption></figcaption></figure>

Sau đó bạn vào phần API keys, chọn Create new secret key

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2F33gY290KY1nfuRBbcDcz%2Fimage.png?alt=media&amp;token=277926cb-0473-43d2-9c73-28653d5e21d8" alt=""><figcaption></figcaption></figure>

Nhập tên của secret key, sau đó chọn Create secret key để tạo

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2FfDnZLtZb5yVLMcRMvERX%2Fimage.png?alt=media&amp;token=0457598e-c88a-4c6e-9b52-e451b22b2903" alt=""><figcaption></figcaption></figure>

Sau khi tạo xong, copy và lưu lại secret key

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2FPurNNvy8BrLeBTm45fMZ%2Fimage.png?alt=media&amp;token=b77a676e-faf6-404d-b2f2-db22be377bc7" alt=""><figcaption></figcaption></figure>

Tiếp theo truy cập Cài đặt trên SmaxAi, trong phần Tích hợp chọn Thêm mới

Chọn nền tảng là OpenAi, đặt tên và dán secret key vừa tạo vào ô API Key, chọn Lưu để thêm tích hợp

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2Fj0JEHY1650V38T55VLmO%2Fimage.png?alt=media&amp;token=bb2710a6-d1f2-47fa-80d8-5d42f2755045" alt=""><figcaption></figcaption></figure>
