How to Generate and Store Charts Using OpenAI API

I’m looking to generate charts using the OpenAI API then save them for later use.
What steps should I follow to achieve this? Thanks!