#!/usr/bin/env bash # System prompt as array of text blocks (with cache_control) + top-level cache_control # STATUS: LIVE_VERIFIED 2026-09-18 (curl via scripts/lib.sh `ant` wrapper; key injected from .env, never printed) # Run: bash examples/anthropic/messages/system.sh set -eo pipefail source "$(dirname "$0")/../../../scripts/lib.sh"; out="$(mktemp)"; trap 'rm -f "$out"' EXIT ant POST /v1/messages -d '{"model":"claude-haiku-4-5-20251001","max_tokens":16, "system":[{"type":"text","text":"You are terse. Answer in one word.","cache_control":{"type":"ephemeral"}}], "messages":[{"role":"user","content":"Reply with OK."}]}' > "$out"; mask < "$out" echo; echo "HTTP $ANT_STATUS"; log_request anthropic POST /v1/messages "$ANT_STATUS" 0.00004 "example system.sh"