Image modelsAPI referenceCreate an image

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

API Key: X-API-Key: <API Key> or Authorization: Bearer <API Key>.

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": {}}

Header Parameters

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.

Request Body

application/json
  1. body
reference_asset_ids?array<string>

Asset IDs of reference images in order, up to 10. Use either this field or reference_asset_id.

Itemsitems <= 10
mode*string

Generation 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.

Value in"text-to-image""image-to-image"
model*string

Model 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.

Value in"doubao-seedream-5-0-pro-260628""doubao-seedream-5-0-flash-260915""doubao-seedream-5-5-261028""sx-image-2.6-sunburst"
prompt*string

Image prompt, 1–32000 characters.

Length1 <= length <= 32000
rate_version*integer

Rate 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.

Range1 <= value
reference_asset_id?string

Asset ID of a single reference image. Use either this field or reference_asset_ids.

size*string

Image output size. Read the available sizes and rates from GET /v1/image/config. 1776x2368 and 2368x1776 are billed at the corresponding large-size tier.

Value in"1024x1024""1536x1024""1024x1536""2048x2048""2048x1152""1152x2048""1776x2368""2368x1776"

Response Body

Request succeeded

application/json
  1. response
estimate_detail*
id*Id
reserved_credits*Reserved Credits
status*JobStatus
Value in"queued""processing""succeeded""failed""cancelled"
type*JobType
Value in"tts""avatar""video""video_analysis""image""voice_design""audio_composition"

On this page