0

I am trying to use the openai package in R. I have used the Sys.setenv function and filled in the prompt. Although I have entered the API key in the code, this error still comes up:

Error: OpenAI API request failed [401]:

You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY), or as the password field (with blank username) if you're accessing the API from your browser and are prompted for a username and password. You can obtain an API key from https://beta.openai.com.

enter image description here

I tried putting bearer API_KEY in quotes and taken the quotes out.

Rubén
  • 34,714
  • 9
  • 70
  • 166

0 Answers0