mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 16:23:41 +08:00 
			
		
		
		
	Update common.ts
Add OrgID
This commit is contained in:
		@@ -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,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user