ByteDance: Seedream 5.0 Flash (Image to Image) API Reference

About

ByteDance Seedream 5.0 Flash generates a single image from a text prompt and up to 10 reference images through BytePlus ModelArk. This Image to Image endpoint supports 1K, 1.5K, 2K size presets and custom pixel dimensions within the model limits, with optional watermark control. JPEG and PNG output formats are available. Generation is exposed through asynchronous platform tasks.

1. Calling the API

Setup your API Key

To begin using Infron, you first need to create an account and generate your API Key.

Once you have your API key, set it as an environment variable in your runtime environment. This allows your applications to securely access Infron’s API.

export INFRON_KEY="YOUR_API_KEY"

Submit a request

For long-running requests, you can poll for results.

curl https://media.onerouter.pro/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "bytedance/seedream-5.0-flash/image-to-image",
  "prompt": "Preserve the main subject in the reference image and change the background to soft blue.",
  "image_urls": [
    "https://arkdocs-en.tos-ap-southeast-1.volces.com/images/image-generation/seedream4_imagesToimages_1.png"
  ]
}'

Response with queue task id

The response will look like this:

{
  "code": 200,
  "message": "success",
  "data": {
    "task_id": "TASK_ID",
    "object": "image",
    "model": "bytedance/seedream-5.0-flash/image-to-image",
    "status": "created",
    "urls": {
      "query": "https://media.onerouter.pro/v1/images/tasks/TASK_ID"
    },
    "created_at": "YYYY-MM-DD HH:MM:SS"
  }
}

Fetch request status

You can fetch the status of a request to check if it is completed or still in progress.

curl https://media.onerouter.pro/v1/images/tasks/{task_id} \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response with queue task status query

{
  "code": 200,
  "message": "success",
  "data": {
    "task_id": "TASK_ID",
    "object": "image",
    "model": "bytedance/seedream-5.0-flash/image-to-image",
    "status": "in_progress",
    "fail_reason": "",
    "submit_time": 0,
    "start_time": 0,
    "finish_time": 0,
    "outputs": [],
    "created_at": "YYYY-MM-DD HH:MM:SS"
  }
}

Possible statuses:

  • created
  • in_progress
  • queued
  • completed
  • failed

created -> in_progress → queued → completed | failed

Poll every 1-2 seconds until status is "completed" or "failed"

Get the result (when status is "completed")

Once the request is completed, you can fetch the result. See the Output Schema for the expected result format.

{
  "code": 200,
  "message": "success",
  "data": {
    "task_id": "TASK_ID",
    "object": "image",
    "model": "bytedance/seedream-5.0-flash/image-to-image",
    "status": "completed",
    "fail_reason": "",
    "submit_time": 0,
    "start_time": 0,
    "finish_time": 0,
    "outputs": [
      "OUTPUT_IMAGE_URL"
    ],
    "usage": {
      "image_count": 1
    },
    "cost": {
      "total_cost": 0.018
    },
    "created_at": "YYYY-MM-DD HH:MM:SS"
  }
}

2. Schema

Input

ParameterTypeRequiredDefaultRangeDescription
modelstringYes--bytedance/seedream-5.0-flash/image-to-imagePublic model ID.
promptstringYes----Text prompt describing the requested single image.
image_urlsarrayYes--1–10Ordered, publicly accessible reference image URLs.
sizestringNoUpstream default: 2K1K, 1.5K, 2K, WIDTHxHEIGHTCustom area 921,600–4,624,220 pixels; width/height ratio 1:16–16:1.
nintegerNo11This endpoint returns a single output image.
watermarkbooleanNofalsetrue, falseAdd or omit the upstream AI-generated watermark.
output_formatstringNoUpstream default: jpegjpeg, pngImage encoding supported by this model.
providerobjectNo--Platform routing optionsSelect the provider and service tier.
queuebooleanNotruePlatform-managedGeneration uses an asynchronous platform task.
webhook_urlstringNo--Callback URLOptional existing task completion callback.

Only single-image output is exposed. Sequential generation, prompt-optimization modes and streaming are not enabled on this platform endpoint. Unsupported fields are filtered before the BytePlus request.

Example request

curl https://media.onerouter.pro/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "bytedance/seedream-5.0-flash/image-to-image",
  "prompt": "Preserve the main subject in the reference image and change the background to soft blue.",
  "image_urls": [
    "https://arkdocs-en.tos-ap-southeast-1.volces.com/images/image-generation/seedream4_imagesToimages_1.png"
  ],
  "size": "2K",
  "n": 1,
  "watermark": true,
  "output_format": "png"
}'

Output

ParameterTypeRangeDescription
codeinteger--Status code of the request.
messagestring--Status message of the request.
dataobject--Data of the task.
data.task_idstring--ID of the task.
data.objectstring--Object type of the task.
data.modelstring--Model name of the task.
data.statusstringcreated, in_progress, queued, completed, failedStatus of the task.
data.fail_reasonstring--Fail reason of the task.
data.submit_timeinteger--Timestamp of the task submission.
data.start_timeinteger--Timestamp of the task start.
data.finish_timeinteger--Timestamp of the task finish.
data.outputsarray--Outputs of the task.
data.created_atstring--Timestamp of the task creation.

Example output

{
  "code": 200,
  "message": "success",
  "data": {
    "task_id": "TASK_ID",
    "object": "image",
    "model": "bytedance/seedream-5.0-flash/image-to-image",
    "status": "completed",
    "fail_reason": "",
    "submit_time": 0,
    "start_time": 0,
    "finish_time": 0,
    "outputs": [
      "OUTPUT_IMAGE_URL"
    ],
    "usage": {
      "image_count": 1
    },
    "cost": {
      "total_cost": 0.018
    },
    "created_at": "YYYY-MM-DD HH:MM:SS"
  }
}

3. Detailed Pricing

Generation TypeOutput ImagesEstimated Price
Image to Image1$0.018
Multi-reference Image to Image1$0.018

Input reference images are free. Prices are in USD per successfully generated output image.