Create an image
Generate a PNG image with text to image or image to image. Image to image specifies reference images with reference_asset_id or reference_asset_ids, up to 10 images. Send the rate_version from the settings endpoint and a unique Idempotency-Key for retries.
Authentication
Credentials in the examples are placeholders. Replace them and run the examples on your server.
Code examples
curl -X POST 'https://shixux.com/api/v1/image/generate' \ -H 'X-API-Key: yb_xxx_yyy' \ -H 'Content-Type: application/json' \ -H 'Idempotency-Key: your-unique-business-action-id' \ -d '{"mode":"text-to-image","model":"sx-image-2.6-sunburst","prompt":"A yellow ceramic cup on a plain table.","size":"1024x1024","rate_version":1}'{ "id": "job_xxx", "type": "tts", "status": "queued", "reserved_credits": 1, "estimate_detail": {}}Idempotency-Key?|Idempotency key of up to 128 characters. Reuse the same value when retrying the same request; using it for a different request returns 409.
application/json- body
reference_asset_ids?array<string>Asset IDs of reference images in order, up to 10. Use either this field or reference_asset_id.
items <= 10mode*stringGeneration mode. Video supports t2va, fl2va and ref2va; images support text-to-image and image-to-image. The modes each model supports are given by the corresponding settings endpoint.
"text-to-image""image-to-image"model*stringModel ID. For image and video models, use the corresponding settings endpoint for current availability, resolutions and rates. Speech synthesis and audio composition accept indextts-2 (default) or indextts-2.5.
"doubao-seedream-5-0-pro-260628""doubao-seedream-5-0-flash-260915""doubao-seedream-5-5-261028""sx-image-2.6-sunburst"prompt*stringImage prompt, 1–32000 characters.
1 <= length <= 32000rate_version*integerRate version. For image generation, send billing.version from the settings endpoint. If the rate has changed, the submission is rejected; read the settings or quote again.
1 <= valuereference_asset_id?stringAsset ID of a single reference image. Use either this field or reference_asset_ids.
size*stringImage output size. Read the available sizes and rates from GET /v1/image/config. 1776x2368 and 2368x1776 are billed at the corresponding large-size tier.
"1024x1024""1536x1024""1024x1536""2048x2048""2048x1152""1152x2048""1776x2368""2368x1776"Request succeeded
application/json- response
estimate_detail*id*Idreserved_credits*Reserved Creditsstatus*JobStatus"queued""processing""succeeded""failed""cancelled"type*JobType"tts""avatar""video""video_analysis""image""voice_design""audio_composition"