Continue Edit Session
continue_edit_sessionApply iterative edits to an image session using focused prompts. Takes the previous output as input and returns updated image and session.
Instructions
Apply another edit turn to an existing session. The previous turn's output image is used as the input. Use short, focused prompts like "make the sky more orange" or "add a small boat on the horizon"; include "keep everything else the same" to limit drift. Returns the new image and the updated session.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | The session id returned by start_edit_session. | |
| prompt | Yes | Image description. gpt-image-2 handles very detailed prompts; use ALL CAPS or quote literal text you want rendered verbatim. | |
| size | No | Output dimensions. "auto" (default), one of the presets "1024x1024", "1536x1024", "1024x1536", or a custom "WxH" where both edges are multiples of 16, max edge ≤ 3840px, aspect ratio within 1:3–3:1, and total pixels 655,360–8,294,400. Outputs above 2K are beta. | auto |
| quality | No | Edit quality — same levels as generate. | auto |
| background | No | Background behavior. "opaque" forces a filled background; "auto" lets the model pick. gpt-image-2 does NOT support transparent backgrounds — use a different model for that. | auto |
| output_format | No | File format. "png" (default, lossless), "jpeg" (smaller, lossy), "webp" (best compression). When omitted on continue_edit_session, the session's current format is kept. | |
| output_compression | No | Compression level 0–100 for jpeg/webp outputs. Ignored for png. Defaults to 100 (minimal compression). | |
| filename_prefix | No | Short label appended to the generated filename so you can find it later (e.g. "hero-banner"). Letters/digits/hyphens only; auto-sanitized. | |
| user | No | Optional end-user identifier forwarded to OpenAI for abuse monitoring. Pass a stable hashed user ID, not PII. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | ||
| prompt | Yes | ||
| requested | Yes | ||
| applied | Yes | ||
| images | Yes | ||
| usage | Yes | ||
| cost_usd_estimated | Yes | ||
| route | No | Which API route served the request (edit tools only): "direct" = /v1/images/edits, "responses" = Responses-API fallback (one image per call, undercounted cost). | |
| notes | No | Caveats about how the request was served. | |
| session_id | Yes | ||
| turn | Yes |