Rejected authorization due to no access to organization

I just ran into this error and in our case, it was because the user who created the API key had been removed from our OpenAI organisation when they left the company, but the key was clearly still associated with their account rather than the organisation, as far as the API was concerned (which makes sense). The solution was simply to create a new key.