POST
/
v1
/
images
/
generations
Single Image Output
curl --request POST \
  --url https://api.example.com/v1/images/generations

Single Image Output

Generate a single image using Qwen series models (doubao-seedream-4-5) with reference image and text prompts.

Endpoint

POST /v1/images/generations

Authentication

All requests require a Bearer token in the Authorization header:
Authorization: Bearer YOUR_API_KEY

Request Parameters

ParameterTypeRequiredDescription
modelstringYesModel ID, e.g., doubao-seedream-4-5-251128
promptstringYesText prompt for image generation
imagestringNoReference image URL
sizestringNoImage size. Resolution options: 1K, 2K, 4K
sequential_image_generationstringNoControls multi-image generation. auto: Model automatically determines. disabled: Only generates one image. Default: disabled
sequential_image_generation_optionsobjectNoOptions including max_images to set maximum number of images
streambooleanNoEnable streaming output mode. Default: false
response_formatstringNoOutput format: url or b64_json. Default: url
watermarkbooleanNoWhether to add watermark. Default: true

Request Example

curl -X POST "https://www.anyfast.ai/v1/images/generations" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedream-4-5-251128",
    "prompt": "A professional product design concept",
    "image": "https://example.com/reference.png",
    "size": "2K",
    "sequential_image_generation": "auto",
    "sequential_image_generation_options": {
      "max_images": 4
    },
    "stream": false,
    "response_format": "url",
    "watermark": false
  }'

Response Example

{
  "created": 1700000000,
  "data": [
    {
      "url": "https://example.com/generated-image.png"
    }
  ],
  "usage": {
    "prompt_tokens": 0,
    "completion_tokens": 0,
    "total_tokens": 3980,
    "output_tokens": 3980
  }
}

Response Fields

FieldTypeDescription
createdintegerCreation timestamp
dataarrayList of generated images
data[].urlstringImage URL
usageobjectToken usage information