Prompts2026年3月29日·1 分钟阅读

OpenAI Cookbook — Official Prompting Guides

Official prompting guides from OpenAI: GPT-5.2, Codex, Meta Prompting, and Realtime API guides. The definitive reference for OpenAI model optimization.

TO
TokRepo精选 · Community
快速使用

先拿来用,再决定要不要深挖

这里应该同时让用户和 Agent 知道第一步该复制什么、安装什么、落到哪里。

Browse the guides at github.com/openai/openai-cookbook or read online at cookbook.openai.com.


介绍

Official prompting guides and code examples from OpenAI. Covers best practices for every major model: GPT-5.2, GPT-5.1, GPT-5, GPT-4.1, Codex CLI, and specialized guides for meta-prompting, realtime API, and Whisper. The authoritative source for understanding how to get the best results from OpenAI models.


Prompting Guides

GPT-5.2 Prompting Guide

Latest model best practices: structured outputs, tool use, chain-of-thought, system prompt design.

Codex Prompting Guide

Optimizing prompts for the Codex CLI agent: code generation, debugging, refactoring, multi-file edits.

Meta Prompting Guide

Using AI to improve your prompts: automated prompt optimization, self-critique patterns, prompt chaining.

Realtime Prompting Guide

Best practices for the Realtime API: voice interactions, streaming responses, latency optimization.

GPT-4.1 Prompting Guide

Instruction following, long context handling, agentic coding patterns.

Code Examples

The cookbook includes runnable Jupyter notebooks for:

  • Function calling and tool use
  • Embeddings and semantic search
  • Fine-tuning workflows
  • Batch processing
  • Vision and multimodal
  • Text-to-speech and speech-to-text

来源与感谢

Author: OpenAI Repository: openai-cookbook Website: cookbook.openai.com License: MIT

相关资产