go-openai icon indicating copy to clipboard operation
go-openai copied to clipboard

Fix the example usage

Open dsha256 opened this issue 2 years ago • 1 comments

I'm trying to get started with the example from the readme file. I'm pretty sure that I'm providing the correct API key but it gives me the following error:

2023/01/12 02:32:32 error, status code: 401
exit status 1

The command below with the same API key gives me the status 200 OK.

curl https://api.openai.com/v1/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"model": "text-davinci-003", "prompt": "Say this is a test", "temperature": 0, "max_tokens": 7}'

dsha256 avatar Jan 11 '23 22:01 dsha256

@dsha256 Hey, can you please try go get -u github.com/sashabaranov/go-gpt3? I've just tested the example from README, and it works fine.

sashabaranov avatar Jan 12 '23 08:01 sashabaranov