No API KEY provided

I am trying to fine tune a model. I am in the following line:

openai api fine_tunes.create -t <TRAIN_FILE_ID_OR_PATH> -m <BASE_MODEL>

When I try to run it, I get the following message:

No API key provided. You can set your API key in code using 'openai.api_key = ', or you can set the environment variable OPENAI_API_KEY=). If your API key is stored in a file, you can point the openai module at it with 'openai.api_key_path = '. You can generate API keys in the OpenAI web interface.

I am using Replit, which stores the API key in “Secrets”.

How do I provide the API key?

1 Like

Hi @mp ,

You’ll have to use the environment variable for that. More info here