Open AI error Key not found

You can add the read environment variable, it will work. :slight_smile:

import openai
from dotenv import load_dotenv # Add

load_dotenv() # Add

openai.api_key = os.getenv("OPENAI_API_KEY")
3 Likes