Skip to content
AI Dev Toolkit.
Esc
  • Loading…

Prompts

System prompt examples for real developer use cases

A system prompt is the standing instruction a model reads before every user message: its role, rules, tone and output format. These 20 original system prompts cover support bots, coding helpers, RAG, JSON extraction, SQL, agents and classifiers, each with notes on why every section is there, how it fails and what it costs per month.

20 system prompts

Steps

How do I use these system prompt examples?

  1. Search or filter the library for the job your assistant does.
  2. Open a prompt and read the design notes, so you know which parts matter for your case.
  3. Replace the {{variables}} with your values, or open it in the prompt builder to fill them and get the exact API request.
  4. Check the failure modes against your own test messages before you ship it.
  5. Price it at your traffic with the prompt caching calculator.

Method

What is a system prompt?

A system prompt is the part of an AI feature you write once and send every time. It sets the assistant’s role, what it may and may not do, and the shape of its answers, while the user’s message changes with each request. The prompts in this library were written for this site, not copied from any product, and each comes with notes on why it is built the way it is. For the full definition, see what a system prompt is.

System prompt vs user prompt: what’s the difference?

The system prompt sets standing behaviour for the whole conversation and is written by the developer; the user prompt is each individual request, written by the person using the app. Rules that must hold on every turn go in the system prompt; anything that changes per request goes in the user turn.

How do I write a good system prompt?

Most share a structure that follows the providers’ own guidance. A one-sentence role comes first; Anthropic’s guide says even a single sentence of role focuses the model’s behaviour. Next comes the goal and the reason behind it, because explaining why a rule exists helps the model apply it to cases you didn’t list. Rules are concrete and observable (“escalate after two unsuccessful answers”, not “escalate when appropriate”), which is Google’s advice to give clear, specific instructions and constraints. The output format is shown rather than described. OpenAI suggests the same order for a developer message: identity, instructions, examples, context.

Two habits run through every prompt. They give the model an honest way out (“say the documents don’t cover it”, “write owner unclear”), which Anthropic lists first among ways to reduce hallucinations. And they treat anything the model reads, whether documents, tickets, emails or logs, as data rather than instructions. As a checklist:

  • One sentence of role, then the goal and why it matters.
  • Concrete, observable rules instead of “when appropriate”.
  • An honest way out when the answer isn’t known.
  • The output format shown as an example, not just described.
  • Everything the model reads treated as data, never as instructions.
  • Nothing that changes per request, so the prompt can be cached.

To write your own in that shape, build your own system prompt with the prompt builder.

What goes in a variable, and what goes in the user turn?

Placeholders such as {{company}} are filled once when you set the assistant up. Anything that changes per request, such as the user’s name, today’s date or retrieved documents, belongs in the user turn. That keeps the system prompt byte-for-byte identical across requests, which is what prompt caching needs: Anthropic’s cache only hits on a 100% identical prefix, and OpenAI recommends putting repeated content at the start of the prompt.

How long should a system prompt be, and what does it cost?

The prompts here run from 258 to 522 tokens, 337 in the middle, counted with OpenAI’s o200k_base tokenizer. Sent with 10,000 requests a day, even a short prompt adds up, so each page prices it for a month on current models, with and without caching. Caching only applies above a minimum length: 512 tokens on Claude Sonnet 5.5, 512 tokens on Claude Haiku 5.5, 1,024 tokens on GPT-6.1 Sol and 4,096 tokens on Gemini 3.8 Flash. Below that, the prompt is billed in full every time; together with tool definitions, which sit in front of it in the cached prefix, it may cross the line. To price your own traffic, see what a long system prompt costs with caching.

Where does the system prompt go in each API?

The text stays the same across providers; the field it goes in doesn’t.

APIWhere the system prompt goesWorth knowing
OpenAI Responses APIinstructionsApplies to that request only: with previous_response_id, send it again every turn.
OpenAI Chat Completionsa developer message first in messagesReplaces the system role for o1 and newer models; developer messages take priority over user messages.
Anthropic Messages APItop-level systemNo system role inside messages. Pass it as a text block with cache_control to cache it.
Gemini generateContentsystemInstructionText only. Still supported; Google recommends the Interactions API for new work.
Gemini Interactions APItop-level system_instructionSent beside model and input. Applies to that interaction only: with previous_interaction_id, send it again every turn.
Placement in Python
# The same system prompt in each API (Python SDKs).
SYSTEM_PROMPT = open("support-agent.txt").read()  # fixed per deployment

# OpenAI Responses API
openai_client.responses.create(model=MODEL, instructions=SYSTEM_PROMPT, input=user_message)

# Anthropic Messages API (cached once it passes the model's minimum length)
anthropic_client.messages.create(
    model=MODEL, max_tokens=1024,
    system=[{"type": "text", "text": SYSTEM_PROMPT, "cache_control": {"type": "ephemeral"}}],
    messages=[{"role": "user", "content": user_message}],
)

# Gemini generateContent (google-genai SDK)
genai_client.models.generate_content(
    model=MODEL, contents=user_message,
    config=types.GenerateContentConfig(system_instruction=SYSTEM_PROMPT),
)

Every claim in the design notes was checked against the providers’ documentation on 2026-10-14. For a prompt you are writing from scratch, the prompt builder lays out the sections and shows the exact request; for one you are changing, the prompt diff shows what changed and what it costs.

Examples

How long are these system prompts, and what do they cost?

Each prompt’s size and what sending it with 10,000 requests a day for a month costs on Claude Sonnet 5.5, with and without caching. Prices updated 2026-11-12; other models are on each prompt’s page.
System promptTokensUncachedCached
Customer support agent with escalation522$317.55$15.92
Voice assistant for spoken replies298$181.28below minimum
Tutor that guides instead of answering373$226.91below minimum
Coding assistant for TypeScript and React371$225.69below minimum
Code reviewer359$218.39below minimum
Unit test writer299$181.89below minimum
Pull request description writer284$172.77below minimum
RAG assistant that cites sources340$206.83below minimum
Search query rewriter for RAG277$168.51below minimum
JSON-only extraction service258$156.95below minimum
SQL analyst with read-only safety371$225.69below minimum
Tool-using agent that confirms risky actions390$237.25below minimum
Inbox assistant that treats email as untrusted382$232.38below minimum
Incident triage assistant for logs and alerts331$201.36below minimum
Content moderation classifier262$159.38below minimum
Support ticket triage and routing365$222.04below minimum
LLM-as-judge evaluator285$173.38below minimum
Meeting summariser294$178.85below minimum
Technical writer for developer docs326$198.32below minimum
Translator that keeps your glossary and code337$205.01below minimum

FAQ

Frequently asked questions

What is the difference between a system prompt and a user prompt?

The system prompt sets standing behaviour for the whole conversation: role, rules, tone and output format, written once by the developer. User prompts are the individual requests that change every turn. The system prompt glossary entry covers the definition in full.

What is a system prompt?

A system prompt is the set of standing instructions a developer sends with every request: the assistant’s role, its rules, the tools it may use and the format of its answers. It is kept apart from what the user types, and the model gives it more weight. Each API has its own field for it: instructions or a developer message at OpenAI, system at Anthropic and systemInstruction at Gemini. The glossary entry has more.

What makes a good system prompt?

A clear role, the task and its limits, the output format, and what to do when the model is unsure or a request is out of scope, with no rules that never apply. Keep the fixed part stable so it can be cached, and put details that change per request in the user message. Every example here labels those parts and explains each one.

Should a system prompt contain secrets?

No. Users can often get a model to repeat its system prompt, and OWASP lists system prompt leakage as one of the top risks for LLM apps. Keep API keys, internal URLs and access rules out of it, and enforce permissions in your code, where the model can’t talk its way past them.

Are these real system prompts from ChatGPT, Claude or other products?

No. Every prompt here was written for this site and is free to copy and adapt. We don’t publish leaked or reconstructed system prompts from commercial products: they may be inaccurate, they belong to someone else, and they’re written for a different product than yours. The design notes explain the reasoning instead, so you can write your own.

How long should a system prompt be?

As long as the job needs and no longer. The prompts here run from 258 to 522 tokens. Every token is billed on every request, and rules that rarely matter compete with the ones that do. Put reference material in retrieval or tools instead of the prompt, and measure what’s left with the token counter.

Should I write system prompts with XML tags or Markdown?

Either works if you use it consistently. Anthropic recommends XML tags to separate instructions, context and examples, and OpenAI says Markdown headings and lists help mark sections while XML tags mark where a document starts and ends. Most prompts here use XML tags; the voice assistant uses Markdown headings, partly because Anthropic notes the prompt’s style can influence the reply’s style.

Can a system prompt stop prompt injection or jailbreaks?

It can make them less likely, not impossible. Users can ask the model to ignore its rules, and documents, emails or tool results can carry instructions of their own. Treat the system prompt as guidance and put the real controls in code: limited permissions, output validation, and human approval before actions that can’t be undone.

Does prompt caching make a long system prompt free?

Cheaper, not free, and only above a minimum length. Cached reads cost a fraction of the input price, but a prompt shorter than the provider’s minimum isn’t cached at all, and the cache only holds while requests keep arriving. Anything that changes per request, such as the date or the user’s name, should go after the fixed part. The prompt caching calculator works it out for your traffic.

Where do the token counts come from?

Each prompt was counted with OpenAI o200k_base (gpt-tokenizer 4.0.0), with its variables left as placeholders, and a test recounts them on every build. That is the exact count for GPT-5-family models. Claude’s and Gemini’s tokenizers aren’t public, so for them the count is an estimate and the real number may differ.