Create image

POST/v1/images/generations

Create an image from text, or create/edit an image from text plus one or more input images. Image generation responses are returned directly from this request; unlike video generation, there is no submit-and-poll task flow. Use the returned data[].url to download the image directly. To use the dedicated image download or delete endpoints, first retrieve the image record ID from GET /v1/images.

Authentication

Authorization Bearer

API key as bearer token in Authorization header.

Request Body

modelstringrequired

Model ID.

promptstringrequired

Image generation prompt.

ninteger

Number of images to generate.

sizestring

Requested output image dimensions, such as width-by-height, when the model uses explicit image size values.

aspect_ratiostring

Requested output image shape as a width-to-height ratio.

resolutionstring

Requested output image resolution or resolution tier.

qualitystring

Requested generation quality or fidelity tier.

seedinteger

Optional numeric seed for repeatable generation when deterministic seeding is supported.

prompt_extendboolean

Prompt extension flag.

negative_promptstring

Negative prompt.

max_reference_imagesinteger

Reference image limit.

watermarkboolean

Controls whether generated images include a watermark when supported.

response_formatstring

Response format.

imagesarray

Reference images.

sequential_image_generationstring

Sequential image generation mode.

sequential_image_generation_optionsobject

Sequential image generation configuration.

sequential_image_generation_options.max_imagesinteger

Maximum number of images to generate in sequential mode.

optimize_prompt_optionsobject

Prompt optimization configuration.

optimize_prompt_options.modestring

Prompt optimization mode, such as standard or fast.

strengthnumber

Input image influence strength.

enable_interleaveboolean

Interleaved generation flag.

enable_web_searchboolean

Web search flag.

output_formatstring

Requested file format for generated image outputs.

streamboolean

Streaming response flag.

metadataobject

Application metadata.

extra_bodyobject

Additional request body fields.

provider_optionsobject

Upstream configuration.

Response

createdinteger

Unix timestamp.

modelstring

Model identifier that served the request.

dataobject[]

Generated images.

data.urlstring

URL to download the generated image.

data.b64_jsonstring

Base64-encoded image when returned by the model.

data.output_formatstring

Output image format when returned by the model, for example jpeg or png.

data.sizestring

Output image dimensions when returned by the model, in <width>x<height> format.

data.errorobject | null

Per-image error details for failed image generations.

usageobject

Usage stats for the request.

usage.generated_imagesinteger

Number of images successfully generated by the model.

usage.input_imagesinteger

Number of input reference images when returned by the model.

usage.output_tokensinteger

Output token usage for generated images when returned by the model.

usage.total_tokensinteger

Total token usage for this request when returned by the model.

errorobject

Request-level error details when an error payload is returned.

error.codestring

Error code.

error.messagestring

Error message.

Request

1curl -X POST https://api.token360.ai/v1/images/generations \
2  -H "Authorization: Bearer sk-your-api-key" \
3  -H "Content-Type: application/json" \
4  -d '{
5    "model": "dola-seedream-5.0-pro",
6    "prompt": "A minimalist sunrise over calm water, digital illustration",
7    "size": "2K",
8    "output_format": "png",
9    "watermark": false
10  }'

Response

JSON
1{
2  "created": 1776352070,
3  "model": "dola-seedream-5.0-pro",
4  "data": [
5    {
6      "url": "your-generated-image-url",
7      "output_format": "png",
8      "size": "2048x2048"
9    }
10  ],
11  "usage": {
12    "generated_images": 1,
13    "input_images": 0,
14    "output_tokens": 16384,
15    "total_tokens": 16384
16  }
17}
Was this page helpful?