Chat Messages Array Builder
Compose an LLM conversation turn by turn, reorder it, and export it as OpenAI JSON, Anthropic messages with a top-level system, a Python SDK call, or a curl command.
The messages array, four ways
Modern chat models take an ordered list of role and content objects. The first message is usually a system instruction that sets behaviour, then user and assistant turns alternate to form the history the model continues from. This builder keeps that list editable: change a role, reorder a turn, add or drop a message, and every export updates at once. The OpenAI export nests the system message inside the array. The Anthropic export lifts every system message into a separate top-level string and leaves the array as alternating user and assistant turns, which is what the Messages API expects. The Python and curl exports wrap the same payload in a runnable call that reads your key from an environment variable, so no secret is ever typed here. The token figure applies the Token Counter heuristic to every message plus a small per-message overhead. For cost, send that number to the LLM API Cost Calculator.