> 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="/files/94858404a3a900af367f3ce017a72d89eb587524" 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="/files/be4927f8e1485e67566a2ea178f2d1cf92103cd5" 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="/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 on **“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 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="/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 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="/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 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! 🚀


---

# 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, and the optional `goal` query parameter:

```
GET 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?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
