forked from XiaoMo/ChatGPT-Next-Web
Merge pull request #933 from yinm0591/main
Added support for organization ID
This commit is contained in:
commit
b2c711a5e8
@ -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…
Reference in New Issue
Block a user