OpenAI Cookbook is a repository of example code and guides for developers building applications with the OpenAI API. It is aimed at people who already have, or are creating, an OpenAI account and API key and want working examples rather than starting from the API reference alone.
A developer sets an OPENAI_API_KEY environment variable, or adds it to a local .env file that is picked up automatically in editors such as Visual Studio Code, and then runs the provided example notebooks. Most examples are written in Python, though the underlying concepts can be applied in any language.
The repository is organized into articles and runnable examples covering common tasks for the OpenAI API, and is browsable through a dedicated site, cookbook.openai.com, as well as directly on GitHub. It also links out to related tools, guides, and courses from across the web for further learning.
OpenAI Cookbook is open source under the MIT license, with more than 76.9k GitHub stars and 13.0k forks. Using the examples requires an OpenAI account and an associated API key, which can be created for free.