Claude API · Shaping requests

Add a system prompt

Set Claude's role and rules with the top-level system parameter.

response = client.messages.create(
    model="claude-opus-5-5",
    max_tokens=16000,
    system="You are a helpful coding assistant. Always provide examples in Python.",
    messages=[{"role": "user", "content": "How do I read a JSON file?"}],
)

Official Claude API documentation

More shaping requests commands

All shaping requests commands · Claude API cheatsheet

Was this page helpful?