Multi-Edit immagine
Edit or modify an image using up to three layered inputs (base image plus masks/overlays).
Supported input formats by Content-Type:
-
multipart/form-data: Only file uploads are supported. Send images as form file fields.
-
application/json: Base64 strings and URLs are supported:
- Raw base64 string:
"iVBORw0KGgoAAAANSUhEUgAA..." - Data URL:
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." - HTTP/HTTPS URL:
"https://example.com/image.png"
- Raw base64 string:
For models with resolution tiers that require explicit dimensions, omit aspect_ratio or set it to auto to infer the closest supported aspect ratio from the first input image. Provide aspect_ratio directly when exact output dimensions are required. Use output_format to request jpeg, jpg, png, or webp output.
Authentication: This endpoint accepts either a Bearer API key or a SIGN-IN-WITH-X header for x402 wallet-based authentication. The legacy X-Sign-In-With-X header is also accepted during migration. When using x402, a 402 Payment Required response indicates insufficient balance and includes top-up instructions.
Livelli di qualità
Alcuni modelli multi-edit accettano un parametro opzionalequality (low, medium, high) che bilancia fedeltà visiva e costo. Attualmente supportato da gpt-image-2-edit; gli altri modelli ignorano il parametro.
quality, il modello usa il proprio livello predefinito (high per gpt-image-2-edit). I prezzi per livello (1K/2K/4K × low/medium/high) si trovano sotto model_spec.pricing.quality nell’endpoint Models e sono elencati nella panoramica dei prezzi.
quality vengono fatturate al livello predefinito del modello (high per gpt-image-2-edit).Autorizzazioni
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Corpo
Edit an image by compositing up to three layered images with a single prompt. Supports base64-encoded strings and URLs.
The text directions to edit or modify the image. Short, descriptive prompts work best (e.g., "remove the tree", "change the sky to sunrise"). Character limit is model specific and is listed in the promptCharacterLimit setting in the model list endpoint.
1 - 32768Array of 1 to 3 images used for multi-editing. The first image is treated as the base image, and the remaining images are used as edit layers/masks. Each image can be a base64-encoded string or a URL starting with http:// or https://. Image dimensions must be at least 65536 pixels and must not exceed 33177600 pixels. File size must be less than 25MB.
1 - 3 elementsImage as a base64-encoded string or a URL starting with http:// or https://
The aspect ratio for the output image. Use 'auto' or omit this parameter to infer the closest supported aspect ratio from the first input image when explicit sizing is required by the model.
auto, 1:1, 3:2, 16:9, 21:9, 9:16, 2:3, 3:4, 4:5 "16:9"
The model ID to use for multi-edit.
firered-image-edit, qwen-edit, qwen-edit-uncensored, grok-imagine-edit, grok-imagine-quality-edit, qwen-image-2-edit, qwen-image-2-pro-edit, wan-2-7-pro-edit, flux-2-max-edit, gpt-image-2-edit, gpt-image-1-5-edit, nano-banana-2-edit, nano-banana-pro-edit, seedream-v5-lite-edit, seedream-v4-edit 1Output format for the edited image. Accepts jpeg, jpg, png, or webp. When omitted, the format is inferred from resolution: PNG for 1K edits and JPEG for 2K/4K edits.
jpeg, png, webp "png"
Output quality for supported models (e.g. GPT Image 2 / GPT Image 2 Edit). Higher values can increase the final request charge. See the model list for supported options.
low, medium, high "high"
Resolution tier for the output image (e.g. "1K", "2K", "4K"). Supported values vary by model - check GET /api/v1/models for model-specific options. Defaults to "1K" when not specified.
1 - 10"1K"
Whether to use safe mode. If enabled, this will blur images that are classified as having adult content.
false
Risposta
OK
The response is of type file.