Allow specifying OpenAI-Organization header: (#313)
See https://platform.openai.com/docs/api-reference/introduction > For users who belong to multiple organizations, you can pass a header > to specify which organization is used for an API request. Usage from > these API requests will count against the specified organization's > subscription quota.
This commit is contained in:
@@ -17,6 +17,9 @@ export const OpenAIStream = async (
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${key ? key : process.env.OPENAI_API_KEY}`,
|
||||
...(process.env.OPENAI_ORGANIZATION && {
|
||||
'OpenAI-Organization': process.env.OPENAI_ORGANIZATION,
|
||||
})
|
||||
},
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
|
||||
Reference in New Issue
Block a user