openai/openai-cookbook
Examples and guides for using the OpenAI API
What it is
Example code and guides for accomplishing common tasks with the OpenAI API. To run these examples, you'll need an OpenAI account and associated API key (create a free account here). Set an environment variable called OPENAIAPIKEY with your API key. Alternatively, in most IDEs such as Visual Studio Code, you can create an .env file at the root of your repo containing OPENAIAPIKEY= , which will be picked up by the notebooks.
When to use it
Reach for openai-cookbook when you want to learn a topic, find more tools, or borrow battle-tested prompts and examples — it's written in Jupyter Notebook and fits stacks tagged chatgpt, gpt-4, openai, openai-api.