#Getting Post 401 error when trying to make an API call.

7 messages · Page 1 of 1 (latest)

tough condor
gusty oar
tough condor
gusty oar
#

Yeah, you need to set the API key and etc, that link is the link for the actual API endpoint

tough condor
#

I've created a new api key and loaded it into my .env file. I then pass this into the fetch: fetch(https://api.openai.com/v1/completions, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': Bearer ${process.env.API_KEY},

gusty oar