- Create an Account: Register for an account on OpenAI's website (https://openai.com/). Then, go to OpenAI's API website (https://platform.openai.com/).
- Generate API Key: Once logged in, navigate to the left dashboard and go for "API keys". To create a new secret key, select "Create new secret key" and follow the instructions to create a new key.
- Storing API Key: Store your API key in a local dot env file
.env:
OPENAI_API_KEY=your_actual_openai_api_key_here
A sample of the .env file can be found in .env_example.
Never commit the API key to your source code.
Use your favourite package installer like conda or pip to install the following packages:
- OpenAI
- Ollama
- Dotenv
- Langchain
- Langchain OpenAI
- Langchain Ollama