Edit Image
Status: Published
Status basis: requires an enabled image editing/generation model
Image editing endpoint. The request body uses application/json and reference images are passed by URL. Prefer images[].image_url; image (a single URL string, URL array, or object) and image_urls (URL string array) are also accepted as compatibility fields. Optional parameters include mask, n, size, quality, response_format, background, output_format, output_compression, moderation, watermark, and user.
curl -X POST "https://api.routescope.ai/v1/images/edits" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-image-2", "prompt": "Generate a new image based on these two reference images.", "images": [ { "image_url": "https://example.com/a.png" }, { "image_url": "https://example.com/b.png" } ], "size": "1024x1024" }'{
"created": 1,
"data": {}
}Authorization
BearerAuth
Model relay endpoint authentication. Header: Authorization: Bearer .
In: header
Request Body
application/json
Model name. The Tencent TokenHub channel maps it inside the gateway to the upstream model name.
"gpt-image-2"Image editing prompt.
Recommended JSON URL image input. Each item is a single image URL object.
Compatibility field: accepts a single URL string, a URL array, or an object. Prefer images[].image_url.
Compatibility field: a URL string array. Prefer images[].image_url.
Optional. Mask image URL; transparent areas mark the regions to edit.
uriNumber of images to generate.
int321 <= valueOutput image size.
"1024x1024"Image quality. Allowed values depend on the upstream model.
Response format. Supports url or b64_json; can be omitted by default and support varies across upstream channels.
"url" | "b64_json"Background fill mode. Support depends on the model.
"auto""transparent" | "opaque" | "auto"Output format. Allowed values depend on the upstream model.
Output compression level. Applies to jpeg and webp only.
90int320 <= value <= 100Moderation strength. Support depends on the model.
"auto""auto" | "low"Whether to add a watermark. Support depends on the upstream channel.
falseEnd-user identifier; useful for abuse monitoring.
Response Body
application/json
Last updated on