Spaces:
Paused
Paused
djmuted
commited on
Commit
•
d48d794
1
Parent(s):
fcf1985
Validate API key
Browse files- src/openai.js +1 -1
src/openai.js
CHANGED
@@ -30,7 +30,7 @@ openaiRouter.get("/models", (req, res) => {
|
|
30 |
|
31 |
openaiRouter.post("/chat/completions", jsonParser, async (req, res) => {
|
32 |
try {
|
33 |
-
if (req.token !== config.
|
34 |
res.status(401).json({ error: "Unauthorized" });
|
35 |
return;
|
36 |
}
|
|
|
30 |
|
31 |
openaiRouter.post("/chat/completions", jsonParser, async (req, res) => {
|
32 |
try {
|
33 |
+
if (req.token !== config.API_KEY) {
|
34 |
res.status(401).json({ error: "Unauthorized" });
|
35 |
return;
|
36 |
}
|