Image generation

POST /v1/images/generations answers in one response rather than as a task. model and prompt are required; n, size and quality are optional and the models fall back to their own defaults. The reply is {"created": …, "data": [ … ]}, where each entry carries a url — b64_json is present but empty unless you ask for it with "response_format": "b64_json". Editing an existing image goes to POST /v1/images/edits with the source in image. Billing is per generated image, so n multiplies the charge.

POST /v1/images/generations
curl https://api.chinaapi.ai/v1/images/generations \
  -H "Authorization: Bearer $CHINAAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "wan2.7-image",
    "prompt": "a red paper crane on a white desk, soft daylight",
    "n": 1
  }'

# {"created":1786620000,
#  "data":[{"url":"https://...","b64_json":""}],
#  "metadata":{...}}
4K output

doubao-seedream-5-0-260128

With doubao-seedream-4-5-251128. Both reach 4K and both accept an input image for editing and multi-image composition, so size is worth setting explicitly rather than taking the default.

General purpose

wan2.7-image

With wan2.7-image-pro, which adds a 4K tier at roughly twice the price. Same request fields as the rest of this endpoint; the pro variant is the one to reach for when the output is going to be printed or upscaled.

Tip This endpoint bills per call, not per token, and the price already covers one image — the usage log records a single prompt token, which is bookkeeping rather than a measure of your prompt. Asking for "n": 4 costs four times one image. Prices differ by more than an order of magnitude across the models here, so pick the model before tuning the prompt.