On March 26, 2024, OpenAI updated its billing system to require the pre-purchase of credits in order to use the API for most users. If you do not pre-purchase credits, you will get an API error.