# OpenAI/ChatGPT

You'll need to configure an OpenAI integration if you want to use OpenAI as part of your mods. First, you'll need to obtain an API key from OpenAI.

### Finding the API key from OpenAI

To get the API key, [go to your OpenAI account page](https://platform.openai.com/account/api-keys).

If you haven’t already created an account, you’ll need to create one. (It’s free at this time of writing.) If you aren’t logged in, you’ll need to log in. Once logged in, you’ll be directed to your API keys page.

Create a new API key by selecting the **+ Create new secret key** button displayed in the middle of the page.

<figure><img src="/files/xb0Z70PZQsOVikfWRQHd" alt=""><figcaption></figcaption></figure>

A new modal appears confirming the new key was generated and displaying the key. Click the green copy button after the string to copy it to your clipboard and paste it into the `apiKey` field in PixieBrix.

<figure><img src="/files/DbXsS6e1ZjxTEAQ7Qnvk" alt="" width="345"><figcaption></figcaption></figure>

Click **Save** on the OpenAI configuration modal in PixieBrix and you’re ready to start using your OpenAI integration! You’ll be able to select this integration from the dropdown menu when configuring mods that use OpenAI.

### Configuring an OpenAI Integration in PixieBrix&#x20;

{% hint style="info" %}
To set up a cloud integration that your team can access, head to the [Admin Console](https://app.pixiebrix.com/). *(If you'd rather set up something locally, use the Extension Console. Learn more about* [Configuring Integrations](/integrations/configuring-integrations.md).*)*
{% endhint %}

From the **Integrations** section in the Admin or Extension Console, click the **+** **Add Integration** button in the top right corne&#x72;**.**&#x20;

<figure><img src="/files/Lo08nPm7s2quxp6gr0ii" alt=""><figcaption></figcaption></figure>

Search for and select the OpenAI integration.

<figure><img src="/files/aTtXiSRJm0sDCt20gBBK" alt=""><figcaption></figcaption></figure>

You can then follow the prompts for setting up an integration. Label the integration with a useful name, and paste in the API key from OpenAI.

<figure><img src="/files/SvwLn9FC6MAvTwQ1oJVU" alt=""><figcaption></figcaption></figure>

Click **Save,** and your integration will be ready for use in any [OpenAI mods](https://www.pixiebrix.com/marketplace/search/?tags=openai-chatgpt).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pixiebrix.com/integrations/openai-chatgpt.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
