$ git clone [email protected]:yingjil/MyAPI4ChatGPT.git
If you don't have US AWS account, please register one via https://aws.amazon.com/. If you have US AWS account, but don't know your keys, please refer to (https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/getting-your-credentials.html)
$ export AWS_ACCESS_KEY_ID=<your aws account key, e.g.: AKIAU53GUXQ62MUDWKF4>
$ export AWS_SECRET_ACCESS_KEY=<your aws account key, e.g.: WxcqoLjBtutydA1OIInJ/mKe7WmcNt5JYF3oKasP>
$ export OPENAI_API_KEY=<your open ai key, e.g.: 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>
$ cd MyAPI4ChatGPT
$ npm install -g aws-cdk
$ pip install aws-cdk-lib
$ cdk deploy
Answer 'y' to below question:
...
Do you wish to deploy these changes (y/n)? y
Find the API URL in the end of the output of 'cdk deploy':
...
Outputs:
MyStack.ApiHostUrl = <your api prefix>.execute-api.us-west-2.amazonaws.com
MyStack.myapiEndpointF52D9E64 = https://<your api prefix>.execute-api.us-west-2.amazonaws.com/prod/
...
✨ Total time: 96.34s
$ curl -X POST https://<your api prefix>.execute-api.us-west-2.amazonaws.com/prod/ -H 'content-type: application/json' --data '{"prompt":"Hello"}'
Hi there! How can I assist you today?
email: [email protected]