A simple API endpoint that anwsers your prompt using OpenAI's GPT-3
- The
serverless
CLI installed. - You need to create an API key from OpenAI and set it as the value of
OPENAI_API_TOKEN
environment variable. - You need to set up credentials for AWS. Follow this tutorial to know how to configure it.
make deploy
curl -X POST <your-http-api-url>/ask \
-H "Content-Type: application/json" \
-d '{"prompt": "say this is a test"}'
# Response
{"answer": "This is a test."}