A developer comparing Anthropic's Messages API to some other chat-style LLM APIs notices a structural difference in how the system prompt is supplied. How does Anthropic's Messages API handle the system prompt?
- Anthropic's Messages API accepts a top-level `system` parameter, kept separate from the `messages` array, to carry the system prompt, whereas some other chat-style APIs instead embed the system prompt as a message with a system or developer role placed inside the same messages list
- Anthropic requires the system prompt to be the first entry in the `messages` array with a role of `system`, exactly matching how some other chat-style APIs structure a request
- Anthropic's Messages API has no mechanism for supplying a system prompt at all; instructions can only be embedded inside the first user message
- the `system` parameter selects which dated model snapshot handles the request, and has nothing to do with supplying instructions to the model
Why A? And why not the others?
Correct answer: A. Anthropic's Messages API accepts a top-level `system` parameter, kept separate from the `messages` array, to carry the system prompt, whereas some other chat-style APIs instead embed the system prompt as a message with a system or developer role placed inside the same messages list
Anthropic's Messages API takes a dedicated top-level `system` parameter that sits alongside, rather than inside, the `messages` array, which itself alternates only `user` and `assistant` roles; this is a genuine structural difference from some other chat-style APIs, whose request format instead includes the system prompt as just another entry in a single flat list of role-tagged messages. The option describing a `messages`-array system entry describes that other pattern, not Anthropic's actual `system`/`messages` split, so it is wrong for the API being asked about. The option claiming no system-prompt mechanism exists is wrong because the dedicated `system` parameter is exactly that mechanism, and is extensively documented and supported. The option describing `system` as a model-selection parameter confuses it with the separate `model` field in the request body, which is what actually selects the model version, not `system`.
Source: Anthropic, Messages API reference, https://platform.claude.com/docs/en/api/messages