The API is not free, and OpenAI is no longer giving free trial credits.
The issue can be resolved by proceeding to settings->billing in your platform.openai.com account, choosing “add payment method”, and continuing through to purchasing a prepayment credit.