Skip to content

Examples and guides for using the OpenAI API

Document pre-PR checks for new Cookbooks (#3266)

Konstantine Kahadze500df203bbf5
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index f87ec94d..d0c990e3 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -10,15 +10,5 @@ Why are these changes necessary? How do they improve the cookbook?
## For new content
-When contributing new content, read through our [contribution guidelines](https://github.com/openai/openai-cookbook/blob/main/CONTRIBUTING.md), and mark the following action items as completed:
-
-- [ ] I have added a new entry in [registry.yaml](https://github.com/openai/openai-cookbook/blob/main/registry.yaml) (and, optionally, in [authors.yaml](https://github.com/openai/openai-cookbook/blob/main/authors.yaml)) so that my content renders on the cookbook website.
-- [ ] I have conducted a self-review of my content based on the [contribution guidelines](https://github.com/openai/openai-cookbook/blob/main/CONTRIBUTING.md#rubric):
- - [ ] Relevance: This content is related to building with OpenAI technologies and is useful to others.
- - [ ] Uniqueness: I have searched for related examples in the OpenAI Cookbook, and verified that my content offers new insights or unique information compared to existing documentation.
- - [ ] Spelling and Grammar: I have checked for spelling or grammatical mistakes.
- - [ ] Clarity: I have done a final read-through and verified that my submission is well-organized and easy to understand.
- - [ ] Correctness: The information I include is correct and all of my code executes successfully.
- - [ ] Completeness: I have explained everything fully, including all necessary references and citations.
-
-We will rate each of these areas on a scale from 1 to 4, and will only accept contributions that score 3 or higher on all areas. Refer to our [contribution guidelines](https://github.com/openai/openai-cookbook/blob/main/CONTRIBUTING.md) for more details.
+- [ ] I completed the [new Cookbook submission steps](https://github.com/openai/openai-cookbook/blob/main/CONTRIBUTING.md#before-opening-a-pr-for-a-new-cookbook).
+- [ ] I reviewed the recipe against the [Cookbook rubric](https://github.com/openai/openai-cookbook/blob/main/CONTRIBUTING.md#rubric).
diff --git a/AGENTS.md b/AGENTS.md
index 90bb3789..958ac371 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -23,7 +23,7 @@ Execute notebooks top-to-bottom after installing dependencies and clear lingerin
## Commit & Pull Request Guidelines
-Use concise, imperative commit messages that describe the change scope (e.g., "Add agent portfolio collaboration demo"). Every PR should provide a summary, motivation, and self-review, and must tick the registry and authors checklist from `.github/pull_request_template.md`. Link issues when applicable and attach screenshots or output snippets for UI-heavy content. Confirm CI notebook validation passes locally before requesting review.
+Before opening a PR for a new example or guide, complete the [Cookbook submission checklist](CONTRIBUTING.md#before-opening-a-pr-for-a-new-cookbook).
Before a pull request is merged, run the repository's `docs-editor` skill on every changed article, Markdown or MDX file, and notebook Markdown cell. For editorial notebook changes, preserve code cells, outputs, execution counts, attachments, cell order, and metadata. Fix safe issues, rerun the relevant checks, and resolve or explicitly document all remaining P0 and P1 findings in the pull request.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 32191bc3..3660b89f 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -7,18 +7,52 @@ The OpenAI Cookbook is a community resource for practical patterns, runnable exa
## Choose an issue or a pull request
- For a problem with an existing example or the Cookbook site, open a [problem report](https://github.com/openai/openai-cookbook/issues/new/choose). Name the affected file or page, describe the problem and the expected behavior, and include a small reproduction or screenshot when useful.
-- For an idea that needs discussion, open a [feature request](https://github.com/openai/openai-cookbook/issues/new/choose) describing the use case and proposed example.
-- For a focused correction or a ready-to-review example, you can open a pull request directly. Search existing issues and pull requests first, and link a related issue if there is one.
+- For a new example or guide, follow the [new Cookbook submission steps](#before-opening-a-pr-for-a-new-cookbook).
+- For other ideas, open a [feature request](https://github.com/openai/openai-cookbook/issues/new/choose).
+- For a focused correction to existing content, you can open a pull request directly. Search existing issues and pull requests first, and link a related issue if there is one.
-Keep examples relevant to building with OpenAI technologies. Explain the task they solve, the prerequisites, and the choices a reader needs to understand or adapt them. Prefer a focused, reproducible contribution over a large collection of unrelated examples.
+## Before opening a PR for a new Cookbook
+
+1. Share the proposal in the Cookbook maintainers' review channel on Slack. Describe the use case and what readers will learn beyond existing examples. If you lack access, open or reuse a [feature request](https://github.com/openai/openai-cookbook/issues/new/choose) and wait for a maintainer to confirm they shared the proposal.
+2. List each credited author's Cookbook ID under `authors` in [`registry.yaml`](registry.yaml). Check that each author has a profile with a working picture. To add or update a Cookbook profile, set `name`, `website`, and `avatar` under the same ID in [`authors.yaml`](authors.yaml). If the site manages that profile, ask a site maintainer to update it.
+3. Confirm with each author whether the OpenAI employee badge should appear. Ask a site maintainer to verify eligibility and make any badge changes. Keep private review links and verification details out of public issues and PRs.
+4. [Choose a tag](#choose-cookbook-tags) for the OpenAI capability the recipe teaches.
+
+Ask the relevant product or partner team to review the draft when applicable. The finished Cookbook requires Developer Experience approval before publication.
## Place and publish content
- Put notebooks, Python scripts, and their related assets in `examples/<topic>/`. Put long-form guides in `articles/` and shared diagrams or screenshots in `images/`.
- Add an entry to [`registry.yaml`](registry.yaml) for new or relocated content that should appear on [cookbook.openai.com](https://cookbook.openai.com/). Match its `path` to the file. The registry schema requires `title`, `path`, `slug`, `tags`, and `authors`; also provide an accurate description and publication date.
-- [`authors.yaml`](authors.yaml) is optional for custom author information. Without an entry there, the site uses the author's GitHub profile. Use the same author slug in both files if you add custom attribution.
- Keep large datasets outside the repository and explain how readers can obtain them.
+### Choose Cookbook tags
+
+Choose at least one registry tag for the capability the recipe teaches. The table groups tags by [Cookbook homepage topic](https://developers.openai.com/cookbook). For a recipe about embedding long inputs with `tiktoken`, use the `embeddings` tag and mention the library in the title or description.
+
+| Homepage topic | Registry tags |
+| --- | --- |
+| Agents | `agents`, `agents-api`, `agents-sdk`, `agentkit`, `workspace-agents` |
+| Agents API | `agents-api` |
+| Audio | `audio`, `speech`, `speech-to-text`, `transcription`, `realtime` |
+| ChatGPT | `chatgpt`, `gpt-actions-library`, `workspace-agents` |
+| Codex | `codex` |
+| Evals | `evals` |
+| Fine-tuning | `fine-tuning`, `gpt-oss-fine-tuning`, `reinforcement-learning` |
+| Guardrails | `guardrails`, `moderation` |
+| Images | `images`, `image-generation` |
+| Multimodal | `multimodal`, `images`, `vision`, `audio`, `speech`, `sora` |
+| Open models | `open-models`, `gpt-oss`, `harmony` |
+| Optimization | `fine-tuning`, `prompt-optimization`, `prompt-caching`, `latency`, `cost-api`, `usage-api`, `cost-management`, `batch` |
+| Responses | `responses` |
+| Retrieval | `retrieval`, `rag`, `embeddings` |
+| Security | `security` |
+| Sign-in with ChatGPT | `sign-in-with-chatgpt` |
+| Text | `completions`, `prompt`, `prompt-engineering`, `structured-outputs`, `reasoning` |
+| Tool use | `functions`, `mcp`, `tool calling` |
+
+If no tag fits, explain the gap in the PR and suggest a tag and the homepage topic where readers would look for it. Maintainers update this table when a topic's tags change.
+
## Prepare and validate your change
1. Create and activate a Python virtual environment. Install the dependencies listed by the example you changed, such as its `requirements.txt`, and document any additional prerequisites.
@@ -35,20 +69,18 @@ Read credentials from environment variables such as `OPENAI_API_KEY`; never comm
## Open a pull request
-Use the [pull request template](.github/pull_request_template.md) to explain what changed and why. Include the validation you ran, link related issues, and add screenshots or output snippets when they help reviewers check the result. For new published content, complete the template's `registry.yaml` and optional `authors.yaml` checklist and review the submission against the rubric below.
+Use the [pull request template](.github/pull_request_template.md) to explain what changed and why. Include the validation you ran, link related issues, and add screenshots or output snippets when they help reviewers check the result.
### Rubric
-The pull request template asks contributors to self-review these areas:
-
-- **Relevance:** Useful to people building with OpenAI technologies.
-- **Uniqueness:** Adds information beyond related Cookbook examples and documentation.
+- **Relevance:** The recipe teaches readers how to use an OpenAI capability in their own projects.
+- **Uniqueness:** Search related Cookbook examples and documentation to verify that the recipe teaches something new.
- **Spelling and grammar:** Free of distracting errors.
- **Clarity:** Organized and understandable.
- **Correctness:** Claims and code have been checked; code runs as described.
- **Completeness:** Includes the context, references, and citations readers need.
-The template says reviewers rate each area from 1 to 4 and accept content scoring at least 3 in every area. Maintainers review contributions on a best-effort basis and may ask for revisions.
+Reviewers rate each area from 1 to 4. A submission needs at least 3 in every area to be accepted. Maintainers may ask for revisions.
## Find the right place for help