Raw capture โ€” raw/openai-cookbook.md


url: https://developers.openai.com/cookbook title: OpenAI Cookbook author: OpenAI date_fetched: 2026-07-25 date_published: unknown


OpenAI Cookbook

The OpenAI Cookbook is a collection of example code and guides for accomplishing common tasks with the OpenAI API. It is maintained by OpenAI and available both as a website (developers.openai.com/cookbook) and as an open-source GitHub repository (github.com/openai/openai-cookbook) under the MIT License.

Most code examples are written in Python, though the concepts can be applied in any language. Users need an OpenAI account and API key to run the examples.

Topic Categories

The cookbook organizes content across nine topical areas:

  1. Agents โ€” /cookbook/topic/agents
  2. Evals โ€” /cookbook/topic/evals
  3. Multimodal โ€” /cookbook/topic/multimodal
  4. Text โ€” /cookbook/topic/text
  5. Guardrails โ€” /cookbook/topic/guardrails
  6. Optimization โ€” /cookbook/topic/optimization
  7. ChatGPT โ€” /cookbook/topic/chatgpt
  8. Codex โ€” /cookbook/topic/codex
  9. gpt-oss โ€” /cookbook/topic/gpt-oss

Repository Structure

The GitHub repository (github.com/openai/openai-cookbook) contains: - examples/ โ€” Primary example code and notebooks - articles/ โ€” Written guides and explanations - images/ โ€” Visual assets - AGENTS.md, CONTRIBUTING.md, LICENSE, README.md, authors.yaml, registry.yaml โ€” Standard repository metadata

Related Resources

The cookbook page also links to OpenAI's developer blog, showcase, and community resources. The site includes an API documentation sidebar covering the full OpenAI platform: Responses API, streaming, WebSocket, multi-agent, MCP and Connectors, tools (function calling, web search, file search, code interpreter, computer use), voice agents, realtime transcription, and more.

Note: The individual recipe/notebook listing was truncated in the page fetch. The full recipe index is available at the live URL.