---
description: >-
  Connecting the OpenAI API with the plugin allows you to infuse the chat
  functionality with powerful AI capabilities. Follow the step-by-step guide
  below to set up the integration:
---

# Connecting the OpenAI API

## Obtain OpenAI API Key

* Visit the OpenAI platform at [this link](https://platform.openai.com/account/api-keys).
* Create an account or log in if you already have one.
* Generate your unique API key. This will be used to authenticate your plugin's requests with OpenAI.

**2. Configure the `config.yml`:**

* Open the `config.yml` file for the GPT Assistant plugin.
* Locate the `openai` section and find the following settings:\


```
# Plugin's prefix.
prefix: '&8[&6GPTAssistant&8]&7 '
# The desired language for the plugin, matching the name of the file within the "lang" directory.
lang: english

# Your unique OpenAI API key. Obtain it from https://beta.openai.com/account/api-keys
api-key: "YOUR_API_KEY_HERE"

# For developers: unless you're aware of its implications, keep it deactivated. 
# Activating might affect plugin's performance due to increased debug information relayed to the console.
debug: false
```

Replace `YOUR_API_KEY_HERE` with the API key you obtained from OpenAI.

**Configuration Explanation:**

* `api-key`: Insert your unique OpenAI API key in this section.
* `prefix`: This specifies how the plugin messages will be prefixed in chat.
* `lang`: Determines the language in which the plugin operates. It should match a language file present in the “lang” folder.
* `debug`: For those with technical know-how, this can be turned on for debugging purposes. However, note that it might impact the performance due to extensive debugging details being shared.

By meticulously following the above steps, you will seamlessly integrate OpenAI API with GPTAssistant. Now, get ready to experience the unprecedented interactivity on your server! Should you face any hiccups or seek clarifications, don't hesitate to check the GPTAssistant Wiki or tap into the community's expertise.
