Back to directory

OpenAI Cookbook

Example code and guides, mostly in Python, that show how to accomplish common tasks with the OpenAI API.

OpenAI Cookbook

OpenAI Cookbook is a collection of example code and guides for accomplishing common tasks with the OpenAI API. Running the examples requires an OpenAI account and an API key, set as the OPENAI_API_KEY environment variable or placed in a .env file that many IDEs, including Visual Studio Code, will pick up automatically for the accompanying notebooks.

Most of the examples are written in Python, though the underlying concepts can be applied in other languages. The project also links out to other tools, guides and courses from across the web for readers who want material beyond what is in the repository itself. It is released under the MIT license and primarily distributed as Jupyter notebooks, with a companion website for browsing the examples.

More in Tutorials

See all 478
  • BootLife

    github.com

    Conway's Game of Life implemented to run directly from a 512-byte x86 boot sector in assembly, using VGA memory itself as the simulation grid.

  • A technical blog post deriving the Y combinator as a composition of combinator birds in an array language, and examining how eager evaluation changes fixed-point recursion compared with the usual lazy telling.

  • System Design Atlas

    atlas-sysdes.vercel.app

    A free reference of worked system design problems with interactive architecture diagrams, covering ranked designs such as a feed, a chat app, a URL shortener, and a rate limiter, plus pages on the technologies behind them.