Skip to content

Edit Images (Qwen Native Format)

Pass both image (source image URL or Base64) and text (edit instruction) inside the content array. The endpoint path is the same as the OpenAI-compatible format; the gateway routes automatically based on the request body shape. See also Generate images.

Endpoint

POST /v1/images/edits

Request example

bash
curl https://ai.youqi.tech/v1/images/edits \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-image-edit",
    "input": {
      "messages": [
        {
          "role": "user",
          "content": [
            { "image": "https://example.com/origin.png" },
            { "text": "Replace the background with a seaside sunset" }
          ]
        }
      ]
    },
    "parameters": { "n": 1, "watermark": false }
  }'

TIP

The Qwen native format shares the same endpoint path as the OpenAI-compatible format; the gateway distinguishes formats by request body shape — do not mix the two body styles.