Edit a photo from an AI agent: generate_image with input_references
The hosted MCP generate_image tool takes the same body as POST /v1/images, including input_references. Call tools_schema first, pass an idempotency_key.

Image-editing launches assume a person at a canvas. An agent has no canvas; it has tools. The Sume hosted MCP exposes image editing as generate_image, and the MCP tools and gates page lists it among the paid generation tools that need an idempotency_key.
What the tool takes
The Image API docs say the MCP payload schema is the same as the REST body, and a drift test keeps the two from diverging. payload.model is optional on MCP and defaults to sume/auto; REST still requires it. Reference images go in input_references as public HTTPS URLs. Before submit, generate_image passes through /v1/generation/admission-preview, so a cost estimate comes first.
| Item | MCP generate_image | POST /v1/images |
|---|---|---|
| Body fields | Same payload schema | Same schema |
| model | Optional, defaults to sume/auto | Required |
| Paid-call guard | idempotency_key required | Check endpoint pricing first |
| Cost estimate | admission-preview before submit | Read endpoint pricing |
A payload an agent can send
Ask the agent to call tools_schema with name: "generate_image" first, as the tools page advises, and then send a body like this one. Naming the family (here Nano Banana 2) pins the edit to one model; leaving it out lets Auto choose.
{
"idempotency_key": "edit-sku-1042-v1",
"payload": {
"model": "google/nano-banana-2",
"prompt": "Change the shirt to navy. Keep face, pose and background identical.",
"input_references": [
{"type": "image_url", "image_url": {"url": "https://example.com/sku-1042.png"}}
],
"aspect_ratio": "auto"
}
}Keep the agent honest
The docs' upload flow for private files is create upload URL, PUT the bytes, then complete; for generation requests they prefer public HTTPS media URLs.
- Use one idempotency key per intended edit, and reuse it on a retry of that same edit.
- Only hand the agent public HTTPS image URLs; hosted MCP cannot read files from your laptop.
- Tell it which model to pin when you need repeatable edits.
Sources
Related posts
More in Agents
- Parallel tool calls on a voice agent: one idempotency key each
ElevenLabs agents default enable_parallel_tool_calls to true. If tools start paid jobs, give each call its own key and wait on all job ids in one batch.
- Gemini 4 Argon is announced but not public: what to run today
Google announced Gemini 4 Argon on Sept 30 with access limited to cyber defenders. Here is what a Sume Format run uses as its orchestrator meanwhile.
- Gemini managed agents background:true vs a Sume Format 202 receipt
Both return an id to poll instead of holding the connection. Compare the Gemini background flag with the Sume Format run receipt and its four URLs.
- Grok 4.7 Fast is only in Cursor and Grok Build, at 2x the rate
xAI's pricing page says Grok 4.7 Fast is not on the public API. Where it runs, what it costs, and what to do if your Sume agent needs a Grok model.
Written by Sume