POST
/
v1
/
images
/
edits
curl -X POST "https://api.applerouter.ai/v1/images/edits" \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-image-edit-plus",
    "input": {
      "messages": [
        {
          "role": "user",
          "content": [
            {
              "image": "https://example.com/depth-map.webp"
            },
            {
              "text": "Generate an image following this depth map: a red bicycle on a muddy path in a forest"
            }
          ]
        }
      ]
    },
    "parameters": {
      "n": 2,
      "prompt_extend": true,
      "watermark": false
    }
  }'
{
  "created": 1713833628,
  "data": [
    {
      "url": "https://example.com/edited-1.png"
    },
    {
      "url": "https://example.com/edited-2.png"
    }
  ]
}

Overview

Edit images using Alibaba’s Tongyi Wanxiang image edit series models. Supports various image processing tasks including style transfer and depth-guided generation.
model
string
required
The model to use (e.g. qwen-image-edit-plus)
input
object
required
Input object containing image and text messages
parameters
object
Generation parameters: - n: Number of images - negative_prompt: Content to avoid - prompt_extend: Enable Prompt enhancement - watermark: Add Watermark - size: Output Size
curl -X POST "https://api.applerouter.ai/v1/images/edits" \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-image-edit-plus",
    "input": {
      "messages": [
        {
          "role": "user",
          "content": [
            {
              "image": "https://example.com/depth-map.webp"
            },
            {
              "text": "Generate an image following this depth map: a red bicycle on a muddy path in a forest"
            }
          ]
        }
      ]
    },
    "parameters": {
      "n": 2,
      "prompt_extend": true,
      "watermark": false
    }
  }'
{
  "created": 1713833628,
  "data": [
    {
      "url": "https://example.com/edited-1.png"
    },
    {
      "url": "https://example.com/edited-2.png"
    }
  ]
}

Authorizations

Authorization
string
header
required

使用 Bearer Token 认证。格式: Authorization: Bearer sk-xxxxxx

Body

application/json
model
string
required
input
object
required
parameters
object

Response

200 - application/json

成功生成图像

created
integer
data
object[]