Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kang-theo/chatgpt-api-proxy
A proxy of OpenAI API based on node.
https://github.com/kang-theo/chatgpt-api-proxy
Last synced: 3 days ago
JSON representation
A proxy of OpenAI API based on node.
- Host: GitHub
- URL: https://github.com/kang-theo/chatgpt-api-proxy
- Owner: kang-theo
- License: mit
- Created: 2024-06-25T01:46:24.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-07-05T03:11:36.000Z (6 months ago)
- Last Synced: 2024-11-13T15:55:44.502Z (2 months ago)
- Language: JavaScript
- Size: 326 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# chatgpt-api-proxy
A proxy of OpenAI API based on node.
## Run
`.env.example` -> `.env`
```bash
npm install# development
npm run dev# production
npm run prod
npx pm2 list
npx pm2 restart
npx pm2 stop
npx pm2 delete
```## Test
Using Postman.
Server-send Event does not support POST very well, so send GET instead.
- Send a GET request to the route `/api/gpt/chat`
- Set `option`: `{"messages": [ { "role": "user", "content": "How are you?" } ]}`
- Add a header `x-auth-token: xxx` ,defined in `.env````bash
$ip:$port/api/gpt/chat?x-auth-token=xxx&option={"messages": [ { "role": "user", "content": "How are you?" } ]}
```## Deploy
- Submitting deploy branch to GitHub will trigger the deployment of "gpt-api-proxy" to AWS EC2 (ci.yml).
- Set the environment variables in `.env`