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 the messages 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.
A system prompt that instructs Claude to produce harmful content, impersonate real individuals, or bypass its guidelines will not work as intended. Claude’s values are not configurable.

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

x-api-key
string
header
required

Headers

anthropic-version
string
required
Example:

"2023-06-01"

Body

application/json
model
enum<string>
required

The Claude model to use.

Available options:
claude-sonnet-4-6,
claude-opus-4-6,
claude-haiku-4-5
Example:

"claude-sonnet-4-6"

max_tokens
integer
required

Maximum number of output tokens to generate.

Required range: x >= 1
Example:

1024

messages
object[]
required
system
string

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

id
string
Example:

"msg_01XFDUDYJgAACzvnptvVoYEL"

type
string
Example:

"message"

role
string
Example:

"assistant"

content
object[]
model
string
Example:

"claude-sonnet-4-6"

stop_reason
enum<string>
Available options:
end_turn,
max_tokens,
stop_sequence,
tool_use
Example:

"end_turn"

stop_details
object | null
usage
object