Extend configuration to accept OpenAI organization and project

Resolved 💬 4 comments Opened Apr 16, 2025 by shirhatti Closed Apr 25, 2025

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 ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