openai-cookbook

Examples and guides for using the OpenAI API

23 articles 71.8k View on GitHub ↗
23 articles
How to Implement Out-of-Band Transcription with OpenAI Realtime Sessions

Learn to implement out-of-band transcription with OpenAI Realtime sessions. Generate verbatim transcripts without altering conversation state by setting conversation none in response create.

how-to-guide
Mar 2, 2026
How to Build Tool-Using Agents with LangChain

Learn to build tool-using agents with LangChain. Implement a ReAct loop using custom prompts, structured output, and AgentExecutor to let LLMs use external tools dynamically.

how-to-guide
Mar 2, 2026
Implementing Self-Evolving Agents with Autonomous Retraining: A Complete Guide

Build self-evolving agents with autonomous retraining using OpenAI's Assistants API and reflection logging for continuous improvement. Automate model fine-tuning without human intervention.

how-to-guide
Mar 2, 2026
Best Practices for Context Engineering in the OpenAI Agents SDK

Master context engineering for OpenAI Agents SDK with best practices. Learn to chunk knowledge, compose structured prompts, and leverage the reasoning field for clearer AI responses. Enhance your agent's performance today.

best-practices
Mar 2, 2026
How to Evaluate Image Inputs with the OpenAI Evals API: A Complete Guide

Learn to evaluate image inputs with the OpenAI Evals API. Get a complete guide to automating end-to-end model evaluation with structured, reproducible scores using LLM-based grading.

how-to-guide
Mar 2, 2026
Building Supply Chain Copilots with Databricks MCP Servers: A Complete Implementation Guide

Build supply chain copilots with Databricks MCP servers and OpenAI Agents SDK. Query live data, leverage vector search, and Unity Catalog with LLM tools for powerful automation.

how-to-guide
Mar 2, 2026
Using the Seed Parameter for Reproducible Outputs in OpenAI's API

Achieve reproducible outputs with OpenAI API using the seed parameter. Learn how to anchor random number generation for consistent results with the system fingerprint for detecting changes.

how-to-guide
Mar 2, 2026
Implementing Multi-Tool Orchestration with RAG Using the OpenAI Responses API

Implement multi-tool orchestration with RAG to dynamically route queries across vector stores, web search, and file indexes for advanced information retrieval. Learn more.

how-to-guide
Mar 2, 2026
Building Temporal Agents with Knowledge Graphs for Retrieval: A Complete Guide

Learn to build temporal agents using knowledge graphs for retrieval. This guide shows how to store time-aware facts in a SQLite graph that invalidates stale predictions and tracks entity evolution.

how-to-guide
Mar 2, 2026
How to Use Prompt Caching to Reduce OpenAI API Costs

Reduce OpenAI API costs with prompt caching. Learn how this technique cuts input token costs by up to 90% and slashes latency for long prompts.

tutorial
Mar 2, 2026
Implementing Code Execution Plans with Codex CLI and PLANS.md: A Complete Guide

Automate multi-step development with Codex CLI and PLANS.md. Store milestones and commands in PLANS.md for iterative code planning, editing, validation, and repair.

how-to-guide
Mar 2, 2026
Building Voice Agents with the OpenAI Realtime API: Architecture and Code Examples

Learn to build voice agents with the OpenAI Realtime API. Explore a production-ready reference implementation with ESP-32, Deno, and React. Get code examples now.

how-to-guide
Mar 2, 2026

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →