# OpenAI API Key

OpenAI provides access to models such as GPT-4o, GPT-5, and others through its developer platform. The API key you generate here is separate from any ChatGPT subscription you might have.

### Prerequisites

You need the following:

* An email address, or a Google, Microsoft, or Apple account for single sign-on
* A payment method (credit or debit card) for purchasing API credits

### Step-by-step instructions

Follow the steps to set up the OpenAI API key:&#x20;

{% stepper %}
{% step %}
Go to [platform.openai.com](https://platform.openai.com/), and create your account using an email address or a single sign-on (SSO) provider.
{% endstep %}

{% step %}
Review the information. If prompted, enter a password in the **Password** field, and then click **Continue**.
{% endstep %}

{% step %}
In the **Full name** field, enter your name, enter your date of birth in the **Birthday** field, and then click **Finish creating accoun**t.
{% endstep %}

{% step %}
On the **Welcome to OpenAI Platform** page, enter a name in the **Organization name** field, select an option in the **What best describes you?** list, and then click **Create organization**.&#x20;
{% endstep %}

{% step %}
On the **Invite your team** page, enter email addresses in the **Emails** field, assign the designated role, and then click **Continue**. To skip this step, click **I'll invite my team later**.
{% endstep %}

{% step %}
On the **Make your first API call** page, enter a name in the **API key name** and **Project name** fields, and then click **Generate API Key**. To skip this step, click **I'll do this later**. Every API key belongs to a project inside your organization. You can create a project or use the default one.

{% hint style="info" %}
**Tip:**  Go to <https://platform.openai.com/api-keys>, and click <img src="/files/M2BIgatT9FkFquN7SqHD" alt="" data-size="line"> **Edit** to redefine the API key permissions.&#x20;
{% endhint %}
{% endstep %}

{% step %}
On the **Make your first API call** page, click **Copy** to copy your new API key. You can also try out the new API key by selecting the **curl**, **Node**, or **Python** tab to view the code examples. Click **Continue**.

{% hint style="warning" %}
**Important:** OpenAI shows your secret key only once. If you lose it, you must generate a new one. Treat it like a password. Store it in a password manager, an `.env` file, or a secrets manager. Never commit it to a public repository.
{% endhint %}
{% endstep %}

{% step %}
On the **Add some API credits** page, select a credit amount, and then click **Purchase credits**. To skip this step, click **I'll buy credits later.**
{% endstep %}
{% endstepper %}

### Test your key

Store your key as an environment variable (for example, `OPENAI_API_KEY`), and use the official Python or Node.js SDK. Alternatively, test with a simple `curl` request using the `Authorization: Bearer` header.

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


---

# 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.mydbsync.com/cloud-workflow/create-your-workflow/actions/ai-agent-api-key-guides/openai-api-key.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.
