Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

An OpenAI API key is created in the OpenAI API Platform, not in ChatGPT settings. You can create a project key, limit its permissions, and load it into your application through the OPENAI_API_KEY environment variable.

API access is billed separately from a ChatGPT subscription. New API accounts use prepaid billing, so add credits before making paid API requests.

Before you begin

You need an account on the OpenAI API Platform. ChatGPT and the API are separate platform areas, so a ChatGPT plan does not automatically configure API billing or API keys.

Check that you can access the project where you want to create the key. Project members can create project-level keys, and organization readers can create keys in projects they belong to. Organization owners can create projects and view all projects, members, and API keys. If you cannot see a project or its API Keys controls, confirm that you selected the right project and belong to it.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

How to create an OpenAI API key

  1. Sign in to the API Platform. Go to platform.openai.com and sign in.

  2. Open the API Keys page. Go to platform.openai.com/api-keys. The page is labeled API Keys.

  3. Choose the project. If you have access to multiple projects, select the one associated with your application.

  4. Create a key. Open Organization settings, select the project, choose API Keys, and click + Create new secret key.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  5. Choose permissions. Select the least permissive option that supports your application:

    Rank #2
    Sale
    Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
    • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
    • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
    • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
    • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
    • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
    Permission What it means When to use it
    All Full permissions; this is the default. Only when the application needs broad access.
    Restricted Configure permissions for individual endpoints or resources, such as None, Read, or Write. When you want to limit the key to the operations it performs.
    Read Only Read permissions for all endpoints. Applications that retrieve information but do not create or modify resources.
  6. Copy and secure the secret immediately. Store the complete key in a password manager or another secure secrets store. OpenAI displays the full secret only when the key is created; you cannot retrieve it later.

What to do if you need a separate project

Projects separate API resources, access, and usage. If you are an organization owner and need a new project, hover over the project name in the upper-left project selector, choose Create project, enter the project information, and click Create. Only organization owners can create projects.

Every organization has a Default project, which cannot be deleted. Members and service accounts cannot be added directly to that project.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep the project choice consistent when configuring your application. Files, assistants, storage, threads, and other project resources are scoped to their project and cannot be moved between projects. A key created for one project does not automatically provide access to another project’s resources.

How to store the API key on macOS or Linux

Do not paste the secret into source code, a public repository, a client-side JavaScript bundle, or a support ticket. OpenAI SDKs can read the key from the OPENAI_API_KEY environment variable.

Rank #3
Sale
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

In a macOS or Linux terminal, set the variable for the current shell session:

export OPENAI_API_KEY=”your_api_key_here”

Replace your_api_key_here with the secret you copied. For a production application, use your hosting provider’s encrypted environment-variable or secrets-management facility rather than committing a file containing the key.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

After setting the variable, configure the OpenAI SDK for your programming language. The SDK can then read OPENAI_API_KEY without requiring the secret in application source code.

Set up API billing

Creating a key and paying for API usage are separate steps. New API accounts are enrolled in prepaid billing. To add credits, open the account’s billing overview and select Add payment details.

  • The minimum initial credit purchase is $5.
  • The default purchase amount is $10.
  • The maximum purchase depends on the account’s Trust Tier.
  • Purchased credits expire after one year and are non-refundable.
  • If free credits are available, they are used before purchased credits.
  • Purchased credits may take a few minutes to appear in the balance.

During prepaid-billing setup, auto-recharge is enabled by default, but you can turn it off before confirming the purchase. If enabled, configure the recharge amount, the balance threshold that triggers a recharge, and optionally a monthly recharge limit. The minimum auto-recharge amount is $5; the maximum depends on your Trust Tier. Manual credit purchases do not count toward the monthly auto-recharge limit.

Rank #4
Sale
UGREEN USB C Hub 5 in 1 Multiport USB Adapter 4K HDMI, 100W Power Delivery
  • 5 in 1 Connectivity: The USB C Multiport Adapter is equipped with a 4K HDMI port, a 100W USB C PD port, a 5 Gbps USB A data port, and two 480 Mbps USB A ports

Control spending at the project level

Project spending controls are under Organization settings → select project → Limits. A project’s monthly spend limit is a soft monitoring threshold unless you configure a hard limit. A soft limit does not stop requests when exceeded.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prepaid billing has separate failure behavior. If a payment fails during initial setup, credits are not deposited. If auto-recharge fails, OpenAI sends an email, and API usage stops when the account balance reaches $0. When available credits are consumed, requests can return a billing-quota error; use Add to balance in the billing portal to purchase more credits.

OpenAI notes that access may not stop immediately when credits are exhausted. This can produce a negative credit balance, which is deducted from the next credit purchase.

