Skip to main content
Image generation starts with the model list. Synchronous APIs return images directly; asynchronous APIs return a task ID first.
If you do not have an API Key yet, read Get API Key first.
View image generation model pricing: International site.

Generation vs editing

  • Image generation creates new images from a text prompt.
  • Image editing modifies an existing image. It requires an image input and may also use a mask.

Integration order

  1. Call Image generation models.
  2. Copy data[n].name from the model list and pass it as model.
  3. Choose size, quality, and style from the same model item.
  4. Call Generate image, or call Async image generation.
  5. For async requests, use data.logId to call Image task status.

Image editing

Image editing uses a separate model list. Call Image editing models, then use Edit image or Async image editing. If the source image or mask is local or private, use OSS upload first.