#How to get API keys
1 messages · Page 1 of 1 (latest)
Hi @summer siren. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
To get an OpenAI API key:
-
Go to the API key page on the OpenAI platform.
-
Click on "Create new secret key" to generate a new API key.
-
Save your API key in a secure location. You will not be able to view it again after you close the dialog.
-
For best security, store your API key as an environment variable (e.g., in your terminal or a configuration file):
- On macOS/Linux:
export OPENAI_API_KEY="your_api_key_here" - On Windows (PowerShell):
setx OPENAI_API_KEY "your_api_key_here"
- On macOS/Linux:
You can manage and view your existing API keys on the same API key management page. Remember, do not share your API key with anyone or expose it in client-side code. For more details, see the official documentation on API key creation and safety and authentication.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@summer siren Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@modern mulch How to get api keys for free
Let me check the knowledge base for you again. One moment! :books:
To get an OpenAI API key, you need to create an OpenAI account and generate the key from the API platform. You can create a free account here. After signing up, visit the API key page to generate your key.
However, please note that while creating an account and generating an API key is free, using the API itself is not always free—usage is typically billed according to OpenAI’s pricing. Some users may receive free trial credits, but this is not guaranteed for all new accounts and may not be available in all regions or at all times. If you do not see free credits in your billing section, you will need to add a payment method and purchase prepaid credit to use the API Free Trial Invites FAQ Forum Post: Unable to Use API Key – Free Trial and the Credit Not Working.
In summary:
- You can generate an API key for free by signing up, but actual API usage may require payment unless you have received free trial credits, which are not guaranteed for every user.