AI Engineer Guide

How to set Multiple System Prompts with Anthropic's Claude API

Sometime you might want to send multiple system prompts when making API request to Anthropic LLM like Sonnet 4.5 or Opus 4.5.

2026-01-09-at-23.13.102x.png

You can just pass it as array of string or array of text block and pass it to system like this

curl https://api.anthropic.com/v1/messages \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-sonnet-4-5",
    "max_tokens": 1024,
    "system": [
      { "type": "text", "text": "You are a helpful assistant." },
      { "type": "text", "text": "Always respond in JSON format." }
    ],
    "messages": [
      { "role": "user", "content": "What is an API?" }
    ]
  }'

Unlike OpenAI, Anthropic messages API does not have support for “system” role in input messages. We need to send them seperately under “system”

Reference

https://platform.claude.com/docs/en/api/messages/create

Stay Updated

Get the latest AI engineering insights delivered to your inbox.

No spam. Unsubscribe at any time.