Edit image
POST
/v1/images/edits
package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://api.mirapi.ai/v1/images/edits"
payload := strings.NewReader("\"{\\n \\\"model\\\": \\\"qwen-image-edit-plus\\\",\\n \\\"input\\\": {\\n \\\"messages\\\": [\\n {\\n \\\"role\\\": \\\"user\\\",\\n \\\"content\\\": [\\n {\\n \\\"image\\\": \\\"https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/fpakfo/image36.webp\\\"\\n },\\n {\\n \\\"text\\\": \\\"Generate an image that matches the depth map, following this description: a battered red bicycle parked on a muddy path, with a dense primeval forest in the background\\\"\\n }\\n ]\\n }\\n ]\\n },\\n \\\"parameters\\\": {\\n \\\"n\\\": 2,\\n \\\"negative_prompt\\\": \\\" \\\",\\n \\\"prompt_extend\\\": true,\\n \\\"watermark\\\": false\\n }\"")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>") req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}const url = 'https://api.mirapi.ai/v1/images/edits';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '"{\n \"model\": \"qwen-image-edit-plus\",\n \"input\": {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"image\": \"https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/fpakfo/image36.webp\"\n },\n {\n \"text\": \"Generate an image that matches the depth map, following this description: a battered red bicycle parked on a muddy path, with a dense primeval forest in the background\"\n }\n ]\n }\n ]\n },\n \"parameters\": {\n \"n\": 2,\n \"negative_prompt\": \" \",\n \"prompt_extend\": true,\n \"watermark\": false\n }"'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.mirapi.ai/v1/images/edits \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '"{\n \"model\": \"qwen-image-edit-plus\",\n \"input\": {\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"image\": \"https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/fpakfo/image36.webp\"\n },\n {\n \"text\": \"Generate an image that matches the depth map, following this description: a battered red bicycle parked on a muddy path, with a dense primeval forest in the background\"\n }\n ]\n }\n ]\n },\n \"parameters\": {\n \"n\": 2,\n \"negative_prompt\": \" \",\n \"prompt_extend\": true,\n \"watermark\": false\n }"'Bailian qwen-image series image editing
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typeapplication/json
object
model
required
string
input
required
object
messages
required
Array<object>
object
role
string
content
Array<object>
object
image
string
text
string
parameters
object
n
integer
negative_prompt
string
prompt_extend
boolean
watermark
boolean
size
string
Example
{ "model": "qwen-image-edit-plus", "input": { "messages": [ { "role": "user", "content": [ { "image": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/fpakfo/image36.webp" }, { "text": "Generate an image that matches the depth map, following this description: a battered red bicycle parked on a muddy path, with a dense primeval forest in the background" } ] } ] }, "parameters": { "n": 2, "negative_prompt": " ", "prompt_extend": true, "watermark": false }Responses
Section titled “Responses”Image generated
Media typeapplication/json
object
created
integer
data
Array<object>
object
url
string
b64_json
string
revised_prompt
string
Examplegenerated
{ "created": 1, "data": [ { "url": "example", "b64_json": "example", "revised_prompt": "example" } ]}