How to get an OpenAI API key for ChatGPT
The biggest mistake people make when trying to get their ChatGPT API key is that they use the wrong URL.
The key can't be found at chatgpt.com. Instead, point your browser to the OpenAI developer platform. With the correct URL in hand, generating an OpenAI key so you can programmatically access ChatGPT becomes a whole lot easier.
How to get a ChatGPT API key
With the correct URL at your disposal, follow these steps to get an OpenAI API key so that applications can programmatically connect to ChatGPT models:
- Navigate to platform.openai.com.
- Click on the Dashboard link.
- Click on the API keys link.
- Click on the Create new secret key link.
- Provide a name for the key and select Create secret key.
- Copy and save the alphanumeric API key.
- Click Done.

How to use the ChatGPT API key
There are generally two ways to use an OpenAI key:
- The key is entered into the settings page of a software program that accesses OpenAI for you.
- The key is used programmatically and OpenAI queries are initiated from Python, JavaScript or Java code.
However, regardless of how your key gets used, you need to purchase token credits before it becomes functional. While ChatGPT can be queried extensively through the browser, to access the API tokens must first be purchased.

The cost of ChatGPT
For a casual user, $20 worth of tokens is more than enough to test the API or casually use an OpenAI-enabled software product for several months. It's a small investment that could open a world of AI-powered opportunities for you and your organization.
Cameron McKenzie has been a Java EE software engineer for 20 years. His current specialties include Agile development; DevOps; Spring; and container-based technologies such as Docker, Swarm and Kubernetes.