> For the complete documentation index, see [llms.txt](https://docs.sprinthub.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sprinthub.com/en/topics/integrations/integrations-artificial-intelligence-apis/integrations-chat-gpt/chatgpt-how-to-generate-the-chatgpt-api-key-to-integrate-with-sprinthub.md).

# ChatGPT - How to Generate the ChatGPT API Key to Integrate with SprintHub

{% embed url="<https://youtu.be/Cu6H5iDLHFQ>" %}

### Introduction

If you want to integrate the ChatGPT API with Sprinthub, know that the process is simple and does not require signing up for any prepaid plan. OpenAI works on a **pay-as-you-go**, meaning you only pay for what you use.

Below, we explain step by step how to generate the API key needed for the integration.

### Step-by-Step Guide to Creating an API Key in OpenAI

#### 1. Access the OpenAI Platform

Go to the OpenAI website through the link and click on "start building":

👉 [OpenAI Developer Platform](https://platform.openai.com/docs/overview)

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2FFGv1jbwGmqGGkaQlvOaO%2Fimage.png?alt=media&amp;token=84f4b97e-66af-4b80-becf-a2bd52ac4049" alt=""><figcaption></figcaption></figure>

If you don't already have an account, sign up for free and log in.

#### 2. Create an Organization

If this is your first time accessing the platform, you will need to create an organization:

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2FUSD2i60h6lSAA9m5ChmA%2Fimage%20(1).png?alt=media&amp;token=6390e8ce-ff3a-42da-b98d-ab7822f4e7bb" alt=""><figcaption></figcaption></figure>

* Enter a **name for the organization**.
* Choose the option that best describes your technical profile.
* Click on **“Create organization”**.

#### 3. Generate an API Key

After creating the organization, follow these steps:

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2FLO3TJIHivjkmcvbdjedO%2Fimage%20(2).png?alt=media&amp;token=9d2481c0-c951-44dd-b61b-67723f1a89a9" alt=""><figcaption></figcaption></figure>

* In the **API Key Name**, set a name for the key (example: "My Test Key").
* In the **Project Name**, you can leave the default or name the project according to your needs.
* Click on **“Generate API Key”**.

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2FbNRJijHeqIih9DQv17Cj%2Fimage%20(3).png?alt=media&amp;token=fbc68875-97a9-4f4f-ae68-0f4d73ecc065" alt=""><figcaption></figcaption></figure>

Your key will be displayed on the screen. **Copy and store this key in a secure place.**

#### 4. Set Up Credits for API Usage (Optional)

OpenAI uses a pay-as-you-go payment model. To start using the API, you can:

* Select one of the available credit options (example: **$5, $10 or $20**).
* Or skip this step and buy credits later.

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2F6KUzcjG9Yqjisst4rsSM%2Fimage%20(4).png?alt=media&amp;token=af9e17fa-e9cc-49f7-a230-c39df8bf2f66" alt=""><figcaption></figcaption></figure>

### If you already have an organization created within OpenAI

#### 1. Access Existing Keys in the Dashboard

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2FZojEC4rx00ia6dBtRG5d%2Fimage.png?alt=media&amp;token=7fb855ad-7f81-4ab9-98ee-2bfd164abb38" alt=""><figcaption></figcaption></figure>

If you have already set up OpenAI before and want to access your keys:

* In the side menu, click on **“API Keys”**.
* View or generate new keys as needed.

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2FrlR6OGPvFqbcb5n8spAR%2Fimage.png?alt=media&amp;token=14d7ee10-1b0f-4d33-b7fc-9736a2fb29e1" alt=""><figcaption></figcaption></figure>

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2F2ofgD2Avd6ZRpoPzTD2I%2Fimage.png?alt=media&amp;token=da7f2c04-7a45-45a1-923e-a3377f9b1786" alt=""><figcaption></figcaption></figure>

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2FhobkXsDRImUliysKVh7U%2Fimage.png?alt=media&amp;token=edf69232-c8fa-4012-a30c-2110729e306b" alt=""><figcaption></figcaption></figure>

#### 2. Integrate the API with Sprinthub

Now that you have the API key, you can use it to integrate with Sprinthub.

{% embed url="<https://docs.sprinthub.com/topicos/integracao/integracoes-chat-gpt>" %}

* Copy the key and enter it in Sprinthub's settings, in the field intended for the OpenAI API.

### Final Considerations

Generating an API key in OpenAI is a quick process with no bureaucracy. Since billing is usage-based, you have full control over your spending. **Remember never to share your API key publicly**, as this could compromise the security of your account.

Now that you know how to generate your key, take the opportunity to explore the possibilities of integration with Sprinthub! 🚀
