Routescope APIRoutescope API
Image ModelsDoubao Seedream

Image Editing

Doubao Seedream image editing API

Doubao Seedream image editing uses /v1/images/edits. It supports reference-image editing, multi-image blending, and visual repainting. Reference images are passed through the JSON image field, not the OpenAI-style file-upload protocol.

POST
/v1/images/edits
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

AuthorizationBearer <token>

Model relay endpoint authentication. Header: Authorization: Bearer .

In: header

Request Body

application/json

model*string

Model name. The Tencent TokenHub channel maps it inside the gateway to the upstream model name.

Default"gpt-image-2"
prompt*string

Image editing prompt.

images?

Recommended JSON URL image input. Each item is a single image URL object.

image?string||

Compatibility field: accepts a single URL string, a URL array, or an object. Prefer images[].image_url.

image_urls?array<string>

Compatibility field: a URL string array. Prefer images[].image_url.

mask?string

Optional. Mask image URL; transparent areas mark the regions to edit.

Formaturi
n?integer

Number of images to generate.

Formatint32
Range1 <= value
size?string

Output image size.

Default"1024x1024"
quality?string

Image quality. Allowed values depend on the upstream model.

response_format?string

Response format. Supports url or b64_json; can be omitted by default and support varies across upstream channels.

Value in"url" | "b64_json"
background?string

Background fill mode. Support depends on the model.

Default"auto"
Value in"transparent" | "opaque" | "auto"
output_format?string

Output format. Allowed values depend on the upstream model.

output_compression?integer

Output compression level. Applies to jpeg and webp only.

Default90
Formatint32
Range0 <= value <= 100
moderation?string

Moderation strength. Support depends on the model.

Default"auto"
Value in"auto" | "low"
watermark?boolean

Whether to add a watermark. Support depends on the upstream channel.

Defaultfalse
user?string

End-user identifier; useful for abuse monitoring.

Response Body

application/json

Model Selection

Model IDTypical Use
doubao-seedream-4-0-250828Reference-image editing, multi-image blending, and image repainting.
doubao-seedream-4-5-251128High-quality reference-image editing, multi-image blending, and high-consistency edits.
doubao-seedream-5-0-260128High-quality reference-image editing, multi-image blending, and complex visual repainting.
doubao-seedream-5-0-lite-260128Lightweight editing, low-latency revisions, and batch sketch iteration.

Common Parameters

FieldTypeRequiredDefaultDescription
modelstringYesNoneSeedream editing model ID.
promptstringYesNoneEditing instruction. Clearly specify what to keep, what to modify, and the target style.
imagestring or string[]YesNoneSource/reference image URL or Base64. Recommended maximum is 14 images.
sizestringNo1920x1920Edit output size. Prefer <width>x<height>. Total pixels must not be below 3686400.
response_formatstringNoNoneResponse format, supporting url or b64_json. Usually no need to pass it.
watermarkbooleanNotrueWhether to add an AI-generated watermark.
streambooleanNofalseWhether to enable streaming output. Seedream 5.0 Lite editing does not list stream.

Model-Specific Parameters

FieldApplicable ModelsDefault / RangeDescription
sizeSeedream 4.0 / 4.5 / 5.0 / 5.0 LiteDefault 1920x1920Prefer <width>x<height>. Total pixels must not be below 3686400. Actual availability depends on the channel.
streamSeedream 4.0 / 4.5 / 5.0Default falseSeedream 5.0 Lite editing does not list stream, so do not include it in Lite editing examples.

Example Code

curl https://api.routescope.ai/v1/images/edits \
  -H "Authorization: Bearer $ROUTESCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedream-5-0-260128",
    "prompt": "Keep the main building, change the scene to a cyberpunk night view with neon lights and high detail",
    "image": "https://example.com/building.png",
    "size": "1920x1920"
  }'
import requests

response = requests.post(
    "https://api.routescope.ai/v1/images/edits",
    headers={"Authorization": "Bearer YOUR_ROUTESCOPE_API_KEY"},
    json={
        "model": "doubao-seedream-5-0-260128",
        "prompt": "Keep the main building, change the scene to a cyberpunk night view with neon lights and high detail",
        "image": "https://example.com/building.png",
        "size": "1920x1920",
    },
)
print(response.json())

Response Example

{
  "created": 1777432320,
  "data": [
    {
      "url": "https://api.routescope.ai/assets/images/seedream-5-0-edit.png",
      "b64_json": null,
      "revised_prompt": "Keep the main building, cyberpunk night style, neon lights, high detail."
    }
  ]
}

Notes

  • Billing follows the model and channel ratios configured in the Routescope backend.
  • Lite models are better for lightweight editing. Prefer non-Lite models for complex consistency editing.
  • High-resolution edits take longer than standard text-to-image generation.

How is this guide?

Last updated on