OpenAI Cookbook
Open-source collection of example code and guides for building with the OpenAI API.
At a Glance
About OpenAI Cookbook
The OpenAI Cookbook is a repository and website from OpenAI containing example code and guides for accomplishing common tasks with the OpenAI API. Most examples are written in Python as Jupyter notebooks, though the README notes the concepts can be applied in any language. The content is browsable at cookbook.openai.com and is released under the MIT License.
What It Is
The Cookbook is a library of worked examples and articles for developers building with OpenAI models and tools. Running the examples requires an OpenAI account and an API key, set as the OPENAI_API_KEY environment variable or placed in an .env file that the notebooks pick up.
What the Cookbook Covers
The site organizes entries by topic and by source (OpenAI or community). Listed topics include Agents, Agents API, Agents SDK, Evals, Multimodal, Text, Guardrails, Optimization, ChatGPT, Codex, Sign-in with ChatGPT and gpt-oss. Recent entries include building agents with the Agents API and Agents SDK, evaluation guides for audio and image use cases, Codex workflow guides, context engineering and agent memory, and running or fine-tuning gpt-oss models.
How to Use It
Readers can search or filter entries by topic, then open an article or notebook and follow it step by step. The repository is open for contributions through GitHub, and the site links to related resources from around the web.
Community Discussions
Be the first to start a conversation about OpenAI Cookbook
Share your experience with OpenAI Cookbook, ask questions, or help others learn from your insights.
Pricing
Open Source (MIT)
OpenAI Cookbook repository of example code and guides, released under the MIT License. Running the examples requires an OpenAI API key, which is billed separately.
- MIT License covers the cookbook repository (code and guides)
- Permission to use, copy, modify, merge, publish, distribute, sublicense and sell copies
- Running the examples requires an OpenAI account and API key; API usage costs are external
Capabilities
Key Features
- Example code and guides for common OpenAI API tasks
- Jupyter notebook examples, mostly in Python
- Topic filters including Agents, Evals, Multimodal, Guardrails, Codex and gpt-oss
- Search across cookbook entries
- Guides for the Agents API and Agents SDK
- Evaluation guides for audio, image and agent systems
- Partner and community-contributed examples
- MIT-licensed and open to contributions
