How to Get an OpenAI API Key
At a Glance
- Target Audience
- Developers and app builders integrating AI features into websites or applications
- Problem Solved
- Locating or generating the correct OpenAI API key when an external app or service requires it for integration
- Use Case
- Connecting custom apps, websites, or tools to OpenAI models via API
<p>Use this guide if an app asks you for an OpenAI API key.</p>
<h2 id="what-you-need">What You Need</h2><ul>
<li>An OpenAI account.</li>
<li>Access to the OpenAI Platform, not just ChatGPT.</li>
<li>A payment method if OpenAI asks you to set up billing before using the API.</li>
</ul>
<h2 id="step-by-step">Step by Step</h2><ol>
<li>Go to platform.openai.com.</li>
<li>Sign in with your OpenAI account.</li>
<li>Open the API keys page: platform.openai.com/api-keys.</li>
<li>If OpenAI asks you to choose or create an organization or project, follow the prompts.</li>
<li>Select the option to create a new secret key.</li>
<li>Give the key a clear name, such as "My website" or the name of the app you are connecting.</li>
<li>Create the key.</li>
<li>Copy the key immediately.</li>
<li>Paste it into the app or service that asked for your OpenAI key.</li>
<li>Save your changes in that app.</li>
</ol>
<h2 id="if-you-cannot-create-a-key">If You Cannot Create a Key</h2><p>Check these common issues:</p>
<ul>
<li>You may need to add billing in the OpenAI Platform.</li>
<li>You may be signed into the wrong OpenAI account.</li>
<li>You may not have permission in the selected organization or project.</li>
<li>Your account may need email or phone verification.</li>
</ul>
<h2 id="important-safety-notes">Important Safety Notes</h2><p>OpenAI only shows the full secret key when you create it. If you close the page before copying it, create a new key and use the new one.</p>
<p>Do not share your key publicly. If you think the key was exposed, delete it on the API keys page and create a replacement.</p>
<h2 id="official-source">Official Source</h2><p>OpenAI says API keys can be created and managed from the official API key page, and that the full secret key is only shown when it is created.</p>
<p>Source: OpenAI help center</p>
