# OpenAI Cookbook

> Open-source collection of example code and guides for building with the OpenAI API.

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.

## 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

## Integrations
OpenAI API, OpenAI Agents SDK, Codex, Amazon Bedrock, Ollama, Hugging Face Transformers, Slack, Databricks, Daytona

## Platforms
LINUX, ANDROID, IOS, WEB, API, CLI

## Pricing
Open Source

## Links
- Website: https://cookbook.openai.com
- Documentation: https://cookbook.openai.com
- Repository: https://github.com/openai/openai-cookbook
- EveryDev.ai: https://www.everydev.ai/tools/openai-cookbook
