HomeLearnCoursesHackathonsAccount
Mastering the Claude API
System Prompts and Conversation Structure · 1/2

System is a parameter, not a message

Unlike some chat APIs that put system instructions as the first entry in a messages array, Claude's Messages API keeps system entirely separate: it's its own top-level string (or array of content blocks) parameter, distinct from messages. This separation exists because the system prompt plays a fundamentally different role — it defines Claude's persona, constraints, and behavioral rules for the whole conversation, rather than being one turn among many. Keeping it structurally apart also makes it the natural place to put stable, cacheable content, since it rarely changes between requests in the same application.

The messages array itself alternates between two roles: 'user' and 'assistant'. There is no 'system' role inside messages in the base request shape. The first message must be role 'user' — you can't open a conversation with an assistant turn — and consecutive messages of the same role are permitted and get combined into a single turn, which is useful when you're programmatically assembling multi-part content.