AGTCloud API Docs
GuidesAPI ReferenceIntegrations and resourcesUpdate and help

Image generation and editing

Generate, edit, and create variations of images through unified APIs.

Overview

AGTCloud provides image generation and editing capabilities. After selecting a model, submit text or image input through the OpenAI Images-compatible API and read the generated result.

Supported tasks

TaskDescriptionMain input
Image generationCreate an image from a text descriptionModel, prompt
Image editingModify an existing image or a selected regionImage, prompt, optional mask
Image variationsCreate alternate versions from a source imageSource image

API access

Base URL

https://api.agtcloud.cn/v1

Generate an image

curl 'https://api.agtcloud.cn/v1/images/generations' \
  -H 'Authorization: Bearer your-api-key' \
  -H 'Content-Type: application/json' \
  --data '{
    "model": "qwen-image",
    "prompt": "A modern library overlooking the sea in soft morning light"
  }'

Edit an image

curl 'https://api.agtcloud.cn/v1/images/edits' \
  -H 'Authorization: Bearer your-api-key' \
  -F 'model=MODEL_ID' \
  -F 'image=@input.png' \
  -F 'mask=@mask.png' \
  -F 'prompt=Replace the background with a beach at sunrise'

Create image variations

curl 'https://api.agtcloud.cn/v1/images/variations' \
  -H 'Authorization: Bearer your-api-key' \
  -F 'model=MODEL_ID' \
  -F 'image=@input.png' \
  -F 'n=2'

Handle image results

Response formHandling
URLDownload the image and save it to your own storage when needed
Base64Decode the value into binary image data and save it

The response fields depend on the request parameters and model capabilities. For batch output, process each item in data[].

Learn more

On this page