> ## Documentation Index
> Fetch the complete documentation index at: https://koreai-ai-for-service-dev.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuring the OpenAI Action

<Badge icon="arrow-left" color="gray">[Back to Actions Integrations](/ai-for-service/integrations/overview#actions)</Badge>

Connect OpenAI to generate answers from context and extract skills from documents. See [OpenAI Documentation](https://platform.openai.com/docs/api-reference/introduction) for more information.

***

## Authorizations Supported

The Platform supports basic authentication for OpenAI. See [App Authorization Overview](/ai-for-service/app-settings#authorization-profiles) for details.

| Authorization Type                       | Basic Auth |
| ---------------------------------------- | ---------- |
| Pre-authorize the Integration            | Yes        |
| Allow Users to Authorize the Integration | Yes        |

***

## Step 1: Enable the OpenAI Action

**Prerequisites:**

* If you don't have OpenAI credentials, create a developer account at [OpenAI](https://platform.openai.com/docs/api-reference/authentication).
* Copy your API Key.

**Steps:**

1. Go to **App Settings** > **Integrations** > **Actions**.
2. Select **OpenAI**.

### Pre-authorize the Integration

**Basic Auth**

1. Go to **App Settings** > **Integrations** > **Actions** and select **OpenAI**.

2. In **Configurations**, select the **Authorization** tab.

3. Set **Authorization Type** to **Pre-authorize the Integration** > **Basic Auth**.

4. Enter your **API Key**.

   <img src="https://mintcdn.com/koreai-ai-for-service-dev/fh_3A8H3yfCqeSto/ai-for-service/integrations/actions/images/open-ai-action-img2.png?fit=max&auto=format&n=fh_3A8H3yfCqeSto&q=85&s=0303b6b0d4ddecbf15c6a0d88635734d" alt="Auth Type and API Key" width="894" height="840" data-path="ai-for-service/integrations/actions/images/open-ai-action-img2.png" />

   <Note>The Platform uses the configured API Key to authorize and generate suggestions from OpenAI.</Note>

5. Click **Enable**. The **Integration Successful** pop-up is displayed.

   <img src="https://mintcdn.com/koreai-ai-for-service-dev/fh_3A8H3yfCqeSto/ai-for-service/integrations/actions/images/open-ai-action-img3.png?fit=max&auto=format&n=fh_3A8H3yfCqeSto&q=85&s=47e9ac2bea876600508c0d0e8d2792fd" alt="Enable integration" width="666" height="272" data-path="ai-for-service/integrations/actions/images/open-ai-action-img3.png" />

<Note>The OpenAI action moves from **Available** to **Configured** after enabling.</Note>

### Allow End User to Authorize

1. Go to **App Settings** > **Integrations** > **Actions** and select **OpenAI**.

2. In **Configurations**, select the **Authorization** tab.

3. Set **Authorization Type** to **Allow Users to Authorize the Integration** > **Basic Auth**.

   <img src="https://mintcdn.com/koreai-ai-for-service-dev/fh_3A8H3yfCqeSto/ai-for-service/integrations/actions/images/open-ai-action-img4.png?fit=max&auto=format&n=fh_3A8H3yfCqeSto&q=85&s=03b81556ab8105ed6158a5428f4c3da1" alt="Auth type - Basic Auth" width="899" height="836" data-path="ai-for-service/integrations/actions/images/open-ai-action-img4.png" />

4. Click **Select Authorization** > **Create New**.

   <img src="https://mintcdn.com/koreai-ai-for-service-dev/fh_3A8H3yfCqeSto/ai-for-service/integrations/actions/images/open-ai-action-img5.png?fit=max&auto=format&n=fh_3A8H3yfCqeSto&q=85&s=f1c1cf3da03dafeb0849367fe47952d9" alt="Create new Auth" width="797" height="844" data-path="ai-for-service/integrations/actions/images/open-ai-action-img5.png" />

5. Select **API Key** as the authorization mechanism. See [App Authorization Overview](/ai-for-service/app-settings#authorization-profiles).

   <img src="https://mintcdn.com/koreai-ai-for-service-dev/fh_3A8H3yfCqeSto/ai-for-service/integrations/actions/images/open-ai-action-img6.png?fit=max&auto=format&n=fh_3A8H3yfCqeSto&q=85&s=329a3a04e7c0e5255fca24b49a2d8206" alt="Auth mechanism - API Key" width="785" height="910" data-path="ai-for-service/integrations/actions/images/open-ai-action-img6.png" />

6. Enter the Basic Auth credentials:
   * **Name** - Name for the auth profile.
   * **Base URL** - Base tenant URL for OpenAI instance.
   * **Authorization Check URL** - Authorization check URL for your OpenAI instance.
   * **Description** - Description of the profile.

7. Click **Save Auth**.

   <img src="https://mintcdn.com/koreai-ai-for-service-dev/fh_3A8H3yfCqeSto/ai-for-service/integrations/actions/images/open-ai-action-img7.png?fit=max&auto=format&n=fh_3A8H3yfCqeSto&q=85&s=8ab204fff031047c2503cc10885114f3" alt="Save auth profile" width="797" height="902" data-path="ai-for-service/integrations/actions/images/open-ai-action-img7.png" />

8. Select the new **Authorization Profile**.

   <img src="https://mintcdn.com/koreai-ai-for-service-dev/fh_3A8H3yfCqeSto/ai-for-service/integrations/actions/images/open-ai-action-img8.png?fit=max&auto=format&n=fh_3A8H3yfCqeSto&q=85&s=7778f8556e724d88dc261f9ed94c2cbd" alt="Select auth profile to complete integration" width="1072" height="822" data-path="ai-for-service/integrations/actions/images/open-ai-action-img8.png" />

9. Click **Enable**.

***

## Step 2: Install the OpenAI Action Templates

1. On the **Integration Successful** dialog, click **Explore Templates**.

   <img src="https://mintcdn.com/koreai-ai-for-service-dev/fh_3A8H3yfCqeSto/ai-for-service/integrations/actions/images/open-ai-action-img9.png?fit=max&auto=format&n=fh_3A8H3yfCqeSto&q=85&s=469d752b96fa07f112d28cbf18966b15" alt="Explore Templates" width="666" height="270" data-path="ai-for-service/integrations/actions/images/open-ai-action-img9.png" />

2. Click **Install** to begin installation.

   <img src="https://mintcdn.com/koreai-ai-for-service-dev/fh_3A8H3yfCqeSto/ai-for-service/integrations/actions/images/open-ai-action-img10.png?fit=max&auto=format&n=fh_3A8H3yfCqeSto&q=85&s=e6a3ab0736a041455fd4ded4dbd9bd2a" alt="Begin installation" width="668" height="428" data-path="ai-for-service/integrations/actions/images/open-ai-action-img10.png" />

3. Once installed, click **Go to Dialog**. A dialog task for each template is auto-created.

   <img src="https://mintcdn.com/koreai-ai-for-service-dev/fh_3A8H3yfCqeSto/ai-for-service/integrations/actions/images/open-ai-action-img11.png?fit=max&auto=format&n=fh_3A8H3yfCqeSto&q=85&s=2a428164bcd1e2f8244e9d48dacbe82d" alt="Dialog task for each template" width="1336" height="508" data-path="ai-for-service/integrations/actions/images/open-ai-action-img11.png" />

4. Select the desired dialog task and click **Proceed**.

   <img src="https://mintcdn.com/koreai-ai-for-service-dev/fh_3A8H3yfCqeSto/ai-for-service/integrations/actions/images/open-ai-action-img12.png?fit=max&auto=format&n=fh_3A8H3yfCqeSto&q=85&s=77f853a88eec12f618adaf57729db1df" alt="Select desired task from template" width="1076" height="910" data-path="ai-for-service/integrations/actions/images/open-ai-action-img12.png" />

5. The dialog task is auto-created and the canvas opens with all required entity nodes, service nodes, and message scripts.

   <img src="https://mintcdn.com/koreai-ai-for-service-dev/fh_3A8H3yfCqeSto/ai-for-service/integrations/actions/images/open-ai-action-img13.png?fit=max&auto=format&n=fh_3A8H3yfCqeSto&q=85&s=05e3d4e0aa3c498e23dd7a348f03cacc" alt="dialog task is auto-created" width="1600" height="812" data-path="ai-for-service/integrations/actions/images/open-ai-action-img13.png" />
