GPTstudio in R not Working or Acknowledging the API Key

Trying to use GPTstudio in R-studio and I’m getting the following error, despite having an API key set:

Listening on http://127.0.0.1:4370
! OPENAI_API_KEY is not valid.
ℹ Generate a key at <https://platform.openai.com/account/api-keys>
ℹ Set the key in your .Renviron file usethis::edit_r_environ()
Warning: Error in purrr::map_chr: ℹ In index: 1.
Caused by error:
! Result must be length 1, not 0.

How do you use ChatGPT in our studio? I tried it and it’s not working for me.