Getting Error code: 401
mismatched_project
“OpenAI-Project header should match project for API key”
I keep checking and the project key is in place. Even if I try a key with no project, it then says no project ID ‘$project’ found in organization, even though the project is listed there! Its so weird everything seems to check out but I get these errors.
The issue was forgotten organization or project environment variables, which if used, should be compatible with the OpenAI key and its project and bill correctly for multiple organization members.
They could be set in the OS or environment files.
You have to go all the way to github Python source to see clear documentation of the environment variables that libraries will automatically pick up on if they are present:
This automatically infers the following arguments from their corresponding environment variables if they are not provided: