# How to get an OpenAI API key

Source: https://thinkbeside.com/learn/how-to-get-openai-api-key

Updated 2026-11-17 - Sources checked 2026-11-17

**Short answer:** Sign in to OpenAI's developer platform, open the API keys page and create a key, then store it somewhere safe such as an environment variable. Add credits on the billing page for higher limits, and set a spend alert. A ChatGPT subscription is separate and does not give you a key.

## Create the key

OpenAI's quickstart sends you to the API keys page of the developer platform to create a key [s1].

- Open the API keys page of the OpenAI platform and choose to create a new key [s1].

- If you create it inside a project, set an expiration date at the same time, so you rotate it on a schedule [s2].

- Copy the key and keep it somewhere safe, such as an environment variable or a secret manager, not in code or a public repository [s1] [s2].

## Billing, credits and limits

The quickstart says you start with a free test API request, and that adding credits on the billing page gives you higher limits for real applications [s1]. After you enter billing information, OpenAI sets an approved usage limit for your organization, which you can see on its limits page and which rises as your usage grows [s2].

To avoid a surprise bill, set a spend alert on the limits page, which sends a notice when usage passes an amount you choose. A hard spend limit goes further and stops API traffic once tracked spend reaches a monthly cap [s2]. What each model costs is covered in [What the OpenAI API costs](/learn/openai-api-cost).

## Keep the key safe, and replace it safely

Treat the key as a password that spends money. OpenAI advises loading keys from environment variables or a secret manager, and using a project's service account for an application rather than one person's key [s2].

To replace a key, create the new one, update the apps that use it, check they still work, and only then revoke the old key [s2]. If you think a key has leaked, revoke it and review your usage.

## Use the key in Thinkbeside

Open Settings in the Thinkbeside side panel, choose OpenAI and paste the key. It is encrypted and kept in this browser, is never synced to your account, and is never given to web pages. Requests with it go from the panel straight to OpenAI. See [the sidebar that runs on your own key](/use/chatgpt-sidebar-own-api-key), or [what BYOK means](/learn/what-is-byok).

## Sources

- s1: [Developer quickstart](https://developers.openai.com/api/docs/quickstart), OpenAI, checked 2026-11-17

- s2: [Production best practices](https://developers.openai.com/api/docs/guides/production-best-practices), OpenAI, checked 2026-11-17

## Is the OpenAI API key free?

OpenAI's quickstart describes a free test request, and says adding credits gives higher limits for real applications [s1]. Usage beyond that is billed per token. The price of each model is on OpenAI's pricing page.

## Does ChatGPT Plus include an API key?

No. ChatGPT and the API platform are billed separately. More in [ChatGPT Plus or the API](/learn/chatgpt-plus-vs-api).

## Can I put the key in a website or app I share?

No. OpenAI says to keep keys out of code and public repositories and to load them from environment variables or a secret manager [s2]. A key in a browser extension on your own computer, such as Thinkbeside, stays on that computer.

## What do I do if the key leaks?

Create a new key, update the apps that use it, then revoke the old one [s2]. Check your usage for anything you did not make.

Your OpenAI key, in a sidebar: [See how it works](https://thinkbeside.com/use/chatgpt-sidebar-own-api-key)

