OpenAI Prompting Best Practices: The Official Rules Explained
OpenAI's own prompting guidance in one page: the eight rules from its help article, how to structure longer prompts, key settings, and what changes for reasoning models.
OpenAI's prompting best practices are short and practical: use a current model, put the instruction first and separate it from the material, be specific about the outcome you want, show the output format, and say what to do rather than only what to avoid. For reasoning models the advice changes: give the goal and the constraints, keep the prompt simple, and do not ask the model to think step by step.
This page expands the OpenAI section of our main guide, The Best Prompt For Anything. It is drawn from three OpenAI sources: the help article Best practices for prompt engineering with the OpenAI API, the platform prompt engineering guide and the reasoning best practices guide.
The eight rules from OpenAI's help article
OpenAI presents these as rules of thumb, in this order.
1. Use the latest model
Newer models are generally easier to prompt. The platform guide adds a point for production use: pin an application to a specific model snapshot so behaviour does not shift underneath you, and keep tests that show how a prompt performs when you upgrade.
2. Put the instruction first, then separate it from the material
State the task at the start, then mark where the content begins. OpenAI's example moves from an instruction followed directly by text to the same instruction followed by a label and the text inside triple quotes:
Summarize the text below as a bullet point list of the most important points.
Text: """
[text input here]
"""
The help article suggests ### or triple quotes as separators. The newer platform guide recommends Markdown headings and XML tags for the same job. Any of them works; what matters is that instruction and material cannot blur together.
3. Be specific about context, outcome, length, format and style
OpenAI's example starts with "Write a poem about OpenAI" and improves it to a short, inspiring poem about a specific product launch, written in the style of a named poet. Each added detail removes a guess.
4. Show the output format
Models respond better when shown the shape of the answer, and the result is easier to process afterwards. OpenAI's example replaces a bare request to extract entities with one that lists the fields in order and gives a "Desired format" block with a placeholder line for each field.
5. Start zero-shot, then few-shot, then fine-tune
Try the instruction alone first. If that falls short, add a few worked examples. Consider fine-tuning only when neither is enough. The platform guide adds that the examples should cover a diverse range of inputs.
6. Cut imprecise descriptions
OpenAI's example replaces a description that should be "fairly short, a few sentences only, and not too much more" with "Use a 3 to 5 sentence paragraph to describe this product". A number is easier to follow than an adjective.
7. Say what to do, not only what not to do
A support prompt that only lists prohibitions leaves the model without a path. OpenAI's improved version tells the agent what to do in the difficult case: diagnose the problem, suggest a solution, and point the user to a help article instead of asking for personal information.
8. For code, use leading words
Ending a prompt with the first word of the expected output nudges the model toward the right pattern. OpenAI's examples are import for Python and SELECT for SQL.
How OpenAI suggests structuring a longer prompt
For system-level instructions, the platform guide suggests sections marked with Markdown headings, usually in this order, with the note that the best order can vary by model:
| Section | What goes in it |
|---|---|
| Identity | Who the assistant is and what it is for |
| Instructions | Rules, steps and constraints |
| Examples | Sample inputs with the desired outputs |
| Context | Reference material, placed near the end |
It also explains message roles. Developer messages carry instructions from the application and take priority over user messages. OpenAI's analogy is that a developer message is like a function definition and a user message is like the arguments passed to it.
Settings that matter
The help article covers four parameters:
- Model. More capable models usually cost more and may respond more slowly.
- Temperature. Higher values make output more varied. OpenAI is clear that this is not the same as truthfulness. For factual tasks such as data extraction and truthful question answering, it says a temperature of 0 is best.
- Maximum length. This is a hard cutoff, not a way to control how long the answer is. Ask for the length you want in the prompt.
- Stop sequences. Characters that end generation when the model produces them.
Prompting reasoning models is different
OpenAI separates its models into two families. GPT models benefit from precise, explicit instructions. Reasoning models do better with high-level guidance. Its comparison: a reasoning model is like a senior colleague you hand a goal to, and a GPT model is like a junior colleague who needs explicit instructions.
For reasoning models, the guidance is:
- Keep prompts simple and direct. Brief, clear instructions work well.
- Do not ask for step-by-step thinking. The reasoning happens internally, so prompts such as "think step by step" are unnecessary and can sometimes hinder.
- Use delimiters. Markdown, XML tags and section titles keep the parts of the input distinct.
- Try zero-shot first. These models often need no examples. If you add them, make sure they match the instructions closely.
- State constraints explicitly. OpenAI's example is asking for a solution with a budget under a stated amount.
- Be specific about the end goal. Give concrete success criteria so the model knows when it is done.
A quick checklist
- Is the instruction first, with the material clearly separated?
- Does the prompt name the context, outcome, length, format and style?
- Is the output format shown, not only described?
- Are vague descriptions replaced with numbers?
- Does every "do not" come with a "do this instead"?
- For a reasoning model, have you removed the step-by-step instructions and stated the goal?
For ready-made starting points, see the ChatGPT model page and the guides to few-shot prompting and prompt chaining. For the equivalent advice from Anthropic, see Claude prompting best practices.
FAQ
What are OpenAI's prompting best practices in one sentence?
Use a current model, put the instruction first and separate it from the material, be specific about the outcome, show the output format, and say what to do instead of only what to avoid.
Should I use ### or triple quotes in an OpenAI prompt?
Either works. OpenAI's help article suggests ### or triple quotes to separate instructions from content, and its platform guide recommends Markdown headings and XML tags for the same purpose.
What temperature does OpenAI recommend for factual tasks?
OpenAI's help article says a temperature of 0 is best for factual tasks such as data extraction and truthful question answering.
Should I tell a reasoning model to think step by step?
No. OpenAI says reasoning models reason internally, so step-by-step prompts are unnecessary and can sometimes hinder. Give the goal and the constraints instead.
Is few-shot prompting still worth using?
Yes, when a plain instruction falls short. OpenAI's order is zero-shot first, then a few examples, then fine-tuning only if needed.
Prompts that put this into practice
Bug Diagnosis Prompt
Give the model the error, the code and what you expected. It ranks likely causes by evidence, tells you how to confirm each, and proposes a minimal fix.
# Role
You are an experienced engineer helping me find the cause of a bug. Diagnose first and fix second. Do not rewrite code that is not part of the problem.…Show-Your-Working Data Analysis Prompt
Analyzes a pasted table or dataset step by step: data check, calculations with working shown, findings tied to those calculations, and what the data cannot support.
# Role
You are a data analyst. You show your working, you keep observation separate from interpretation, and you say plainly when the data cannot answer the que…Professional Email Prompt
Drafts a single work email that leads with the ask, suits the relationship, and leaves bracketed blanks for any detail you did not provide.
# Role
You are helping me write one professional email. Write it as I would send it: from me, in the first person, ready to paste.
# Situation
- Who I am writi…Keep reading
Guide
The Best Prompt For Anything: The 2026 Guide to Prompts That Actually Work
There is no single best prompt, but there is a best structure. Copy-ready templates for writing, coding, research, learning and marketing, plus the five-part formula behind them.
Guide
Claude Prompting Best Practices: What Anthropic Recommends
Anthropic's own guidance for prompting Claude, in one page: be explicit, give reasons, use examples, separate instructions from material, and handle long documents well.
Technical guide
Few-Shot Prompting: How to Use Examples in a Prompt
How to include worked examples in a prompt so the model follows a format, label set or style, and how to choose examples that generalize.
Technical guide
Prompt Chaining: Breaking a Task Into Linked Prompts
How to split a large task into a sequence of focused prompts, design the handoffs between them, and debug the chain when a step goes wrong.
Sources and references
- Prompt engineering guide — OpenAI