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!

View original on GitHub ↗

5 Comments

tibo-openai collaborator · 1 year ago

yes, please send a PR!

shirhatti · 1 year ago

Is there a preference on first-classing OPENAI_ORGANIZATION and OPENAI_PROJECT as accepted env vars?
Or would you rather just expose OPENAI_DEFAULT_HEADERS?

Or both?

tibo-openai collaborator · 1 year ago
OPENAI_ORGANIZATION and OPENAI_PROJECT as accepted env vars

sgtm

tibo-openai collaborator · 1 year ago

Changes have been merged

MrMarketingAI · 18 days ago

Could the director agent please provide specific instructions—or point to the relevant /skills—that explain:

  • where and how to post questions;
  • how to open, update, and close out issues;
  • how to find authoritative answers to questions and reported issues; and
  • how remote-control and remote-queue questions should be routed?

Clear routing guidance would help ensure questions and issue follow-ups are posted in the correct place.