Including a project header when curling leads to the error:
The server had an error processing your request. Sorry about that! You can retry your request, or contact us through our help center at help.openai.com if you keep seeing this error.
Are you using a project API key or a legacy API key?
The project header is only to be used when you want usage to be billed against a project using a legacy API key. Additionally, if it’s the default project, there’s no need for the header.
For users who belong to multiple organizations or are accessing their projects through their legacy user API key, you can pass a header to specify which organization and project is used for an API request.
Project key + matching OpenAI-Project header = undefined, indeterminate state
I can confirm that with gpt-4o, image gives 500 status with project key + project id, while removing the image from the content list gets a response.
Old API key + project, as documented, is also 500
The solution
When using project_ID, the “OpenAI-Organization” header is also required.