Multi-turn image edits over Agent Completions: pass the last output
Agent Completions keep no conversation, so each edit turn is a new run. Attach the previous output.images URL as the next input and keep a cap per turn.

POST /v1/agent/completions has no memory between calls. Every completion runs in a new thread, and a messages[] array with an assistant turn is rejected with a 400. To do a multi-turn edit, you chain it yourself: take the URL from output.images of turn one and attach it as the input of turn two.
Why this matters this week
Ideogram's launch post for 4.5 says the model "eliminates artifact buildup, making multi-turn editing possible" (Ideogram on X, read 2026-10-05). On Sume that kind of chain is a client pattern: the API stores no hidden edit state, so the pixels you send are the pixels that get edited.
The pattern
Each turn is one run with its own generation_spend_cap_usd:
- Turn 1: attach the original, ask for one change, poll to
completed. - Read the first URL in
output.imagesand save it with the prompt. - Turn 2: attach that URL as
input_image, ask for the next single change. - Repeat. Never attach the original again unless you want to restart from it.
| Route | Keeps prior turns | How you chain |
|---|---|---|
| POST /v1/agent/completions | No, new thread each call | attach last output.images URL |
| POST /v1/images | No, stateless | send last data[].url in input_references |
Why one change per turn
The agent has no record of earlier instructions, so the prompt must say what to keep each time: "Keep the label, the shadow and the framing unchanged." Repeating this preserve list is the same guard that works for single-model edit chains. Check each result against the previous one before you go on, because an error in turn two is carried into turn three.
Cost control
Set the cap per turn, not once for the chain. A chain of five turns with a cap of $1 each can spend up to $5, and a failed run is a clean stop where you decide whether to retry. If the steps are fixed and known, the Image API is cheaper to reason about, because the price of each image is shown by quality and not decided by an agent.
Limits
Media URLs are durable, but a long chain loses nothing only if you keep your own list of them. Store them as you go. And do not expect turn six to match turn one in fine detail: each pass is a fresh render, and no API setting can promise otherwise.
Sources
Related posts
More in Developers
- Music API image_url null: clear a reused request body, with Python
Send image_url as null on Sume music requests only to clear an image from a reused request object. A short urllib script posts to the Music Router.
- Nano Banana 2 Lite's 10 aspect ratios: what to send for 4:5
Lite accepts 10 ratios including 4:5 and 21:9. On Sume, Instagram 1080x1350 is aspect_ratio 4:5, and Nano Banana Pro or 2 list it; Imagen and Grok do not.
- Nano Banana 2 reference slots (10+4+3) vs Sume's flat reference list
Google splits Nano Banana 2 references into 10 object, 4 character and 3 style slots. Sume's input_references is one flat list capped at 10, with no slots.
- Nano Banana 2 thinking_level minimal or high: not on Sume
Google offers thinking_level minimal or high on the Nano Banana 2 variants. Sume's Image API has no such field, so sending it returns 400 unsupported_parameter.
Written by Sume