Agent Completion messages[]: system and user turns become one prompt
How Sume joins messages[] into one prompt, what a system turn can and cannot do, and why a GPT-6.1 Sol or Sonnet 5.5 chat history cannot be replayed as is.

messages[] on an Agent Completion accepts only system and user turns, and Sume joins them in order into a single prompt for one run. It is not a chat transcript the agent resumes. If your GPT-6.1 Sol or Claude Sonnet 5.5 app keeps a history with assistant turns, flatten it into one user turn first, because an assistant turn answers 400 invalid_request. Send either messages or instruction, never both.
What the docs say
The Agent Completions page shows a request with a system turn ("Be terse.") and a user turn, and states that turns are joined, in order, into one prompt. content can be a string or an OpenAI-style array of text parts, and input_text is accepted as an alias. The "Not available yet" list names assistant turns in messages[] and continuing a prior thread with thread_id.
So the shape looks like Chat Completions on the way in, but the way out is not: the reply is a 202 agent.run receipt, with the result arriving later in output.
Where each piece belongs
| Your data | Put it in | Reason |
|---|---|---|
| Tone and house rules | system turn | Joined first, in order |
| The task for this run | user turn | This is the work |
| Prior model replies | Summarize inside the user turn | assistant turns return 400 |
| Records the agent should read | input object | Written to a file and treated as data |
| Images to look at | attachments[] | Up to 30 images |
A practical habit
Keep the system turn short and stable, and reserve the user turn for what changes per run. That makes two receipts comparable, and it keeps the part you tune separate from the part your application fills in.
When a user turn needs facts from earlier work, quote only the facts, for example the chosen product name and the approved caption, not the whole earlier conversation. The agent starts a fresh thread, so it will not remember anything you leave out.
- Never send both
instructionandmessages. - Do not rely on role order beyond what the docs state: turns are joined in order.
- Treat anything under
inputas data. Instructions placed there are not followed. - Remember the cap:
generation_spend_cap_usdis required whichever form you use.
Related limits
There is no streaming and no synchronous choices[] response, so do not point an OpenAI-compatible client at this route and expect a chat completion back. If you need a structured final value, bind output_schema; the contract is on the Structured output page. Keys need the agent_completions:write scope, covered under Authentication.
Sources
Related posts
More in Developers
- Agent Completion output_schema: fail a CI build when it is invalid
Bind output_schema to a Sume Agent Completion and gate CI on the receipt: status completed, output present, output_error empty. Strict schema rules explained.
- Cancel an Agent Completion at a deadline: Python poll loop
A Python loop that starts a Sume Agent Completion, polls status_url until next_action stops saying poll_status, and cancels at a deadline.
- Lazy-load placeholder for an AI image: average color from Sume
Compute the average color of a generated image with Pillow, use it as the background of the image box and avoid a white flash while the real file loads.
- Prompt length limits across Firefly and Sume
Adobe Firefly now takes longer prompts for Image and Video on the web. Sume documents a 5000-character cap for music and no stated cap elsewhere.
Written by Sume