Nbility logoNbility Docs

Search documentation

Search guides and API reference content

Images

Seedream 5.5 Images API

Use seedream-5-5 for text-to-image generation, reference image editing, transparent backgrounds, and layer decomposition. Create or select an API key in the seedream group under API Keys. Send all requests to https://api.nbility.ai.

Endpoints and authentication

PurposeMethod and path
Generate images with text or referencesPOST /v1/images/generations
Edit images using JSON or multipartPOST /v1/images/edits
Retrieve a Nbility asynchronous image taskGET /v1/images/tasks/{task_id}
export NBILITY_API_KEY="YOUR_API_KEY"
export BASE_URL="https://api.nbility.ai"

Every request, including polling, requires Authorization: Bearer $NBILITY_API_KEY. The polling key must belong to the same account that submitted the task.

Generate an image

curl "$BASE_URL/v1/images/generations" \
  -H "Authorization: Bearer $NBILITY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedream-5-5",
    "prompt": "An orange glass ball on a light blue background, soft studio lighting",
    "size": "1K",
    "n": 1,
    "response_format": "url"
  }'

Without the asynchronous header, the request waits for the image and returns HTTP 200. Allow a generous client timeout or use asynchronous submission for short-lived connections.

{
  "created": 1796036400,
  "data": [{"url": "https://example.com/generated.png", "size": "1024x1024"}],
  "usage": {"input_images": 0, "generated_images": 1}
}

Available response fields depend on the result. Download images you need to retain; result URLs are not permanent storage.

Asynchronous submission and polling

Add X-New-Api-Async-Task: true (or 1) to the same generation or editing request. Once accepted, Nbility returns HTTP 200 without waiting for the image:

curl "$BASE_URL/v1/images/generations" \
  -H "Authorization: Bearer $NBILITY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-New-Api-Async-Task: true" \
  -d '{"model":"seedream-5-5","prompt":"An orange glass ball on a light blue background","size":"2K"}'
{"code":"success","message":"success","data":{"task_id":"task_example","status":"submitted"}}

Save data.task_id. Poll at intervals of at least 3 seconds, or follow the Retry-After response header:

curl "$BASE_URL/v1/images/tasks/task_example" \
  -H "Authorization: Bearer $NBILITY_API_KEY"
{
  "code": "success",
  "message": "success",
  "data": {
    "task_id": "task_example",
    "status": "succeeded",
    "status_raw": "SUCCESS",
    "progress": "100%",
    "submit_time": 1796036400,
    "finish_time": 1796036432,
    "image_urls": ["https://example.com/generated.png"],
    "data": {"data": [{"url": "https://example.com/generated.png", "size": "2048x2048"}]}
  }
}
  • Continue polling for submitted, queued, or in_progress. On succeeded, read data.image_urls or data.data.data. On failed, read data.fail_reason and stop polling.
  • Asynchronous retrieval returns image URLs. Download and encode them if you need Base64. Synchronous calls support response_format: "b64_json".
  • Accepted tasks continue running and settling after a disconnect. Do not automatically resubmit on a timeout: another submission can generate and charge for another result.
  • Task duration in usage logs measures total time from submission to completion, including queueing and polling delay.

Parameters

ParameterTypeDescription
modelstring, requiredseedream-5-5
promptstringRequired for ordinary generation and editing; optional for layer decomposition
sizestringDefault 2K; supports 1K, 1.5K, 2K, 3K, widthxheight, or a ratio listed below
resolutionstringApplies only when size is a ratio; 1K / 1.5K / 2K / 3K, default 2K
imagestring or string[]Reference URLs or data:image/...;base64,...; up to 10 images, at least 1 for editing
nintegerMust be 1; use max_images to limit decomposed layers
response_formatstringSynchronous calls support url (default) and b64_json
backgroundstringauto, opaque, or transparent; omit for layer decomposition
output_formatstringpng or jpeg; use png for transparency
watermarkbooleanDefault false
seedintegerOptional random seed; identical results are not guaranteed
layer_decompositionbooleanSet to true to split an image into layers; default false
layer_decomposition_optionsobjectSee below

Supported size ratios: 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 21:9, 2:1, 1:2. For example, "size":"16:9","resolution":"3K" maps to 3840x2160.

Explicit dimensions must contain 921,600–8,294,400 pixels, with an aspect ratio between 1:16 and 16:1. Legacy 256x256 and 512x512 requests generate 1024x1024. Ordinary generation does not support auto. Streaming (stream: true) and sequential multi-image generation are not supported.

Reference editing and transparency

curl "$BASE_URL/v1/images/edits" \
  -H "Authorization: Bearer $NBILITY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model":"seedream-5-5",
    "prompt":"Keep the product and remove its background, producing a transparent product image",
    "image":["https://example.com/product.png"],
    "size":"1K",
    "background":"transparent",
    "output_format":"png"
  }'

Use multipart for local files. Let curl set Content-Type with its boundary:

curl "$BASE_URL/v1/images/edits" \
  -H "Authorization: Bearer $NBILITY_API_KEY" \
  -F model=seedream-5-5 \
  -F 'prompt=Preserve the person and turn the portrait into a watercolor painting' \
  -F size=2K \
  -F 'image=@portrait.png'

Repeat the image[] field for multiple files. Each upload must be at most 30 MiB. Do not mix uploaded files with URL/data URL references, or supply image alongside other reference aliases.

Layer decomposition

Supply exactly one reference image and set layer_decomposition: true. Supported sizes are auto (default), 1K, 1.5K, and 2K. max_images is an integer from 2 to 100, default 30. text_recognition is a boolean, default false.

curl "$BASE_URL/v1/images/generations" \
  -H "Authorization: Bearer $NBILITY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-New-Api-Async-Task: true" \
  -d '{
    "model":"seedream-5-5",
    "image":["https://example.com/poster.png"],
    "layer_decomposition":true,
    "layer_decomposition_options":{"max_images":4,"text_recognition":true},
    "size":"auto"
  }'

Omit background. The actual number of layers may be below the limit. Layers may have different dimensions and are billed individually.

Four output pricing tiers

Prices below are in platform credits per image. A ¥1 top-up purchases 1 platform credit. Check Model Pricing for current rates.

ItemPixel area per imagePrice
Reference inputEach input reference image0.052
1K output≤ 1,400,0000.1352
1.5K output> 1,400,000 and ≤ 2,610,0000.1872
2K output> 2,610,000 and ≤ 4,630,0000.2392
3K output> 4,630,000 and ≤ 8,294,4000.5408

Cost = reference count × 0.052 + the tier price of each delivered image. Tiers use actual width × height, not the longest edge. For example, 2048x1024 falls in the 1.5K tier; two references plus this output cost 0.2912 credits.

Layer decomposition reserves credit for max_images. With size:auto, each reserved output uses the highest 3K tier. Completion settles the actual dimensions and count and refunds the difference. One reference with up to four layers at auto reserves 2.2152 credits; if two 1K layers are returned, the final charge is 0.3224 and the refund is 1.8928. Failed tasks follow Nbility's task refund process. Polling does not charge another image generation fee.

Table of Contents