Open-source project
openai/openai-cookbook avatar
openai/openai-cookbook

The OpenAI Cookbook is 131 words of README wrapped around a registry of notebooks

GitHub describes it as Examples and guides for using the OpenAI API. The repository metadata lists Jupyter Notebook as its primary language. The metadata lists the MIT license. This article stays within the project description and details documented in the GitHub repository README.

76,264 stars12,896 forksJupyter NotebookMIT

At a glance

What is it?
A MIT licensed collection of notebooks for the OpenAI API with no releases, no tags and no table of contents in the repository. Everything runs against a live API key, and the filenames are the only index. The site at cookbook.openai.com is the real front door.
Who is it for?
Use the OpenAI Cookbook when you want a working starting point for one specific task, such as function calling against an OpenAPI spec or clustering embeddings for transaction classification, and you are willing to read the notebook before running it. Do not treat it as a library or a pinned reference, because there are no releases, no tags and no version manifest, so a notebook that names a particular model or API shape will rot without telling you.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly Jupyter Notebook, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

OPENAI_API_KEY or a .env file, and nothing in the tree runs without it

The whole credential story is two sentences in the README and there is no third option. You need an OpenAI account and an associated API key, you set an environment variable called `OPENAI_API_KEY`, or, in most IDEs such as Visual Studio Code, you put a file at the root of your own repo containing this:

code
OPENAI_API_KEY=<your API key>

The notebooks pick that file up. What neither sentence addresses is cost or failure, and the consequence is that cloning this repository gives you a directory of programs that will each make billable network calls the moment you run them top to bottom. Several of the filenames describe work that is expensive by nature, including `Embedding_Wikipedia_articles_for_search.ipynb` and `Embedding_long_inputs.ipynb`, and the fine-tuning notebooks do not stop at a prompt. A reader who runs a notebook to see what it does is running a training job or a large embedding sweep, so the practical first step is to read the notebook and run it cell by cell rather than with Run All.

No releases and no tags, so nothing pins the API version a notebook was written against

The repository has no GitHub releases at all, and there is no version file in the tree either. The only freshness signal is the last push, which was 2026-09-29. That matters more here than in most code repositories, because a cookbook entry is a snapshot of somebody's request against a particular API shape at a particular time, and the repository gives you no way to tell which shape that was. The filenames show the exposure. `Build_a_coding_agent_with_GPT-5.1.ipynb` names one model generation outright. `Creating_slides_with_Assistants_API_and_DALL-E3.ipynb` names an image model. `Assistants_API_overview_python.ipynb` is named after an API surface rather than a task, which is the kind of entry that changes shape under you. The consequence for a reader is that staleness is silent: a notebook keeps opening, keeps running and keeps returning plausible output long after the endpoint it targets has moved, and nothing in the repository raises a flag when that has happened.

registry.yaml, authors.yaml and articles/ make this an index, not a pile of notebooks

The top-level tree is what tells you what kind of project this is: `.codex/`, `.github/`, `.gitignore`, `AGENTS.md`, `CONTRIBUTING.md`, `LICENSE`, `README.md`, `articles/`, `authors.yaml`, `examples/`, `images/` and `registry.yaml`. Three of those files are metadata rather than content. `registry.yaml` is an index of what exists, `authors.yaml` records who wrote it, and `articles/` holds prose that is not a notebook. So the repository is structured as publishable content with machine-readable bookkeeping attached, and that is the reason the README can be short. It is also the reason the README's first line is a pointer: navigate at cookbook.openai.com. The practical consequence for anyone working offline or in an air-gapped environment is that the registry is the index, not the README, and if you are consuming this repository programmatically the `articles/`, `authors.yaml` and `registry.yaml` trio is where the structure lives rather than any single document.

The examples are grouped by task, so the filenames are the only table of contents

There is no index page in the repository and no category directory. The grouping exists only in the filenames under `examples/`, and reading them is the fastest way to understand the coverage. Embeddings get the largest cluster, with `Classification_using_embeddings.ipynb`, `Clustering.ipynb`, `Clustering_for_transaction_classification.ipynb`, `Code_search_using_embeddings.ipynb`, `Customizing_embeddings.ipynb` and `Embedding_long_inputs.ipynb` among them. Fine-tuning gets its own group, including `Chat_finetuning_data_prep.ipynb`, `Fine_tuning_for_function_calling.ipynb`, `Fine_tuning_direct_preference_optimization_guide.ipynb` and `Fine-tuned_classification.ipynb`. Function calling appears three times, once for a concrete task in `Function_calling_finding_nearby_places.ipynb` and once for a whole specification in `Function_calling_with_an_OpenAPI_spec.ipynb`. Realtime work has two. The consequence is that finding the entry for a task you care about means guessing at a filename, and the differences that matter most, such as a specific model generation or a deprecated API shape, are encoded in that guess rather than announced anywhere.

