The fundamentals of prompting apply to every model. This guide covers what is specific to OpenAI’s models, in the ChatGPT app and through the API, and where their behavior should change how you write.
Model names and limits change often, so this guide describes behavior that has been stable across generations. Check OpenAI’s documentation for the current model list.
Two families that want different prompts
OpenAI ships general-purpose chat models and reasoning models. The distinction matters more than the model name.
| General chat models | Reasoning models | |
|---|---|---|
| How they work | Answer directly | Think internally before answering |
| Best prompt style | Explicit, step-by-step instructions | The goal, the constraints, and the success criteria |
| “Think step by step” | Can help | Unnecessary; may hurt |
| Examples | Often useful | Try without first |
| Cost and latency | Lower | Higher, tunable with reasoning effort |
A useful way to think about it: brief a chat model like a capable junior who needs the procedure, and a reasoning model like a senior colleague who needs the objective.
Message roles
The API takes messages with roles. Instructions from the application author go in the system message, which newer OpenAI APIs call the developer message. User input goes in user messages. The model gives developer instructions priority.
Put standing rules, the role, and the output format in the developer message. Put the task and its data in the user message. See system prompts and role prompting.
In the ChatGPT app, custom instructions and project instructions play the part of the system message.
Be literal and explicit
Recent OpenAI models follow instructions closely and literally. Two consequences:
- They do what you say, not what you implied. If you want suggestions as well as the requested fix, ask for both.
- A single clear sentence usually corrects a behavior. There is no need for capitals or repetition. Heavy emphasis can cause a rule to be over-applied.
Structure with Markdown and delimiters
OpenAI models handle Markdown headings and lists well for organizing instructions, and XML-style tags for wrapping documents and inputs.
## Task
Summarize the incident report for the on-call team.
## Requirements
- 5 bullet points.
- Include root cause, customer impact, and fix.
## Output format
A markdown list. No introduction.
<report>
{{report}}
</report>
Long context
When a prompt contains a large document, place the instructions at both the beginning and the end. If you can only place them once, put them above the document. This follows OpenAI’s own guidance for long-context prompts.
Structured Outputs
For anything your code parses, use the API’s Structured Outputs feature with a JSON Schema in strict mode. The response is then constrained to the schema, which removes a whole class of parsing failures.
- Name and describe fields well: the model reads the schema.
- Use enums for fixed value sets.
- Put a reasoning field before the result field if you want an explanation.
- Still validate: a response can be cut off at the output limit or declined.
More in structured output prompting.
Function calling
Tools are defined by a name, a description, and a parameter schema. The description is the prompt the model uses to decide when to call the tool, so state what it does, when to use it, and what it returns. Strict mode constrains arguments to the schema. See prompts for AI agents.
Reasoning effort
Reasoning models expose a setting for how much thinking to spend. Use low effort for simple extraction and classification, and higher effort for multi-step analysis and difficult code. Adjusting this setting is more effective than adding reasoning instructions to the prompt.
Token counting is exact
OpenAI publishes its tokenizers, so you can count a prompt’s tokens offline and know the input cost before sending. PromptFlowEngine uses those tokenizers for OpenAI models and labels the result exact. Check a prompt in the workspace, or see token optimization.
Prompt caching applies automatically to repeated prompt prefixes above a minimum length, so keep stable content first and variable content last.
Prompting in the ChatGPT app
- Give context once. Use custom instructions or a project for standing preferences instead of retyping them.
- Start a new chat when the topic changes. Old instructions linger in a long conversation.
- Attach the material. Upload the file instead of describing it.
- Ask for the format. A table, a checklist, or a word limit.
- Check memory. If saved memories are steering answers in ways you do not want, review or disable them.
- Do not paste secrets. Keys and customer data in a chat have left your control.
The PromptFlowEngine Chrome extension works inside ChatGPT: it analyzes the draft in the prompt box, restructures a loose request, and warns when the draft contains a credential.
Common mistakes with OpenAI models
| Mistake | What happens | Fix |
|---|---|---|
| Step-by-step instructions to a reasoning model | Slower, no better | State the goal and constraints |
| Asking for JSON in prose only | Occasional invalid output | Use Structured Outputs |
| Instructions buried under a long document | Instructions under-weighted | Repeat them after the document |
| Emphasis on every rule | Rules over-applied | Plain statements; explain the reason |
| Estimating tokens by characters | Budget misses | Count with the tokenizer |
Optimizing a ChatGPT prompt
- State the task in the first line.
- Add audience, constraints, and the output format.
- Wrap pasted material in tags.
- Remove filler and repetition.
- Test on real inputs and compare versions.
The PromptFlowEngine prompt optimizer does steps 3 and 4 and verifies that no requirement was lost.
Compare with the Claude prompting guide and the Gemini prompting guide.