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

Image model ID.

promptstringrequired

Text description of the image to generate.

ninteger

Number of generated images. Availability depends on the selected model.

sizestringdefault:model default

Image dimensions or resolution enum. Availability depends on the selected model.

Example: "1024x1024"

response_formatstring

Image response format. Availability depends on the selected model.

watermarkboolean

Whether to include the provider watermark. Availability depends on the selected model.

seedinteger

Random seed. Availability depends on the selected model.

sequential_image_generationstring

Sequential generation mode. Availability depends on the selected model.

qualitystring

Output quality. Availability depends on the selected model.

ratiostring

Output aspect ratio. Availability depends on the selected model.

Model-Specific Notes

  • Kling Image O1: exposes model-specific n and size controls on its model card.
  • Seedream 4.5: exposes model-specific seed, watermark, response_format, and sequential_image_generation controls on its model card.
  • Seedream 4.0: exposes model-specific seed, watermark, response_format, and sequential_image_generation controls on its model card.
  • Dola-Seedream-5.0-lite: exposes model-specific seed and watermark controls on its model card.
  • Nano Banana Pro: exposes model-specific ratio and quality controls on its model card.
  • GLM-Image: does not expose additional unified image parameters.

Response

createdinteger

Unix timestamp.

modelstring

Provider-side 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.

usageobject

Usage stats such as generated_images, output_tokens, and total_tokens.

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-lite",
6    "prompt": "A minimalist sunrise over calm water, digital illustration",
7    "size": "2048x2048"
8  }'

Response

JSON
1{
2  "created": 1776352070,
3  "model": "dola-seedream-5.0-lite",
4  "data": [
5    {
6      "url": "your-generated-image-url"
7    }
8  ],
9  "usage": {
10    "generated_images": 1,
11    "output_tokens": 16384,
12    "total_tokens": 16384
13  }
14}
Was this page helpful?