Most examples are Python, and the transfer to other languages is left to you

One sentence covers the language question: most code examples are written in Python, though the concepts can be applied in any language. The repository records Jupyter Notebook as its primary language, and the tree contains no JavaScript, Go, Rust, Java or C# directory. The second sentence is a promise the repository does not keep in any form, and there is nothing wrong with that, but it does move work onto the reader. If your stack is not Python, a notebook gives you the request shape, the parameter names and the order of operations, and you rewrite the transport yourself. That matters most for the entries that depend on Python-specific conveniences, such as `Data_extraction_transformation.ipynb` and `Data-intensive-Realtime-apps.ipynb`, where the parsing and streaming behaviour is part of the lesson. The consequence is that the cookbook is most valuable to a Python reader and degrades into a specification document for everyone else, and the repository has no marker to tell you in advance which notebooks will survive the port.

AGENTS.md and .codex/ mean the repository is written to be read by a model too

Two entries in the top-level tree are unusual for a documentation repository. `AGENTS.md` is a file written for coding agents, and `.codex/` is a configuration directory for the same purpose. Alongside `CONTRIBUTING.md` and `.github/`, that means this repository carries instructions for three different audiences: a person cloning it, a person contributing to it, and an automated agent operating inside it. The consequence for a reader is that there is a file to read before the notebooks, and it is not the README. If you are about to hand this repository to an agent and let it modify examples, that agent is going to read `AGENTS.md` and act on it, so the rules for changing a notebook are written down somewhere you have not read yet. The other consequence is about scale: a tree with a registry file and agent instructions is built to grow without a human editing an index by hand, which is consistent with a site that presents the same content at cookbook.openai.com.

The README is 131 words and its first instruction is to leave the repository

Count what is actually in the README. A logo, a one-line pointer telling you to navigate at cookbook.openai.com, a paragraph about needing an account and an API key and setting `OPENAI_API_KEY`, one sentence about `.env` files, one sentence about Python, a link to related resources from around the web, and the words MIT License. Everything else, including what the collection covers and how the entries relate to each other, is on the site. This is a deliberate division of labour, and it has a cost that shows up in two places. Offline, the repository gives you a directory of notebooks with no index and no stated order of study, so you are reading filenames and guessing. And in a review, a change to a notebook is hard to assess, because the prose that would explain why the example looks the way it does may live on the site rather than next to the code. The MIT license is the one thing the repository states completely, in full, with nothing deferred.

Editorial conclusion

Use the OpenAI Cookbook when you want a working starting point for one specific task, such as function calling against an OpenAPI spec or clustering embeddings for transaction classification, and you are willing to read the notebook before running it. Do not treat it as a library or a pinned reference, because there are no releases, no tags and no version manifest, so a notebook that names a particular model or API shape will rot without telling you. Before you rely on anything here, check the last commit date against the API version you are on, and expect to supply your own key and your own judgement about cost, since every cell that calls the API is a billable request and the notebooks run them by default.

Frequently asked questions

What is the OpenAI Cookbook?

It is the openai/openai-cookbook repository, a MIT licensed set of example code and guides for common tasks with the OpenAI API, published as Jupyter notebooks under an examples/ directory with an articles/ directory alongside it. The project describes itself as examples and guides for using the OpenAI API and points to cookbook.openai.com for navigation.

How do I use the OpenAI Cookbook?

You need an OpenAI account and an associated API key, then either set an environment variable called OPENAI_API_KEY or create an .env file at the root of your repo containing OPENAI_API_KEY with your key, which the notebooks pick up. The examples are on the site at cookbook.openai.com and in the examples/ directory of the repository.

Do the OpenAI Cookbook notebooks need an API key to run?

Yes. The repository states that running the examples requires an OpenAI account and an associated API key, and it has no offline or mocked mode, so the cells that call the API are billable requests. The repository also has no GitHub releases, so nothing in it pins which API version a given notebook was written against.

Does the OpenAI Cookbook have examples in languages other than Python?

Not in the repository. The primary language is recorded as Jupyter Notebook and the top-level tree holds no JavaScript, Go, Rust, Java or C# directory. The README says most code examples are written in Python though the concepts can be applied in any language, which leaves the porting to the reader.

Official sources

  1. Official documentation
  2. Official README
  3. Project repository
For maintainers

Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/openai-openai-cookbook.svg)](https://hysenlabs.com/projects/openai-openai-cookbook)
Community notes

Community notes