curl https://api.anthropic.com/v1/messages \ -H "content-type: application/json" \ -H "x-api-key: $(llm keys get anthropic)" \ -H "anthropic-version: 2023-06-01" \ -d '{ "model": "claude-haiku-4-5-20251001", "max_tokens": 1024, "messages": [ { "role": "user", "content": "What is the capital of France?" }, { "role": "assistant", "content": "The capital of France is Paris." }, { "role": "user", "content": "Germany?" }, { "role": "assistant", "content": "The capital of Germany is Berlin." }, { "role": "user", "content": "Belgium?" } ] }'
You still have the option to send the full conversation JSON every time if you want to.
You can send "store": false to turn off the feature where it persists your conversation server-side for you.