go-openai
go-openai copied to clipboard
Fix the example usage
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 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.