Image generation and image editing use different endpoints. Check the current model’s interface and price in Model Square before sending a request. Generation consumes account credit.

Generate an image

Use POST /v1/images/generations with Authorization: Bearer YOUR_API_KEY.
ParameterRequiredMeaning
modelYesExact image-generation model ID.
promptYesDescription of the desired image, in English or Chinese.
sizeNoOutput dimensions supported by the model.
qualityNoQuality setting, where supported.
styleNoStyle setting, where supported.
nNoRequested number of images; the documented default is 1.

Edit an image

Use POST /v1/images/edits with the same authorization header. Common OpenAI-compatible models accept file uploads using multipart/form-data; some models use a JSON request with image URLs.
FieldRequiredMeaning
modelYesExact image-editing model ID.
imageYesOriginal image; supported size and format depend on the model.
promptYesRequested edit.
maskNoOptional transparency mask indicating the editable area.
Use the request format supported by the selected model. Do not assume generation support also means editing support. Inspect the returned result and usage log before submitting another request. For a graphical client walkthrough, see Cherry Studio image tutorial (Chinese). For asynchronous video results, see Videos API.