System prompts
How does a system prompt differ from a user message?
A system prompt is set once and shapes the whole session; a user message is one turn carrying a specific request. APIs label them with separate roles so the model treats them differently.
The difference is scope. A system prompt is set once and shapes the entire session. A user message is a single turn that carries a specific request, and it changes every time the person asks something new. The model sees both, but it treats them as different kinds of input.
APIs make this split explicit by tagging each message with a role. Messages the model writes carry the assistant role.[1] End-user requests carry the user role.[1] The standing instructions go in a separate role: OpenAI now calls this the developer role, which holds instructions from the application developer.[1] Anthropic keeps these in a dedicated system parameter, separate from the list of conversation messages.[2] Older OpenAI models called the developer role “system,” and the two names refer to the same idea.
One useful analogy: the developer or system message works like a function definition that sets the rules and business logic, while a user message works like the arguments those rules are applied to.[1] A practical habit follows from this. Put who the model is and how it should behave in the system prompt, and put the specific request in the user turn. Anthropic’s own role example does exactly that, with the persona in the system field and the question in the user message.[2] Keeping the two separate makes a prompt easier to maintain, since changing the task no longer means rewriting the persona.
One more distinction is easy to miss if you have only used a chat app in a browser. Typing into ChatGPT or Claude’s own consumer interface only ever produces user messages; the system prompt for that app is set behind the scenes by the provider, and you are not shown it or asked to write one. A system prompt in the sense this page means becomes something you actually set yourself once you call the API directly, or once you configure a custom assistant or a tool built on top of one of these models.
Where you set the system prompt
- OpenAI API ↗
Uses developer (formerly system), user, and assistant roles; developer instructions are set ahead of user messages.
- Anthropic Claude API ↗
Uses a dedicated system parameter for the role and rules, separate from the user/assistant message list.
References
- Text generation guide — OpenAI
- Prompting best practices (Give Claude a role) — Anthropic