forked from XiaoMo/ChatGPT-Next-Web
Update common.ts
Add OrgID
This commit is contained in:
parent
beb04d8181
commit
21da781350
@ -18,10 +18,15 @@ export async function requestOpenai(req: NextRequest) {
|
||||
console.log("[Proxy] ", openaiPath);
|
||||
console.log("[Base Url]", baseUrl);
|
||||
|
||||
if (process.env.OPENAI_ORG_ID) {
|
||||
console.log("[Org ID]", process.env.OPENAI_ORG_ID);
|
||||
}
|
||||
|
||||
return fetch(`${baseUrl}/${openaiPath}`, {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Authorization: `Bearer ${apiKey}`,
|
||||
...(process.env.OPENAI_ORG_ID && { "OpenAI-Organization": process.env.OPENAI_ORG_ID }),
|
||||
},
|
||||
method: req.method,
|
||||
body: req.body,
|
||||
|
Loading…
x
Reference in New Issue
Block a user