Add OpenAI API usage

This commit is contained in:
SillyLossy
2023-04-23 18:48:46 +03:00
parent f41d853d72
commit 388d982040
3 changed files with 27 additions and 2 deletions

View File

@@ -2176,7 +2176,7 @@ app.post("/getstatus_openai", jsonParser, function (request, response_getstatus_
});
// Shamelessly stolen from Agnai
app.post("/openai_usage", jsonParser, async function (_, response) {
app.post("/openai_usage", jsonParser, async function (request, response) {
if (!request.body) return response.sendStatus(400);
const key = request.body.key;
const api_url = new URL(request.body.reverse_proxy || api_openai).toString();