Skip to main content
Glama

Edit Image

edit_image

Edit or transform existing images through POST /v1/tasks with the REST request body { model, route?, input, callback?, storage? }. Pass the model's published fields inside input, or use the convenience top-level prompt/aspect_ratio/resolution/background/output_format/image_urls fields. Default model: gpt-image-2.5-sunburst/image-to-image (1-16 source images via image_urls). Any live image model that publishes a reference-image field also works (for example nano-banana-2, nano-banana-pro or flux-2-klein-4b/image-to-image); source images passed through the top-level aliases are mapped onto that model's published field. route, callback and storage work exactly as in POST /v1/tasks. A model or route that is not in the public catalog is submitted verbatim for the backend to authorize. Asynchronous: it only submits the task and returns a task_id immediately, never the result. To retry safely after a timeout or dropped connection, pass an idempotency_key and reuse it on the retry; HiAPI then returns the original task instead of charging twice. Call get_task_status with that task_id to fetch the result.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "edit_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
inputNoThe model's input object, exactly as in POST /v1/tasks. It may contain any field the model publishes — call get_model_schema for the authoritative list. Values here win over the convenience top-level fields and over the legacy params alias.
modelNoEditing model: gpt-image-2.5-sunburst/image-to-image (default), or any live image model with a published reference-image field (nano-banana-2, nano-banana-pro, flux-2-klein-4b/image-to-image, ...).
routeNoREST top-level model route, for example pro, ext or beta. Sent next to model (never concatenated). The catalog is consulted as model@route first, then model; a route that is not public is still submitted for the backend to authorize.
promptNoDescription of the desired edit. Becomes input.prompt in the REST body.
storageNoREST top-level storage tier: temp (default, kept about 7 days) or persistent (kept long-term, billed by size). Insufficient balance silently downgrades to temp.
callbackNoREST top-level callback: HiAPI POSTs to url when the task reaches a terminal state (success or failure), so you can skip polling. url is required; when defaults to final.
backgroundNoREST field background for gpt-image-2.5-sunburst: transparent, opaque or auto. Supported only at 1K resolution; omit for 2K/4K.
image_urlsNoREST field image_urls: source image URLs or data:image/... URIs (up to 16 for gpt-image-2.5-sunburst, up to 8 for nano-banana models).
resolutionNoREST field resolution: 1K, 2K, 4K.
aspect_ratioNoREST field aspect_ratio. Examples: auto, 1:1, 16:9, 9:16, 4:3, 3:4. gpt-image-2.5-sunburst also accepts 3:2, 2:3, 5:4, 4:5, 21:9, 27:16, 16:27, 9:8, 8:9.
output_formatNoREST field output_format for nano-banana-2 / nano-banana-pro: png or jpg. gpt-image-2.5-sunburst has no output_format field.
idempotency_keyNoOptional key for this job (max 255 bytes), e.g. a fresh UUID. If this call times out or the connection drops, retry with the same key: HiAPI returns the original task instead of charging a second one. The key is kept about 24 hours and replays even a failed task, so use a new key for every new generation. Without a key every call creates and charges a new task.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed19 schema fields changed
    • changedInput schema / properties / aspect_ratio / description
      Previous value: -"Output aspect ratio. Examples: auto, 1:1, 16:9, 9:16, 4:3, 3:4. gpt-image-2.5-sunburst also accepts 3:2, 2:3, 5:4, 4:5, 21:9, 27:16, 16:27, 9:8, 8:9."New value: +"REST field aspect_ratio. Examples: auto, 1:1, 16:9, 9:16, 4:3, 3:4. gpt-image-2.5-sunburst also accepts 3:2, 2:3, 5:4, 4:5, 21:9, 27:16, 16:27, 9:8, 8:9."
    • changedInput schema / properties / background / description
      Previous value: -"gpt-image-2.5-sunburst only: transparent, opaque or auto. Supported only at 1K resolution; omit for 2K/4K."New value: +"REST field background for gpt-image-2.5-sunburst: transparent, opaque or auto. Supported only at 1K resolution; omit for 2K/4K."
    • addedInput schema / properties / callback
      Added value: +{
      +  "description": "REST top-level callback: HiAPI POSTs to url when the task reaches a terminal state (success or failure), so you can skip polling. url is required; when defaults to final.",
      +  "properties": {
      +    "url": {
      +      "description": "http(s) URL HiAPI notifies when the task finishes or fails.",
      +      "type": "string"
      +    },
      +    "when": {
      +      "description": "When to notify. Currently only final.",
      +      "enum": [
      +        "final"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "url"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / idempotency_key
      Added value: +{
      +  "description": "Optional key for this job (max 255 bytes), e.g. a fresh UUID. If this call times out or the connection drops, retry with the same key: HiAPI returns the original task instead of charging a second one. The key is kept about 24 hours and replays even a failed task, so use a new key for every new generation. Without a key every call creates and charges a new task.",
      +  "type": "string"
      +}
    • removedInput schema / properties / image_base64
      Removed value: -{
      -  "description": "Source image base64 without the data URI prefix. Pair with image_mime_type when possible.",
      -  "type": "string"
      -}
    • removedInput schema / properties / image_data_uri
      Removed value: -{
      -  "description": "Source image as a data URI, for example data:image/png;base64,...",
      -  "type": "string"
      -}
    • removedInput schema / properties / image_data_uris
      Removed value: -{
      -  "description": "Multiple source images as data URI strings.",
      -  "items": {
      -    "type": "string"
      -  },
      -  "type": "array"
      -}
    • removedInput schema / properties / image_mime_type
      Removed value: -{
      -  "description": "MIME type for image_base64. Supported: image/jpeg, image/png, image/webp. Default: image/png.",
      -  "type": "string"
      -}
    • removedInput schema / properties / image_size
      Removed value: -{
      -  "description": "Output resolution tier (alias for resolution): 1K, 2K, 4K.",
      -  "type": "string"
      -}
    • removedInput schema / properties / image_url
      Removed value: -{
      -  "description": "Public URL or data:image/... URI of the source image to edit",
      -  "type": "string"
      -}
    • changedInput schema / properties / image_urls / description
      Previous value: -"Multiple source image URLs or data:image/... URIs (up to 16 for gpt-image-2.5-sunburst, up to 8 for nano-banana models)."New value: +"REST field image_urls: source image URLs or data:image/... URIs (up to 16 for gpt-image-2.5-sunburst, up to 8 for nano-banana models)."
    • removedInput schema / properties / images
      Removed value: -{
      -  "description": "Multiple source images (up to 16 for gpt-image-2.5-sunburst, up to 8 for nano-banana models). Each item can contain url, data_uri, base64, and mime_type.",
      -  "items": {
      -    "properties": {
      -      "base64": {
      -        "type": "string"
      -      },
      -      "data_uri": {
      -        "type": "string"
      -      },
      -      "mime_type": {
      -        "type": "string"
      -      },
      -      "url": {
      -        "type": "string"
      -      }
      -    },
      -    "type": "object"
      -  },
      -  "type": "array"
      -}
    • addedInput schema / properties / input
      Added value: +{
      +  "description": "The model's input object, exactly as in POST /v1/tasks. It may contain any field the model publishes — call get_model_schema for the authoritative list. Values here win over the convenience top-level fields and over the legacy params alias.",
      +  "type": "object"
      +}
    • changedInput schema / properties / output_format / description
      Previous value: -"Output format for nano-banana-2 / nano-banana-pro: png or jpg. gpt-image-2.5-sunburst has no output_format field."New value: +"REST field output_format for nano-banana-2 / nano-banana-pro: png or jpg. gpt-image-2.5-sunburst has no output_format field."
    • changedInput schema / properties / prompt / description
      Previous value: -"Description of the desired edit"New value: +"Description of the desired edit. Becomes input.prompt in the REST body."
    • changedInput schema / properties / resolution / description
      Previous value: -"Output resolution tier: 1K, 2K, 4K."New value: +"REST field resolution: 1K, 2K, 4K."
    • addedInput schema / properties / route
      Added value: +{
      +  "description": "REST top-level model route, for example pro, ext or beta. Sent next to model (never concatenated). The catalog is consulted as model@route first, then model; a route that is not public is still submitted for the backend to authorize.",
      +  "type": "string"
      +}
    • addedInput schema / properties / storage
      Added value: +{
      +  "description": "REST top-level storage tier: temp (default, kept about 7 days) or persistent (kept long-term, billed by size). Insufficient balance silently downgrades to temp.",
      +  "enum": [
      +    "temp",
      +    "persistent"
      +  ],
      +  "type": "string"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "prompt"
      -]
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the annotations: discloses that it only submits and returns a task_id (never the result), that billing occurs per submission, that idempotency_key replays even failed tasks and is kept ~24h, and that insufficient balance silently downgrades storage to temp. These are exactly the mutation/cost behaviors an agent needs before calling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the core action and endpoint, then layers async/idempotency/retrieval guidance in a sensible order. It is dense and somewhat long, with minor repetition of route/callback/storage semantics that the schema already covers, but the length is defensible for a 12-parameter tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, yet the description fully covers the return contract (task_id only, no result), the follow-up call (get_task_status), retry safety, and storage lifecycle. Nothing an agent needs to invoke this correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already documents each parameter. The description still adds conceptual framing the schema alone does not make obvious: the REST body shape, that input values win over the top-level convenience aliases, and that top-level aliases are mapped onto the selected model's published reference-image field.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('edit or transform existing images'), names the endpoint and default model (image-to-image), and implicitly separates itself from generate_image by working on existing source images. An agent can distinguish this from every sibling without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states the async contract, that the result must be fetched with get_task_status, that get_model_schema is authoritative for per-model fields, and when/how to use idempotency_key on retries. It does not explicitly state when to prefer generate_image over this tool for new images, which is the only missing routing cue.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources