> 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/integration/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 subscribing to any prepaid plan. OpenAI operates on the **pay-as-you-go**model, meaning you only pay for what you consume.

Below, we explain the step-by-step process to generate the API key required for the integration.

### Step-by-step to Create an API Key on OpenAI

#### 1. Access the OpenAI Platform

Visit the OpenAI website via the link and click "start building":

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

<figure><img src="/files/94858404a3a900af367f3ce017a72d89eb587524" alt=""><figcaption></figcaption></figure>

If you don't have an account yet, 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="/files/be4927f8e1485e67566a2ea178f2d1cf92103cd5" alt=""><figcaption></figcaption></figure>

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

#### 3. Generate an API Key

After creating the organization, follow these steps:

<figure><img src="/files/75c11b969dc88d8102020d0bff207863c4a06c78" 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 **“Generate API Key”**.

<figure><img src="/files/43d2273801dda22cb61cf1d659402359e0c318ef" alt=""><figcaption></figcaption></figure>

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

#### 4. Configure Credits for API Usage (Optional)

OpenAI adopts a pay-as-you-go model. To start consuming the API, you can:

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

<figure><img src="/files/24772e7e819c5d3d6e2a06624187f08e2d606791" alt=""><figcaption></figcaption></figure>

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

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

<figure><img src="/files/5660507961ff0ea7aa5ff08ed6e74fc177bd2998" alt=""><figcaption></figcaption></figure>

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

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

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

<figure><img src="/files/0d0103a596cecac227eef7ef009db56df82114d8" alt=""><figcaption></figcaption></figure>

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

#### 2. Integrate the API with Sprinthub

Now that you have the API key, you can use it for integration with Sprinthub.

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

* Copy the key and paste it into Sprinthub's configuration, in the field intended for the OpenAI API.

### Final Considerations

Generating an API key on OpenAI is a quick and hassle-free process. Since billing is usage-based, you have full control over your expenses. **Remember to never share your API key publicly**, as this can 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! 🚀


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.sprinthub.com/en/topics/integration/integrations-artificial-intelligence-apis/integrations-chat-gpt/chatgpt-how-to-generate-the-chatgpt-api-key-to-integrate-with-sprinthub.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.
