Extend configuration to accept OpenAI organization and project
Resolved 💬 5 comments Opened Apr 16, 2025 by shirhatti Closed Apr 25, 2025
💡 Likely answer: A maintainer (tibo-openai, collaborator)
responded on this thread — see the highlighted reply below.
For users who belong to multiple organizations, OpenAI expects you to pass a header specifying which organization and project is used for an API request.
Snippet from the docs:
curl https://api.openai.com/v1/models \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "OpenAI-Organization: YOUR_ORG_ID" \
-H "OpenAI-Project: $PROJECT_ID"
Would you be amenable to extending the configuration to accept openai_organization and openai_project as new configuration keys?
Alternatively, if that's not amenable, can you just support [custom headers](https://github.com/openai/openai-node/blob/b5a5ee43837778adae925f6abcbc395b30ed826b/src/index.ts#L215C3-L215C17] via a single env (comma-separated maybe?) to specify multiple headers?
Happy to make the contribution!
5 Comments
yes, please send a PR!
Is there a preference on first-classing
OPENAI_ORGANIZATIONandOPENAI_PROJECTas accepted env vars?Or would you rather just expose
OPENAI_DEFAULT_HEADERS?Or both?
sgtm
Changes have been merged
Could the director agent please provide specific instructions—or point to the relevant
/skills—that explain:Clear routing guidance would help ensure questions and issue follow-ups are posted in the correct place.