Creating a key for a non-human application

For a server, automated job, or other application identity, use a service account instead of a key tied to an individual employee where appropriate.

  1. Open Organization settings.

  2. Select the project.

  3. Open Members.

  4. Click + Service account.

  5. Click Create.

Only organization owners and project owners can create service accounts. The service-account key is generated immediately after creation, and its secret is shown only at that time. It is project-scoped and cannot be used outside that project.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
BENFEI USB C Hub 5-in-1 with 4K HDMI(Certified), 100W Power Delivery, 3 USB-A, Silicone Cable, Aluminum Case Compatible with MacBook Pro/Air, iPad Pro, iMac, iPhone 15 Pro/Pro Max, XPS, Thinkpad
  • Portable and powerful USB-C HUB: BENFEI USB Type-C HUB, with super-soft and knot-free silicone woven design cable, meets most mobile office needs. Compact, lightweight, stylish, and powerful portable USB C Hub equipped with 1 x HDMI port, 1 x 100W charging, and 3 x USB ports. 18-month warranty, 24-hour response, to ensure you feel at ease when using our product.
  • Design centered on comfort and reliability: Thanks to BENFEI's end-to-end in-house cable production capability, in-house PCBA and assembly capability, using the industry's most advanced silicone woven design and process, 20cm cable in length, no knots, super-soft, the HUB is easy to use in all scenarios: laptop, tablet, stand etc. Super-soft, 25000+ life cycles, to meet your daily carrying and office needs.
  • 100W Charging: Support up to 90W USB C pass-through charging via Type-C port to keep your laptop powered. 10W is reserved for other interface operations. No data and video function on the Type-C port.
  • 4K HDMI Display: The HDMI port supports media display at resolutions up to 4K 30Hz, keeping every incredible moment detailed and ultra vivid. Please note that the C port of the Host device needs to support video output.
  • Transfer Files in Seconds: Transfer files and from your laptop at speeds up to 10 Gbps with USB A 3.2 port. Extra 2 USB A 2.0 ports are perfectly for your keyboards and mouse.

Service-account creation does not show the same permission choices as a user-owned key. Its permissions initially default to read/write access to all project API resources. You can change them later in the project’s API Keys settings.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common API-key problems

Problem Likely cause or fix
You cannot find the key page Use the API Platform URL, platform.openai.com/api-keys, rather than ChatGPT settings.
The full key is gone It cannot be viewed again. Create a replacement key, update the application, and securely remove the old value wherever it was stored.
API Keys or key-creation controls are missing Confirm that you selected the correct project and belong to it. Organization readers can create keys in projects they belong to; organization owners can view all projects and keys.
A request returns an authorization error The key may be Restricted or Read Only while the endpoint requires write access. Adjust only the required resource permissions.
The key works in one project but not another Keys are scoped to the selected project. Create or use a key belonging to the project that owns the requested resource.
Requests fail with a billing or quota error Check the prepaid balance and use Add to balance to purchase additional credits if necessary.
The application still uses the wrong key Check the environment where the program runs. A terminal, local development environment, container, and production host may each have different secret values.

Security checklist

  • Never share an API key. OpenAI explicitly warns against sharing keys.
  • Keep keys on a server, not in browser code or a mobile app distributed to users.
  • Prefer a Restricted key when the application does not need full access.
  • Use separate projects or keys for unrelated applications where practical.
  • Rotate a key immediately if it may have been exposed.
  • If a key is lost, create a new one rather than trying to recover the original secret.
  • Review billing and project limits before deploying an automated workload.

Official references

FAQ

Is an OpenAI API key the same as a ChatGPT password or subscription?

No. ChatGPT and the OpenAI API are separate platform areas. Create and manage API keys at platform.openai.com/api-keys, and configure API billing separately.

Can I see my OpenAI API key again after creating it?

No. The complete secret is shown only at creation. If you lose it, create a replacement key and update your application.

Do I need to add a payment method to create an API key?

Key creation and billing setup are separate, but API use requires available billing credits. New API accounts use prepaid billing, with an initial purchase minimum of $5.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why can’t I create a project?

Only organization owners can create projects. If you are not an owner, ask an organization owner to create the project and add you to it.

What is the safest API-key permission setting?

Use Restricted and enable only the resources and operations the application needs. Read Only is suitable for applications that never need write access.

Should I use a service-account key?

A service-account key is appropriate for a non-human application identity such as an automated server or job. It is project-scoped and can be created by organization owners or project owners.

The Bottom Line

Create the key at platform.openai.com/api-keys, select the correct project, choose the narrowest workable permissions, and copy the secret into secure storage immediately. Then configure OPENAI_API_KEY and add prepaid billing credits before sending API requests.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.