> For the complete documentation index, see [llms.txt](https://nsclouds.gitbook.io/aillm.nscloud.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nsclouds.gitbook.io/aillm.nscloud.ai/image-edits/dashscope.md).

# DashScope

### 1. Overview

DashScope exposes image edit capabilities in this environment.

{% hint style="success" %}
This endpoint provides an OpenAI-compatible Images path. Actual capabilities may vary by vendor and model.
{% endhint %}

**Supported models：**

* `qwen-image-2.0`
* `qwen-image-2.0-pro`

### 2. API Details

## Edit Image

> Provides an OpenAI-compatible Images editing endpoint. Supported capabilities may vary by model.

```json
{"openapi":"3.1.0","info":{"title":"NSCloud AI API Documentation","version":"1.11.0"},"tags":[{"name":"image_edits_dashscope","description":"DashScope's image edits API"}],"servers":[{"url":"https://aillm.nscloud.ai","description":"Global Server"}],"security":[{"APIKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"http","scheme":"bearer","description":"Authenticate using Bearer token format: 'Bearer YOUR_SECRET_TOKEN'"}},"schemas":{"CreateImageEditRequest":{"type":"object","description":"Image editing request body.","properties":{"model":{"type":"string","description":"Model ID to invoke."},"image":{"type":"array","description":"Input image file(s) to edit. Use the image parameter; when sending multiple files with raw multipart/curl, send repeated image[] parts.","items":{"type":"string","format":"binary"}},"mask":{"type":"string","format":"binary","description":"Optional mask file describing editable regions."},"prompt":{"type":"string","description":"Prompt used to guide image editing."},"n":{"type":"integer","description":"Number of images to generate.","default":1},"size":{"type":"string","description":"Requested output image size.","default":"1024x1024"},"response_format":{"type":"string","description":"Format used to return the image payload.","enum":["url","b64_json"],"default":"url"}},"required":["model","image","prompt"]},"ImageResponse":{"type":"object","description":"Image generation or edit success response.","properties":{"created":{"type":"integer","description":"Unix timestamp in seconds when the response was created."},"data":{"type":"array","description":"Generated image results.","items":{"$ref":"#/components/schemas/ImageDataItem"}},"background":{"type":"string","description":"Background type used for the generated image."},"output_format":{"type":"string","description":"Output image format, such as png."},"quality":{"type":"string","description":"Effective image quality used by the model."},"size":{"type":"string","description":"Final returned image size."},"usage":{"$ref":"#/components/schemas/ImageUsage"}}},"ImageDataItem":{"type":"object","description":"A single generated image result.","properties":{"url":{"type":"string","description":"Image URL when response_format=url."},"b64_json":{"type":"string","description":"Base64-encoded image bytes when response_format=b64_json."},"revised_prompt":{"type":"string","description":"Prompt actually used or revised by the model."}}},"ImageUsage":{"type":"object","description":"Resource usage summary for image generation.","properties":{"total_tokens":{"type":"integer","description":"Total token count."},"input_tokens":{"type":"integer","description":"Input token count."},"output_tokens":{"type":"integer","description":"Output token count."},"input_tokens_details":{"type":"object","description":"Optional breakdown of input token usage.","properties":{"text_tokens":{"type":"integer","description":"Input tokens attributed to text prompts."},"image_tokens":{"type":"integer","description":"Input tokens attributed to images."}},"additionalProperties":true}}},"ErrorResponse":{"type":"object","description":"Error response payload.","properties":{"error":{"$ref":"#/components/schemas/ErrorDetail"}}},"ErrorDetail":{"type":"object","description":"Error detail object.","properties":{"message":{"type":"string","description":"Human-readable error message."},"type":{"type":"string","description":"Error type."},"param":{"description":"Parameter associated with the error, if any.","type":["string","null"]},"code":{"description":"Machine-readable error code, if any.","type":["string","null"]}}}},"responses":{"ErrorResponse":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/v1/images/edits":{"post":{"tags":["image_edits_dashscope"],"summary":"Edit Image","description":"Provides an OpenAI-compatible Images editing endpoint. Supported capabilities may vary by model.","operationId":"createImageEdit_dashscope","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/CreateImageEditRequest"},"encoding":{"image":{"style":"form","explode":true}}}}},"responses":{"200":{"description":"Success Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImageResponse"}}}},"400":{"$ref":"#/components/responses/ErrorResponse"},"401":{"$ref":"#/components/responses/ErrorResponse"},"429":{"$ref":"#/components/responses/ErrorResponse"}}}}}}
```
