Skip to content

The OpenAI-Project header can be specified - #151

Open
Benjaminhu wants to merge 1 commit into
orhanerday:mainfrom
Benjaminhu:main
Open

The OpenAI-Project header can be specified#151
Benjaminhu wants to merge 1 commit into
orhanerday:mainfrom
Benjaminhu:main

Conversation

@Benjaminhu

Copy link
Copy Markdown

Documentation: https://platform.openai.com/docs/api-reference/organizations-and-projects-optional

curl https://api.openai.com/v1/models \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "OpenAI-Organization: org-lEOCXdqO48RKaa66ZdhPseo7" \
  -H "OpenAI-Project: $PROJECT_ID"
    ^^^^^^^^^^^^^^^^^^

If we are working on several projects, you can specify which of the given requests belong to:

$open_ai_key = getenv('OPENAI_API_KEY');
$open_ai = new OpenAi($open_ai_key);
$open_ai->setProject('<YOUR-PROJECT-ID>'); // `proj_XXX`

@Benjaminhu

Copy link
Copy Markdown
Author

@orhanerday What is needed to merge this small but useful feature?

@Benjaminhu
Benjaminhu marked this pull request as draft February 28, 2026 11:23
@Benjaminhu
Benjaminhu marked this pull request as ready for review February 28, 2026 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant