System Prompt
Endpoints
System Prompt
Send a message with a system prompt to shape Claude’s behavior before the conversation starts.
POST
System Prompt
Overview
A system prompt is a top-level instruction you give Claude before the conversation begins. It defines Claude’s role, tone, scope, and constraints for the entire interaction. Unlike user messages, the system prompt sits outside themessages array — it is passed as a separate system field in the request body.
How the System Prompt Works
The system prompt is processed before any user message. Claude reads it first and uses it as the lens through which it interprets everything that follows.What the System Prompt Controls
Token Impact
The system prompt counts as input tokens on every request — because it is included in full each time. A verbose system prompt adds cost at scale.
Write system prompts that are specific and concise. Every unnecessary word costs tokens on every single request.
What the System Prompt Cannot Do
System prompts shape behavior but do not override Claude’s core guidelines. Claude will decline requests that violate Anthropic’s usage policies regardless of what the system prompt instructs.Real Test Results
These two responses were produced from the same user message —"What is a webhook?" — with different system prompts:
Fintech assistant system prompt:
“A webhook is a way for one system to automatically notify another system when a specific event happens, by sending an HTTP POST request to a URL you provide.”No system prompt:
“Hello! How can I help you today?”The same question. Entirely different responses. The system prompt is doing all the work.
Token counts confirm this — the fintech system prompt request used 53 input tokens vs 17 for the basic message. The 36 token difference is the system prompt itself being processed.
Further Reading
Messages
Understand how system prompts relate to the messages array
Tokens
How system prompt length affects input token costs
Multi-turn
How system prompts persist across multi-turn conversations
Tool Use
Combine system prompts with tools for focused AI agents
Authorizations
Headers
Example:
"2023-06-01"
Body
application/json
The Claude model to use.
Available options:
claude-sonnet-4-6, claude-opus-4-6, claude-haiku-4-5 Example:
"claude-sonnet-4-6"
Maximum number of output tokens to generate.
Required range:
x >= 1Example:
1024
System-level instructions that shape Claude's behavior throughout the conversation.
Example:
"You are a fintech API documentation assistant. You explain financial technology concepts clearly and concisely for developers. Always respond in plain English, avoid jargon, and keep responses under three sentences."
Response
Successful response
Example:
"msg_01XFDUDYJgAACzvnptvVoYEL"
Example:
"message"
Example:
"assistant"
Example:
"claude-sonnet-4-6"
Available options:
end_turn, max_tokens, stop_sequence, tool_use Example:
"end_turn"