Generate Image
Generate an image from a text prompt.
Request Conventions
| Item | Value |
|---|---|
| Base URL | https://token.wdcloud.ai |
| Authentication header | Authorization: Bearer <API_KEY> |
| JSON content type | Content-Type: application/json |
Endpoint
POST /v1/images/generations
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Text description of the image |
model | string | No | Image generation model ID, such as gpt-image-2 or doubao-seedream-* |
n | integer | No | Number of images, from 1 to 10 |
size | string | No | Output dimensions; supported 1K dimensions are listed below |
quality | string | No | Output quality |
background | string | No | Alpha-channel mode; see the Volcengine Seedream values and restrictions below |
output_format | string | No | Image file format; Volcengine Seedream supports png and jpeg; transparent images require png |
response_format | string | No | Delivery format (such as url or b64_json), not the image file format |
images | array<string> | No | Reference image URL list for image-to-image generation |
Supported size Values
| Aspect ratio | 1K |
|---|---|
1:1 | 1024x1024 |
5:4 | 1040x832 |
9:16 | 720x1280 |
16:9 | 1280x720 |
4:3 | 1024x768 |
3:2 | 1008x672 |
4:5 | 832x1040 |
3:4 | 768x1024 |
2:3 | 672x1008 |
21:9 | 1344x576 |
Volcengine Seedream: Using background
background controls whether the output image has an alpha (transparency) channel. The following rules apply to Volcengine Ark Seedream; other image models may support different values or combinations.
| Model | Default | Supported values | Input requirements for transparent |
|---|---|---|---|
| Seedream 5.5 | auto | auto, transparent, opaque | Supports text-to-image and image-to-image with up to 10 reference images; references do not need an alpha channel |
| Seedream 5.0 pro / 5.0 flash | opaque | transparent, opaque | No transparent text-to-image generation; supply exactly one reference image that already has an alpha channel through image |
auto: The model decides based on the prompt andoutput_format; JPEG output has no alpha channel. Only Seedream 5.5 supports this value.transparent: Produces an RGBA image with an alpha channel. Explicitly setoutput_format: "png"; combining it withoutput_format: "jpeg"causes a parameter error. The default output format for 5.0 pro / flash is JPEG, so setting onlybackground: "transparent"is insufficient.opaque: Produces an RGB image without an alpha channel.- Omit
backgroundentirely whenlayer_decomposition: true. Passing it causes an error, even withopaqueorauto. Decomposed layers are always transparent PNGs and do not need this parameter; in this mode,output_formatonly controls the base image's file format. response_format: "url"or"b64_json"only controls image delivery and does not replaceoutput_format: "png".
Example: Transparent PNG from Text with Seedream 5.5
Use a model ID enabled on the platform and routed to Volcengine Seedream 5.5; this example uses doubao-seedream-5-5-261028. Add references through image for image-to-image generation; do not substitute another model's images field for the native Volcengine parameter.
bash
curl -X POST "https://token.wdcloud.ai/v1/images/generations" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedream-5-5-261028",
"prompt": "Generate a red ceramic cup product asset on a transparent background, preserving the entire outline of the cup.",
"size": "2K",
"background": "transparent",
"output_format": "png",
"response_format": "url"
}'See the Volcengine Ark image generation API documentation for parameter definitions and model capabilities.
Request Example
bash
curl -X POST "https://token.wdcloud.ai/v1/images/generations" \
-H "Authorization: Bearer sk-xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"size": "1024x1024",
"n": 1,
"response_format": "b64_json",
"images": [
"https://img.wdcloud.ai/images/2026/08/27/b986d080-6d96-442d-a864-45b0a27009a4.png",
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUg..."
],
"prompt": "Generate a city skyline image."
}'Response Example
json
{
"created": 1787312891,
"data": [
{
"revised_prompt": "Generate a city skyline image.",
"url": "https://img.wdcloud.ai/images/2026/08/27/b986d080-6d96-442d-a864-45b0a27009a4.png"
}
],
"usage": {
"input_tokens": 7,
"input_tokens_details": {
"cached_tokens": 0,
"image_tokens": 0,
"text_tokens": 7
},
"output_tokens": 1056,
"output_tokens_details": {
"image_tokens": 1056,
"reasoning_tokens": 0,
"text_tokens": 0
},
"total_tokens": 1063
}
}