Create advanced ID photos with custom dimensions, background colors, face-position constraints, beauty enhancement, outfit changes, watermarked preview, and layout output. It works for ID photo specification, background adjustment, outfit replacement, and printable layouts, with async and sync request modes.
The result image URL is valid for 1 hour. Please download and store it promptly.
Authentication
Every API request must include your API Key in the X-API-KEY request header. Send it with each request exactly as shown in the examples and parameter descriptions.
X-API-KEY: YOUR_API_KEY Create an advanced ID photo task
/api/tasks/visual/external/idphoto Body Parameters
image_file file optional Image file. Supports jpg, jpeg, bmp, png, webp, tiff, bitmap. Either image_file or image_url. Priority: image_file>image_url. Image size <15MB, max resolution 4096x4096
For image upload requirements, see Guidelines and Limits #7.
image_url string optional Image download URL. Supports HTTP and OSS protocols, max 512 characters, download timeout 10s
last_id string optional Reuse last task input. image_id from task return (not task_id), if provided, image input can be omitted
sync integer optional Synchronous/Asynchronous. Default: 0.
0: Return a task ID asynchronously;1: Return the processed result synchronously.
size string optional ID photo size. The original image size is used by default. Use {width}x{height}, for example 300x400, with a lowercase x separator. Each pixel value must be between 100 and 2000.
format string optional Output format. Default: png.
png: Return an image with a transparent background;jpg: Return an image with a white background.
return_type integer optional Result return format. Default: 1.
1: Return an image URL;2: Return a Base64-encoded string.
spec_id integer optional Specification ID. Specification includes size, background color, face size, file size. For specifications, see Guidelines and Limits #8.
dpi integer optional Resolution DPI. Min 10, max 1000
px_width integer optional Pixel width. Can pass (px_width, px_height) or (mm_width, mm_height), default (295, 413), <1800 pixels
px_height integer optional Pixel height. Used with px_width, <1800 pixels
mm_width integer optional Millimeter width. Used with mm_height, <180mm
mm_height integer optional Millimeter height. Used with mm_width, <180mm
change_bg integer optional Whether to cutout and change background. Default: 1.
0: Keep the original background;1: Remove and replace the background.
bg_color string optional Background color. Hex format, common colors: white FFFFFF, red FF0000, blue 438EDB, default white
bg_color2 string optional Gradient background color. Hex format, background gradients from top bg_color to bottom bg_color2, default empty
face_width integer optional Face width. Face width (pixels)
min_face_width integer optional Minimum face width. Minimum face width (pixels)
max_face_width integer optional Maximum face width. Maximum face width (pixels)
face_height integer optional Face height. Face height (pixels)
min_face_height integer optional Minimum face height. Minimum face height (pixels)
max_face_height integer optional Maximum face height. Maximum face height (pixels)
head_top integer optional Head top distance. Distance from head top to top edge (pixels)
min_head_top integer optional Minimum head top. Minimum distance from head top (pixels)
max_head_top integer optional Maximum head top. Maximum distance from head top (pixels)
chin_top integer optional Chin top distance. Distance from chin to top edge (pixels)
min_chin_top integer optional Minimum chin top. Minimum distance from chin (pixels)
max_chin_top integer optional Maximum chin top. Maximum distance from chin (pixels)
eyes_top integer optional Eyes top distance. Distance from eyes to top edge (pixels)
min_eyes_top integer optional Minimum eyes top. Minimum distance from eyes (pixels)
max_eyes_top integer optional Maximum eyes top. Maximum distance from eyes (pixels)
auto_bright integer optional Auto brighten. Default: 0.
0: Disable auto brightness;1: Enable auto brightness.
bright_factor number optional Brightness intensity. [0, 1], brightness coefficient
auto_smooth integer optional Auto smooth skin. Default: 0.
0: Disable auto smoothing;1: Enable auto smoothing.
smooth_factor number optional Smoothing intensity. [0, 1], smoothing coefficient
auto_thin_face integer optional Auto slim face. Default: 0.
0: Disable auto face slimming;1: Enable auto face slimming.
thin_face_factor number optional Face slimming intensity. [0, 1], face slimming coefficient
auto_sharp integer optional Auto sharpen. Default: 0.
0: Disable auto sharpening;1: Enable auto sharpening.
sharp_factor number optional Sharpening intensity. [0, 1], sharpening coefficient
clothes_id string optional Clothing template ID. man_1~man_20, woman_1~woman_20, child_1~child_10, default empty. For clothing templates, see Guidelines and Limits #9.
preview integer optional Preview only. Default: 0.
0: Return the final result;1: Return a watermarked preview without consuming credits.
quality integer optional Compression quality. [1, 100], larger value means larger file size
min_file_size integer optional Target minimum size (Bytes). [0, inf], e.g. 10240 means min file size 10KB, only takes effect when quality is empty, default empty
max_file_size integer optional Target maximum size (Bytes). [0, inf], only takes effect when quality is empty, default empty
add_label integer optional Add label. Default: 0.
0: Do not add a label;1: Add a label below the ID photo.
label_text string optional Label text. Label content at bottom, default empty
label_height integer optional Label height. Label height at bottom (pixels)
layout integer optional Layout. Default: 0.
0: Do not return a layout;1: Return a layout result.
layout_vertical integer optional Layout direction. Default: 0.
0: Use a horizontal layout;1: Use a vertical layout.
layout_size string optional Paper size. Default: 5inch.
5inch: Five-inch paper;6inch: Six-inch paper.
layout_bg_color string optional Canvas background color. Hex format, e.g. white FFFFFF, default gray
layout_qr_code_data string optional QR code data. Layout additional QR code data, default empty
layout_qr_code_size integer optional QR code size. Layout additional QR code size in pixels
layout_label_text string optional Canvas label text. Layout additional text, use \n for line breaks, default empty
Return Parameters
status number HTTP response status code. See Status Code Definitions.
200: Request succeeded;Non-200: Request failed.
message string API response message. If the task fails, refer to this field or contact support.
data.task_id string Advanced ID photo task ID used for polling.
status number HTTP response status code. See Status Code Definitions.
200: Request succeeded;Non-200: Request failed.
message string API response message. If the task fails, refer to this field or contact support.
data.task_id string Task ID. If processing fails, contact support with this task_id.
data.image_id string The image_id returned from the task, not the task_id. Use it as last_id to reuse the image in the next request.
data.created_at integer Task creation timestamp.
data.processed_at integer Timestamp when task processing started.
data.completed_at integer Task completion timestamp.
data.image string Download URL or base64 data of the processed ID photo result. URL results are valid for 1 hour.
data.progress number Task progress.
100: Processing is complete.
data.return_type number Result return method.
data.state number Task status. See Status Code Definitions.
1: Succeeded;> 1: Processing;< 0: Failed;-7: Invalid image file.
data.state_detail string Detailed task status.
Query advanced ID photo result
For asynchronous requests, poll the result once every 1 second. The maximum polling duration for this API is 60 seconds; if the total polling time exceeds this without a result, treat it as a timeout failure.
/api/tasks/visual/external/idphoto/{task_id} Path Parameters
task_id string required Task ID returned after creating an advanced ID photo task. Use it to query the processing result.
Return Parameters
status number HTTP response status code. See Status Code Definitions.
200: Request succeeded;Non-200: Request failed.
message string API response message. If the task fails, refer to this field or contact support.
data.task_id string Task ID. If processing fails, contact support with this task_id.
data.image_id string The image_id returned from the task, not the task_id. Use it as last_id to reuse the image in the next request.
data.created_at integer Task creation timestamp.
data.processed_at integer Timestamp when task processing started.
data.completed_at integer Task completion timestamp.
data.image string Download URL or base64 data of the processed ID photo result. URL results are valid for 1 hour.
data.progress number Task progress.
100: Processing is complete.
data.return_type number Result return method.
data.state number Task status. See Status Code Definitions.
1: Succeeded;> 1: Processing;< 0: Failed;-7: Invalid image file.
data.state_detail string Detailed task status.
Guidelines and Limits
-
The result image URL is generally valid for 1 hour. Please download and store it promptly.
-
HTTP status 200 means the HTTP request succeeded, not that advanced ID photo generation succeeded. Check data.state for the task result. See Status Code Definitions.
-
When passing URLs as parameters, follow URL encoding standards to prevent parameter parsing issues.
-
Either image_file or image_url is required, and image_file has higher priority when both are sent. You can also provide last_id to reuse the previous task input and omit the image input.
-
Standard ID photo costs 6 credits per request; outfit change with clothes_id costs 15 credits; enabling any beauty enhancement adds 8 credits; layout=1 adds 5 credits; preview=1 returns a watermarked preview and consumes no credits.
-
Use spec_id for preset ID photo specifications, or pass px_width/px_height or mm_width/mm_height. Pixel values must be less than 1800, millimeter values less than 180, and dpi must be between 10 and 1000.
-
Uploaded images must meet the following format, resolution, and file size limits.
Format Resolution Size jpg, jpeg, bmp, png, webp, tiff, bitmap Up to 4096 x 4096 Up to 15MB -
ID Photo Specification List
spec_id Category Title Size(mm) Size(px) DPI Color Requirement 1101Common Small 1 Inch 22x32 260x378 300 No Requirement 1102Common 1 Inch 25x35 295x413 300 No Requirement 1103Common Large 1 Inch 33x48 390x567 300 No Requirement 1104Common Small 2 Inch 35x45 413x531 300 No Requirement 1105Common 2 Inch 35x49 413x579 300 No Requirement 1106Common Large 2 Inch 35x53 413x626 300 No Requirement 1107Common 3 Inch 55x84 649x991 300 No Requirement 1108Common 4 Inch 76x102 898x1205 300 No Requirement 1109Common 5 Inch 89x127 1051x1500 300 No Requirement 2101Government Social Security Card 26x32 358x441 350 White 2102Government ID Card 26x32 358x441 350 White 2103Government Residence Permit 26x32 358x441 350 White 2201Government Health Certificate (1 Inch) 25x35 295x413 300 Blue, White 2202Government Health Certificate (Small 2 Inch) 35x45 413x531 300 Blue, White 2203Government Medical Insurance Card 26x32 358x441 300 White 2301Government Driver's License (Small 1 Inch) 22x32 260x378 300 White 2401Government Veteran Preferential Treatment Card 30x37 352x440 300 White 3101Visa Brazil Visa 40x50 472x590 300 White 3102Visa Iceland Visa 40x50 472x590 300 White 3103Visa Argentina Visa 40x40 472x472 300 White 3105Visa South Korea Visa 35x45 413x531 300 White 3106Visa Kenya Visa 50x50 590x590 300 White 3107Visa Malaysia Visa 35x45 413x531 300 White 3108Visa USA Visa 51x51 602x602 300 White 3109Visa Japan Visa 45x45 531x531 300 White 3110Visa Universal Visa 35x45 413x531 300 White 3111Visa Thailand Visa 35x45 413x531 300 White 3112Visa New Zealand Visa 35x45 413x531 300 White 3113Visa Italy Visa 35x45 413x531 300 White 3114Visa Israel Visa 51x51 602x602 300 White 3115Visa India Visa 51x51 602x602 300 White 3116Visa Vietnam Visa 35x45 413x531 300 Blue, Red, White 3117Visa Laos Visa 51x51 602x602 300 White 3118Visa France Visa 35x45 413x531 300 White 3119Visa Myanmar Visa 35x45 413x531 300 White 3120Visa Canada Visa 35x45 413x531 300 White 3121Visa Philippines Visa 51x51 602x602 300 White 3203Visa Overseas Passport Application Photo 33x48 389x566 300 White 3301Visa Taiwan Entry Permit 35x45 413x531 300 White 3302Visa Hong Kong & Macau Permit 33x48 389x566 300 White 4101Student Enrollment Photo (2 Inch) 35x49 413x578 300 Blue, Red, White 4102Student Enrollment Photo (1 Inch) 25x35 295x413 300 Blue, Red, White 4103Enrollment Hong Kong Student Registration 40x50 472x590 300 White 4201Student National Student Registration Photo 26x32 307x378 150 White 4301Student University Student Image Collection 41x54 480x640 300 Blue 4401Student Graduation Photo 41x54 480x640 300 Blue, White 5101Examination National Civil Service Exam (1 Inch) 25x35 295x413 300 Blue, White 5130Examination National Civil Service Exam (Small 2 Inch) 35x45 413x531 300 Blue, White 5131Examination National Civil Service Exam (2 Inch) 35x49 413x579 300 Blue, White 5102Examination Anhui Civil Service Exam 25x35 413x531 300 Blue, White 5103Examination Beijing Civil Service Exam 34x45 401x531 300 Blue, White 5104Examination Chengdu Civil Service Exam 9x11 102x126 300 Blue, White, Red 5132Examination Chengdu Civil Service Exam 25x35 295x413 300 Blue, White 5105Examination Gansu Civil Service Exam 35x49 413x579 300 Blue, White 5106Examination Guangxi Civil Service Exam 25x35 295x413 300 Blue, White 5107Examination Guangzhou Civil Service Exam 35x49 295x413 300 Blue, White 5108Examination Guizhou Civil Service Exam 18x25 215x300 300 Blue, White, Red 5109Examination Hainan Civil Service Exam 35x45 413x531 300 Blue 5110Examination Hebei Civil Service Exam 25x35 295x413 300 Blue, White, Red 5111Examination Henan Civil Service Exam 25x35 295x413 300 Blue, White, Red 5112Examination Heilongjiang Civil Service Exam 35x45 413x531 300 Blue, White, Red 5113Examination Hubei Civil Service Exam 25x35 295x413 300 Blue, White 5114Examination Hunan Civil Service Exam 35x45 413x531 300 Blue, White 5115Examination Jiangsu Civil Service Exam 35x45 413x531 300 Blue, White 5116Examination Jiangxi Civil Service Exam 35x45 413x531 300 Blue, White 5117Examination Ningxia Civil Service Exam 35x45 413x531 300 Blue, White 5118Examination Qinghai Civil Service Exam 35x45 413x531 300 Blue, White 5119Examination Shandong Civil Service Exam 35x49 413x579 300 Blue, White, Red 5120Examination Shanxi Civil Service Exam 25x35 295x413 300 Blue, White, Red 5121Examination Shanghai Civil Service Exam 13x17 150x200 300 Blue, White 5122Examination Shaanxi Civil Service Exam 35x45 413x531 300 Blue, White 5123Examination Shenzhen Civil Service Exam 35x53 413x626 300 Blue, White, Red 5124Examination Sichuan Civil Service Exam 25x35 295x413 300 Blue, White 5125Examination Tibet Civil Service Exam 25x35 295x413 300 Blue, White 5126Examination Xinjiang Civil Service Exam 35x45 413x531 300 Blue, White 5127Examination Yunnan Civil Service Exam 35x49 413x579 300 Blue, White, Red 5128Examination Shanxi Provincial Institution Exam 25x35 295x413 300 White 5129Examination Chongqing Civil Service Exam 25x35 295x413 300 Blue, White 5201Examination National Exam (2 Inch) 35x45 413x531 300 Blue, White 5202Examination National Exam (1 Inch) 25x35 295x413 300 Blue, White 5203Examination Gansu Province (National Exam) 25x35 295x413 300 Blue, White, Red 5204Examination Jiangxi Province (National Exam) 35x53 413x626 300 Blue, White 5205Examination Ningxia (National Exam) 35x45 413x531 300 Blue, White 5206Examination Qinghai Province (National Exam) 35x45 413x531 300 Blue, White 5207Examination Shanghai (National Exam) 35x53 413x626 300 Blue 5301Examination Adult College Entrance Exam 40x54 480x640 300 Blue 5302Examination Adult Self-study Exam 40x54 480x640 300 Blue, White 5303Examination Adult Self-study Exam 25x34 300x400 300 Blue, White 5401Examination College Entrance Exam (1 Inch) 25x35 295x413 300 Blue, White 5402Examination College Entrance Exam (Small 2 Inch) 35x45 413x531 300 Blue, White 5403Examination Shanghai High School Entrance Exam 14x20 168x240 300 Blue, White, Red 5404Examination Wuhan University Graduate Exam 13x17 150x200 300 Blue, White, Red 5405Examination Graduate Entrance Exam 33x48 390x567 300 Blue, White 5406Examination In-service Graduate Exam 35x45 413x531 300 Blue, White 5501Examination Mandarin Proficiency Test 33x48 390x567 300 Blue, White, Red 5502Examination Business English Exam 35x49 413x579 300 Blue, White 5503Examination Degree English 33x48 390x567 300 White 5504Examination English AB Level Exam (2 Inch) 33x48 390x567 300 Blue 5505Examination English AB Level Exam (144X192) 12x16 144x192 300 Blue, White 5506Examination English Level 3 Exam 12x16 295x413 300 Blue 5507Examination English CET-4 33x43 390x507 300 Blue, White 5508Examination English CET-4 12x16 144x192 300 Blue, White 5509Examination English CET-6 12x16 144x192 300 Blue, White 5510Examination Self-study Degree Foreign Language Exam 40x54 480x640 300 Blue 5601Examination Securities Exam Registration 18x25 215x300 300 Blue, White, Red 5602Examination CPA Exam (1 Inch) 25x35 295x413 300 White 5603Examination CPA Exam (178x220) 15x19 178x220 300 White 5701Examination National Medical Exam 25x35 295x413 300 Blue, White 5702Examination Nurse Qualification Exam 35x45 413x531 300 White 5703Examination Pharmacist Qualification Exam (1 Inch) 25x35 295x413 300 White 5801Examination Computer Level Exam 12x16 144x192 300 White 5802Examination Youth Electronic Info Level Exam 35x53 413x626 300 Blue, Red 5803Examination Youth Robot Tech Level Exam 35x53 413x626 300 Blue, White 5901Examination BIM Skills Level Exam 25x35 295x413 300 White 5902Examination Health Professional Tech Qualification Exam (1 Inch) 25x35 295x413 300 White 5903Examination Level 1 Fire Engineer Exam 25x35 295x413 300 White 5904Examination Nursery Teacher Exam (1 Inch) 25x35 295x413 300 White 5905Examination National Judicial Exam 35x53 413x626 300 Blue, White, Red 5906Examination Referee Qualification Exam 25x35 295x413 300 Blue 6101Qualification Level 2 Constructor Certificate (1 Inch) 25x35 295x413 300 Blue, White 6102Qualification Level 2 Constructor Certificate (2 Inch) 35x53 413x626 300 Blue, White 6103Qualification Level 1 Constructor 25x35 295x413 300 White 6201Qualification Tour Guide License (1 Inch) 25x35 295x413 300 White 6202Qualification Tour Guide License (2 Inch) 35x53 413x626 300 White 6302Qualification Veterinary Qualification Certificate 19x28 230x334 300 Blue, White 6303Qualification Medical Practitioner Certificate (Small 2 Inch) 35x45 413x531 300 White 6401Qualification Teacher Qualification Certificate (300x400) 25x34 300x400 300 White 6501Qualification Insurance Professional Certificate (210x270) 18x23 210x270 300 White 6502Qualification Accounting Certificate (1 Inch) 25x35 295x413 300 White 6601Qualification Law Enforcement Certificate 40x54 480x640 300 White -
Clothing List - ID Photo Outfits. Download image assets
Category Clothing ID Image Men's Clothing man_1 Men's Clothing man_2 Men's Clothing man_3 Men's Clothing man_4 Men's Clothing man_5 Men's Clothing man_6 Men's Clothing man_7 Men's Clothing man_8 Men's Clothing man_9 Men's Clothing man_10 Men's Clothing man_11 Men's Clothing man_12 Men's Clothing man_13 Men's Clothing man_14 Men's Clothing man_15 Men's Clothing man_16 Men's Clothing man_17 Men's Clothing man_18 Men's Clothing man_19 Men's Clothing man_20 Women's Clothing woman_1 Women's Clothing woman_2 Women's Clothing woman_3 Women's Clothing woman_4 Women's Clothing woman_5 Women's Clothing woman_6 Women's Clothing woman_7 Women's Clothing woman_8 Women's Clothing woman_9 Women's Clothing woman_10 Women's Clothing woman_11 Women's Clothing woman_12 Women's Clothing woman_13 Women's Clothing woman_14 Women's Clothing woman_15 Women's Clothing woman_16 Women's Clothing woman_17 Women's Clothing woman_18 Women's Clothing woman_19 Women's Clothing woman_20 Children's Clothing child_1 Children's Clothing child_2 Children's Clothing child_3 Children's Clothing child_4 Children's Clothing child_5 Children's Clothing child_6 Children's Clothing child_7 Children's Clothing child_8 Children's Clothing child_9 Children's Clothing child_10
# Advanced ID Photo API
Create advanced ID photos with custom dimensions, background colors, face-position constraints, beauty enhancement, outfit changes, watermarked preview, and layout output. Supports asynchronous and synchronous request modes.
> Note: The result image URL is valid for 1 hour. Please download and store it promptly.
## Base URL
All paths below are relative to the Base URL:
```
https://techhk.aoscdn.com
```
## Authentication
Every request must include your API key in the `X-API-KEY` request header:
```http
X-API-KEY: YOUR_API_KEY
```
Get or manage your API key from [API Key](https://picwish.com/my-account?subRoute=api-key).
Requests without a valid key are rejected.
## Choosing a request mode (sync vs async)
The mode is controlled by the `sync` body parameter on the create request:
- Asynchronous (`sync=0`, recommended): the create request returns immediately with `data.task_id`. Poll the query endpoint with that task ID until processing finishes.
- Synchronous (`sync=1`): the create request waits for processing to finish and returns the result directly in the same response.
In both modes, results are retained for up to 1 hour.
## Source image and reuse
Provide an image source by using `image_file` or `image_url`. The old API parameter table states that `image_file` has higher priority than `image_url` when both are sent. You can also provide `last_id` to reuse the `image_id` from a previous task, in which case the image input can be omitted.
## Endpoints
| Purpose | Method | Path |
| --- | --- | --- |
| Create an advanced ID photo task | POST | /api/tasks/visual/external/idphoto |
| Query a task result (async) | GET | /api/tasks/visual/external/idphoto/{task_id} |
## Create an advanced ID photo task
`POST /api/tasks/visual/external/idphoto`
Content-Type: `multipart/form-data`
### Body parameters
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| image_file | file | optional | Image file. Supports jpg, jpeg, bmp, png, webp, tiff, bitmap. Either image_file or image_url. Priority: image_file>image_url. Image size <15MB, max resolution 4096x4096 |
| image_url | string | optional | Image download URL. Supports HTTP and OSS protocols, max 512 characters, download timeout 10s |
| last_id | string | optional | Reuse last task input. image_id from task return (not task_id), if provided, image input can be omitted |
| sync | integer | optional | Synchronous/Asynchronous. 1=sync, 0=async |
| size | string | optional | ID photo size. Default is the original image size. Format: {width}x{height}, for example 300x400. Use a lowercase x as the separator, and each pixel value must be between 100 and 2000. |
| format | string | optional | Output format. Default is png. png returns a transparent background; jpg returns a white background. |
| return_type | integer | optional | Result return format. 1 returns an image URL; 2 returns a base64-encoded string. Default is 1. |
| spec_id | integer | optional | Specification ID. Specification includes size, background color, face size, file size. For specifications, see Guidelines and Limits [#8](#guidelines-idphoto-specs). |
| dpi | integer | optional | Resolution DPI. Min 10, max 1000 |
| px_width | integer | optional | Pixel width. Can pass (px_width, px_height) or (mm_width, mm_height), default (295, 413), <1800 pixels |
| px_height | integer | optional | Pixel height. Used with px_width, <1800 pixels |
| mm_width | integer | optional | Millimeter width. Used with mm_height, <180mm |
| mm_height | integer | optional | Millimeter height. Used with mm_width, <180mm |
| change_bg | integer | optional | Whether to cutout and change background. 0 or 1 |
| bg_color | string | optional | Background color. Hex format, common colors: white FFFFFF, red FF0000, blue 438EDB, default white |
| bg_color2 | string | optional | Gradient background color. Hex format, background gradients from top bg_color to bottom bg_color2, default empty |
| face_width | integer | optional | Face width. Face width (pixels) |
| min_face_width | integer | optional | Minimum face width. Minimum face width (pixels) |
| max_face_width | integer | optional | Maximum face width. Maximum face width (pixels) |
| face_height | integer | optional | Face height. Face height (pixels) |
| min_face_height | integer | optional | Minimum face height. Minimum face height (pixels) |
| max_face_height | integer | optional | Maximum face height. Maximum face height (pixels) |
| head_top | integer | optional | Head top distance. Distance from head top to top edge (pixels) |
| min_head_top | integer | optional | Minimum head top. Minimum distance from head top (pixels) |
| max_head_top | integer | optional | Maximum head top. Maximum distance from head top (pixels) |
| chin_top | integer | optional | Chin top distance. Distance from chin to top edge (pixels) |
| min_chin_top | integer | optional | Minimum chin top. Minimum distance from chin (pixels) |
| max_chin_top | integer | optional | Maximum chin top. Maximum distance from chin (pixels) |
| eyes_top | integer | optional | Eyes top distance. Distance from eyes to top edge (pixels) |
| min_eyes_top | integer | optional | Minimum eyes top. Minimum distance from eyes (pixels) |
| max_eyes_top | integer | optional | Maximum eyes top. Maximum distance from eyes (pixels) |
| auto_bright | integer | optional | Auto brighten. 0 or 1, whether to auto adjust brightness |
| bright_factor | number | optional | Brightness intensity. [0, 1], brightness coefficient |
| auto_smooth | integer | optional | Auto smooth skin. 0 or 1, whether to auto smooth skin |
| smooth_factor | number | optional | Smoothing intensity. [0, 1], smoothing coefficient |
| auto_thin_face | integer | optional | Auto slim face. 0 or 1, whether to auto slim face |
| thin_face_factor | number | optional | Face slimming intensity. [0, 1], face slimming coefficient |
| auto_sharp | integer | optional | Auto sharpen. 0 or 1, whether to auto sharpen |
| sharp_factor | number | optional | Sharpening intensity. [0, 1], sharpening coefficient |
| clothes_id | string | optional | Clothing template ID. man_1~man_20, woman_1~woman_20, child_1~child_10, default empty. For clothing templates, see Guidelines and Limits [#9](#guidelines-idphoto-clothes). |
| preview | integer | optional | Preview only. 0 or 1, preview has watermark and does not consume credits |
| quality | integer | optional | Compression quality. [1, 100], larger value means larger file size |
| min_file_size | integer | optional | Target minimum size (Bytes). [0, inf], e.g. 10240 means min file size 10KB, only takes effect when quality is empty, default empty |
| max_file_size | integer | optional | Target maximum size (Bytes). [0, inf], only takes effect when quality is empty, default empty |
| add_label | integer | optional | Add label. 0 or 1, whether to add label at bottom |
| label_text | string | optional | Label text. Label content at bottom, default empty |
| label_height | integer | optional | Label height. Label height at bottom (pixels) |
| layout | integer | optional | Layout. 0 or 1, whether to return layout |
| layout_vertical | integer | optional | Layout direction. 0 or 1, horizontal or vertical layout, default horizontal |
| layout_size | string | optional | Paper size. "5inch" or "6inch", 5-inch or 6-inch layout |
| layout_bg_color | string | optional | Canvas background color. Hex format, e.g. white FFFFFF, default gray |
| layout_qr_code_data | string | optional | QR code data. Layout additional QR code data, default empty |
| layout_qr_code_size | integer | optional | QR code size. Layout additional QR code size in pixels |
| layout_label_text | string | optional | Canvas label text. Layout additional text, use \n for line breaks, default empty |
### Return parameters - asynchronous (sync=0)
| Name | Type | Description |
| --- | --- | --- |
| status | number | HTTP response status code. 200 means the request succeeded, and non-200 means failure. See /states. |
| message | string | Response message. If the task fails, refer to this field or contact support. |
| data.task_id | string | Task ID. Use it to query the result later. |
### Return parameters - synchronous (sync=1)
| Name | Type | Description |
| --- | --- | --- |
| status | number | HTTP response status code. 200 means the request succeeded, and non-200 means failure. See /states. |
| message | string | Response message. If the task fails, refer to this field or contact support. |
| data.task_id | string | Task ID. If processing fails, contact support with this task_id. |
| data.image_id | string | The image_id returned from the task, not the task_id. Use it as last_id to reuse the image in the next request. |
| data.created_at | integer | Task creation timestamp. |
| data.processed_at | integer | Timestamp when task processing started. |
| data.completed_at | integer | Task completion timestamp. |
| data.image | string | Download URL or base64 data of the processed ID photo result. URL results are valid for 1 hour. |
| data.progress | number | Task progress. 100 means processing is complete. |
| data.return_type | number | Result return method. |
| data.state | number | Task status. 1 means succeeded, greater than 1 means processing, and less than 0 means failed. -7 means invalid image file. See /states. |
| data.state_detail | string | Detailed task status. |
### Examples
Asynchronous, image URL:
```bash
curl -k 'https://techhk.aoscdn.com/api/tasks/visual/external/idphoto' \
-H 'X-API-KEY: YOUR_API_KEY' \
-F 'sync=0' \
-F 'image_url=YOUR_IMAGE_URL'
```
Asynchronous, image file upload:
```bash
curl -k 'https://techhk.aoscdn.com/api/tasks/visual/external/idphoto' \
-H 'X-API-KEY: YOUR_API_KEY' \
-F 'sync=0' \
-F 'image_file=@/path/to/image.jpg'
```
Synchronous, image URL:
```bash
curl -k 'https://techhk.aoscdn.com/api/tasks/visual/external/idphoto' \
-H 'X-API-KEY: YOUR_API_KEY' \
-F 'sync=1' \
-F 'image_url=YOUR_IMAGE_URL'
```
Example async create response:
```json
{
"status": 200,
"message": "success",
"data": { "task_id": "TASK_ID" }
}
```
## Query advanced ID photo result
For asynchronous requests, poll the result once every **1 second**. The maximum polling duration for this API is **60 seconds**; if the total polling time exceeds this without a result, treat it as a timeout failure.
`GET /api/tasks/visual/external/idphoto/{task_id}`
Use this in asynchronous mode to poll for the result.
### Path parameters
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| task_id | string | required | The task ID returned by the create request. |
### Return parameters
| Name | Type | Description |
| --- | --- | --- |
| status | number | HTTP response status code. 200 means the request succeeded, and non-200 means failure. See /states. |
| message | string | Response message. If the task fails, refer to this field or contact support. |
| data.task_id | string | Task ID. If processing fails, contact support with this task_id. |
| data.image_id | string | The image_id returned from the task, not the task_id. Use it as last_id to reuse the image in the next request. |
| data.created_at | integer | Task creation timestamp. |
| data.processed_at | integer | Timestamp when task processing started. |
| data.completed_at | integer | Task completion timestamp. |
| data.image | string | Download URL or base64 data of the processed ID photo result. URL results are valid for 1 hour. |
| data.progress | number | Task progress. 100 means processing is complete. |
| data.return_type | number | Result return method. |
| data.state | number | Task status. 1 means succeeded, greater than 1 means processing, and less than 0 means failed. -7 means invalid image file. See /states. |
| data.state_detail | string | Detailed task status. |
### Example
```bash
curl -k 'https://techhk.aoscdn.com/api/tasks/visual/external/idphoto/{task_id}' \
-H 'X-API-KEY: YOUR_API_KEY'
```
Example completed response:
```json
{
"status": 200,
"message": "success",
"data": {
"task_id": "TASK_ID",
"image_id": "IMAGE_ID",
"state": 1,
"progress": 100,
"image": "https://.../id-photo.jpg",
"completed_at": "1700000000"
}
}
```
## Recommended asynchronous flow
1. POST to /api/tasks/visual/external/idphoto with `sync=0` and either an image source or `last_id`. Read `data.task_id`.
2. GET /api/tasks/visual/external/idphoto/{task_id} every 1 second. Polling should not exceed 60 seconds.
3. Inspect `data.state`: 1 = done (read `data.image` and `data.image_id`); > 1 = keep polling; < 0 = failed.
4. Download `data.image` within 1 hour. Store `data.image_id` if you want to reuse the same input image later through `last_id`.
## Guidelines and Limits
- The result image URL is valid for **1 hour**. Please download and store it promptly.
- HTTP status 200 means the HTTP request succeeded, not that advanced ID photo generation succeeded. Check data.state for the task result. See /states.
- When passing URLs as parameters, follow URL encoding standards to prevent parameter parsing issues.
- Either image_file or image_url is required, and image_file has higher priority when both are sent. You can also provide last_id to reuse the previous task input and omit the image input.
- Standard ID photo costs 6 credits per request; outfit change with clothes_id costs 15 credits; enabling any beauty enhancement adds 8 credits; layout=1 adds 5 credits; preview=1 returns a watermarked preview and consumes no credits.
- Use spec_id for preset ID photo specifications, or pass px_width/px_height or mm_width/mm_height. Pixel values must be less than 1800, millimeter values less than 180, and dpi must be between 10 and 1000.
- Uploaded images must meet the following format, resolution, and file size limits.
| Format | Resolution | File size |
| --- | --- | --- |
| jpg, jpeg, bmp, png, webp, tiff, bitmap | Up to 4096 x 4096 | Up to 15MB |
- <a id="guidelines-idphoto-specs"></a>ID Photo Specification List
| spec_id | Category | Title | Size(mm) | Size(px) | DPI | Color Requirement |
| --- | --- | --- | --- | --- | --- | --- |
| `1101` | Common | Small 1 Inch | 22x32 | 260x378 | 300 | No Requirement |
| `1102` | Common | 1 Inch | 25x35 | 295x413 | 300 | No Requirement |
| `1103` | Common | Large 1 Inch | 33x48 | 390x567 | 300 | No Requirement |
| `1104` | Common | Small 2 Inch | 35x45 | 413x531 | 300 | No Requirement |
| `1105` | Common | 2 Inch | 35x49 | 413x579 | 300 | No Requirement |
| `1106` | Common | Large 2 Inch | 35x53 | 413x626 | 300 | No Requirement |
| `1107` | Common | 3 Inch | 55x84 | 649x991 | 300 | No Requirement |
| `1108` | Common | 4 Inch | 76x102 | 898x1205 | 300 | No Requirement |
| `1109` | Common | 5 Inch | 89x127 | 1051x1500 | 300 | No Requirement |
| `2101` | Government | Social Security Card | 26x32 | 358x441 | 350 | White |
| `2102` | Government | ID Card | 26x32 | 358x441 | 350 | White |
| `2103` | Government | Residence Permit | 26x32 | 358x441 | 350 | White |
| `2201` | Government | Health Certificate (1 Inch) | 25x35 | 295x413 | 300 | Blue, White |
| `2202` | Government | Health Certificate (Small 2 Inch) | 35x45 | 413x531 | 300 | Blue, White |
| `2203` | Government | Medical Insurance Card | 26x32 | 358x441 | 300 | White |
| `2301` | Government | Driver's License (Small 1 Inch) | 22x32 | 260x378 | 300 | White |
| `2401` | Government | Veteran Preferential Treatment Card | 30x37 | 352x440 | 300 | White |
| `3101` | Visa | Brazil Visa | 40x50 | 472x590 | 300 | White |
| `3102` | Visa | Iceland Visa | 40x50 | 472x590 | 300 | White |
| `3103` | Visa | Argentina Visa | 40x40 | 472x472 | 300 | White |
| `3105` | Visa | South Korea Visa | 35x45 | 413x531 | 300 | White |
| `3106` | Visa | Kenya Visa | 50x50 | 590x590 | 300 | White |
| `3107` | Visa | Malaysia Visa | 35x45 | 413x531 | 300 | White |
| `3108` | Visa | USA Visa | 51x51 | 602x602 | 300 | White |
| `3109` | Visa | Japan Visa | 45x45 | 531x531 | 300 | White |
| `3110` | Visa | Universal Visa | 35x45 | 413x531 | 300 | White |
| `3111` | Visa | Thailand Visa | 35x45 | 413x531 | 300 | White |
| `3112` | Visa | New Zealand Visa | 35x45 | 413x531 | 300 | White |
| `3113` | Visa | Italy Visa | 35x45 | 413x531 | 300 | White |
| `3114` | Visa | Israel Visa | 51x51 | 602x602 | 300 | White |
| `3115` | Visa | India Visa | 51x51 | 602x602 | 300 | White |
| `3116` | Visa | Vietnam Visa | 35x45 | 413x531 | 300 | Blue, Red, White |
| `3117` | Visa | Laos Visa | 51x51 | 602x602 | 300 | White |
| `3118` | Visa | France Visa | 35x45 | 413x531 | 300 | White |
| `3119` | Visa | Myanmar Visa | 35x45 | 413x531 | 300 | White |
| `3120` | Visa | Canada Visa | 35x45 | 413x531 | 300 | White |
| `3121` | Visa | Philippines Visa | 51x51 | 602x602 | 300 | White |
| `3203` | Visa | Overseas Passport Application Photo | 33x48 | 389x566 | 300 | White |
| `3301` | Visa | Taiwan Entry Permit | 35x45 | 413x531 | 300 | White |
| `3302` | Visa | Hong Kong & Macau Permit | 33x48 | 389x566 | 300 | White |
| `4101` | Student | Enrollment Photo (2 Inch) | 35x49 | 413x578 | 300 | Blue, Red, White |
| `4102` | Student | Enrollment Photo (1 Inch) | 25x35 | 295x413 | 300 | Blue, Red, White |
| `4103` | Enrollment | Hong Kong Student Registration | 40x50 | 472x590 | 300 | White |
| `4201` | Student | National Student Registration Photo | 26x32 | 307x378 | 150 | White |
| `4301` | Student | University Student Image Collection | 41x54 | 480x640 | 300 | Blue |
| `4401` | Student | Graduation Photo | 41x54 | 480x640 | 300 | Blue, White |
| `5101` | Examination | National Civil Service Exam (1 Inch) | 25x35 | 295x413 | 300 | Blue, White |
| `5130` | Examination | National Civil Service Exam (Small 2 Inch) | 35x45 | 413x531 | 300 | Blue, White |
| `5131` | Examination | National Civil Service Exam (2 Inch) | 35x49 | 413x579 | 300 | Blue, White |
| `5102` | Examination | Anhui Civil Service Exam | 25x35 | 413x531 | 300 | Blue, White |
| `5103` | Examination | Beijing Civil Service Exam | 34x45 | 401x531 | 300 | Blue, White |
| `5104` | Examination | Chengdu Civil Service Exam | 9x11 | 102x126 | 300 | Blue, White, Red |
| `5132` | Examination | Chengdu Civil Service Exam | 25x35 | 295x413 | 300 | Blue, White |
| `5105` | Examination | Gansu Civil Service Exam | 35x49 | 413x579 | 300 | Blue, White |
| `5106` | Examination | Guangxi Civil Service Exam | 25x35 | 295x413 | 300 | Blue, White |
| `5107` | Examination | Guangzhou Civil Service Exam | 35x49 | 295x413 | 300 | Blue, White |
| `5108` | Examination | Guizhou Civil Service Exam | 18x25 | 215x300 | 300 | Blue, White, Red |
| `5109` | Examination | Hainan Civil Service Exam | 35x45 | 413x531 | 300 | Blue |
| `5110` | Examination | Hebei Civil Service Exam | 25x35 | 295x413 | 300 | Blue, White, Red |
| `5111` | Examination | Henan Civil Service Exam | 25x35 | 295x413 | 300 | Blue, White, Red |
| `5112` | Examination | Heilongjiang Civil Service Exam | 35x45 | 413x531 | 300 | Blue, White, Red |
| `5113` | Examination | Hubei Civil Service Exam | 25x35 | 295x413 | 300 | Blue, White |
| `5114` | Examination | Hunan Civil Service Exam | 35x45 | 413x531 | 300 | Blue, White |
| `5115` | Examination | Jiangsu Civil Service Exam | 35x45 | 413x531 | 300 | Blue, White |
| `5116` | Examination | Jiangxi Civil Service Exam | 35x45 | 413x531 | 300 | Blue, White |
| `5117` | Examination | Ningxia Civil Service Exam | 35x45 | 413x531 | 300 | Blue, White |
| `5118` | Examination | Qinghai Civil Service Exam | 35x45 | 413x531 | 300 | Blue, White |
| `5119` | Examination | Shandong Civil Service Exam | 35x49 | 413x579 | 300 | Blue, White, Red |
| `5120` | Examination | Shanxi Civil Service Exam | 25x35 | 295x413 | 300 | Blue, White, Red |
| `5121` | Examination | Shanghai Civil Service Exam | 13x17 | 150x200 | 300 | Blue, White |
| `5122` | Examination | Shaanxi Civil Service Exam | 35x45 | 413x531 | 300 | Blue, White |
| `5123` | Examination | Shenzhen Civil Service Exam | 35x53 | 413x626 | 300 | Blue, White, Red |
| `5124` | Examination | Sichuan Civil Service Exam | 25x35 | 295x413 | 300 | Blue, White |
| `5125` | Examination | Tibet Civil Service Exam | 25x35 | 295x413 | 300 | Blue, White |
| `5126` | Examination | Xinjiang Civil Service Exam | 35x45 | 413x531 | 300 | Blue, White |
| `5127` | Examination | Yunnan Civil Service Exam | 35x49 | 413x579 | 300 | Blue, White, Red |
| `5128` | Examination | Shanxi Provincial Institution Exam | 25x35 | 295x413 | 300 | White |
| `5129` | Examination | Chongqing Civil Service Exam | 25x35 | 295x413 | 300 | Blue, White |
| `5201` | Examination | National Exam (2 Inch) | 35x45 | 413x531 | 300 | Blue, White |
| `5202` | Examination | National Exam (1 Inch) | 25x35 | 295x413 | 300 | Blue, White |
| `5203` | Examination | Gansu Province (National Exam) | 25x35 | 295x413 | 300 | Blue, White, Red |
| `5204` | Examination | Jiangxi Province (National Exam) | 35x53 | 413x626 | 300 | Blue, White |
| `5205` | Examination | Ningxia (National Exam) | 35x45 | 413x531 | 300 | Blue, White |
| `5206` | Examination | Qinghai Province (National Exam) | 35x45 | 413x531 | 300 | Blue, White |
| `5207` | Examination | Shanghai (National Exam) | 35x53 | 413x626 | 300 | Blue |
| `5301` | Examination | Adult College Entrance Exam | 40x54 | 480x640 | 300 | Blue |
| `5302` | Examination | Adult Self-study Exam | 40x54 | 480x640 | 300 | Blue, White |
| `5303` | Examination | Adult Self-study Exam | 25x34 | 300x400 | 300 | Blue, White |
| `5401` | Examination | College Entrance Exam (1 Inch) | 25x35 | 295x413 | 300 | Blue, White |
| `5402` | Examination | College Entrance Exam (Small 2 Inch) | 35x45 | 413x531 | 300 | Blue, White |
| `5403` | Examination | Shanghai High School Entrance Exam | 14x20 | 168x240 | 300 | Blue, White, Red |
| `5404` | Examination | Wuhan University Graduate Exam | 13x17 | 150x200 | 300 | Blue, White, Red |
| `5405` | Examination | Graduate Entrance Exam | 33x48 | 390x567 | 300 | Blue, White |
| `5406` | Examination | In-service Graduate Exam | 35x45 | 413x531 | 300 | Blue, White |
| `5501` | Examination | Mandarin Proficiency Test | 33x48 | 390x567 | 300 | Blue, White, Red |
| `5502` | Examination | Business English Exam | 35x49 | 413x579 | 300 | Blue, White |
| `5503` | Examination | Degree English | 33x48 | 390x567 | 300 | White |
| `5504` | Examination | English AB Level Exam (2 Inch) | 33x48 | 390x567 | 300 | Blue |
| `5505` | Examination | English AB Level Exam (144X192) | 12x16 | 144x192 | 300 | Blue, White |
| `5506` | Examination | English Level 3 Exam | 12x16 | 295x413 | 300 | Blue |
| `5507` | Examination | English CET-4 | 33x43 | 390x507 | 300 | Blue, White |
| `5508` | Examination | English CET-4 | 12x16 | 144x192 | 300 | Blue, White |
| `5509` | Examination | English CET-6 | 12x16 | 144x192 | 300 | Blue, White |
| `5510` | Examination | Self-study Degree Foreign Language Exam | 40x54 | 480x640 | 300 | Blue |
| `5601` | Examination | Securities Exam Registration | 18x25 | 215x300 | 300 | Blue, White, Red |
| `5602` | Examination | CPA Exam (1 Inch) | 25x35 | 295x413 | 300 | White |
| `5603` | Examination | CPA Exam (178x220) | 15x19 | 178x220 | 300 | White |
| `5701` | Examination | National Medical Exam | 25x35 | 295x413 | 300 | Blue, White |
| `5702` | Examination | Nurse Qualification Exam | 35x45 | 413x531 | 300 | White |
| `5703` | Examination | Pharmacist Qualification Exam (1 Inch) | 25x35 | 295x413 | 300 | White |
| `5801` | Examination | Computer Level Exam | 12x16 | 144x192 | 300 | White |
| `5802` | Examination | Youth Electronic Info Level Exam | 35x53 | 413x626 | 300 | Blue, Red |
| `5803` | Examination | Youth Robot Tech Level Exam | 35x53 | 413x626 | 300 | Blue, White |
| `5901` | Examination | BIM Skills Level Exam | 25x35 | 295x413 | 300 | White |
| `5902` | Examination | Health Professional Tech Qualification Exam (1 Inch) | 25x35 | 295x413 | 300 | White |
| `5903` | Examination | Level 1 Fire Engineer Exam | 25x35 | 295x413 | 300 | White |
| `5904` | Examination | Nursery Teacher Exam (1 Inch) | 25x35 | 295x413 | 300 | White |
| `5905` | Examination | National Judicial Exam | 35x53 | 413x626 | 300 | Blue, White, Red |
| `5906` | Examination | Referee Qualification Exam | 25x35 | 295x413 | 300 | Blue |
| `6101` | Qualification | Level 2 Constructor Certificate (1 Inch) | 25x35 | 295x413 | 300 | Blue, White |
| `6102` | Qualification | Level 2 Constructor Certificate (2 Inch) | 35x53 | 413x626 | 300 | Blue, White |
| `6103` | Qualification | Level 1 Constructor | 25x35 | 295x413 | 300 | White |
| `6201` | Qualification | Tour Guide License (1 Inch) | 25x35 | 295x413 | 300 | White |
| `6202` | Qualification | Tour Guide License (2 Inch) | 35x53 | 413x626 | 300 | White |
| `6302` | Qualification | Veterinary Qualification Certificate | 19x28 | 230x334 | 300 | Blue, White |
| `6303` | Qualification | Medical Practitioner Certificate (Small 2 Inch) | 35x45 | 413x531 | 300 | White |
| `6401` | Qualification | Teacher Qualification Certificate (300x400) | 25x34 | 300x400 | 300 | White |
| `6501` | Qualification | Insurance Professional Certificate (210x270) | 18x23 | 210x270 | 300 | White |
| `6502` | Qualification | Accounting Certificate (1 Inch) | 25x35 | 295x413 | 300 | White |
| `6601` | Qualification | Law Enforcement Certificate | 40x54 | 480x640 | 300 | White |
- <a id="guidelines-idphoto-clothes"></a>Clothing List - ID Photo Outfits. [Download image assets](https://picwish.com/clothes.zip)
| Category | Clothing ID | Image |
| --- | --- | --- |
| Men's Clothing | `man_1` | [View image](https://picwish.com/idphoto-clothes) |
| Men's Clothing | `man_2` | [View image](https://picwish.com/idphoto-clothes) |
| Men's Clothing | `man_3` | [View image](https://picwish.com/idphoto-clothes) |
| Men's Clothing | `man_4` | [View image](https://picwish.com/idphoto-clothes) |
| Men's Clothing | `man_5` | [View image](https://picwish.com/idphoto-clothes) |
| Men's Clothing | `man_6` | [View image](https://picwish.com/idphoto-clothes) |
| Men's Clothing | `man_7` | [View image](https://picwish.com/idphoto-clothes) |
| Men's Clothing | `man_8` | [View image](https://picwish.com/idphoto-clothes) |
| Men's Clothing | `man_9` | [View image](https://picwish.com/idphoto-clothes) |
| Men's Clothing | `man_10` | [View image](https://picwish.com/idphoto-clothes) |
| Men's Clothing | `man_11` | [View image](https://picwish.com/idphoto-clothes) |
| Men's Clothing | `man_12` | [View image](https://picwish.com/idphoto-clothes) |
| Men's Clothing | `man_13` | [View image](https://picwish.com/idphoto-clothes) |
| Men's Clothing | `man_14` | [View image](https://picwish.com/idphoto-clothes) |
| Men's Clothing | `man_15` | [View image](https://picwish.com/idphoto-clothes) |
| Men's Clothing | `man_16` | [View image](https://picwish.com/idphoto-clothes) |
| Men's Clothing | `man_17` | [View image](https://picwish.com/idphoto-clothes) |
| Men's Clothing | `man_18` | [View image](https://picwish.com/idphoto-clothes) |
| Men's Clothing | `man_19` | [View image](https://picwish.com/idphoto-clothes) |
| Men's Clothing | `man_20` | [View image](https://picwish.com/idphoto-clothes) |
| Women's Clothing | `woman_1` | [View image](https://picwish.com/idphoto-clothes) |
| Women's Clothing | `woman_2` | [View image](https://picwish.com/idphoto-clothes) |
| Women's Clothing | `woman_3` | [View image](https://picwish.com/idphoto-clothes) |
| Women's Clothing | `woman_4` | [View image](https://picwish.com/idphoto-clothes) |
| Women's Clothing | `woman_5` | [View image](https://picwish.com/idphoto-clothes) |
| Women's Clothing | `woman_6` | [View image](https://picwish.com/idphoto-clothes) |
| Women's Clothing | `woman_7` | [View image](https://picwish.com/idphoto-clothes) |
| Women's Clothing | `woman_8` | [View image](https://picwish.com/idphoto-clothes) |
| Women's Clothing | `woman_9` | [View image](https://picwish.com/idphoto-clothes) |
| Women's Clothing | `woman_10` | [View image](https://picwish.com/idphoto-clothes) |
| Women's Clothing | `woman_11` | [View image](https://picwish.com/idphoto-clothes) |
| Women's Clothing | `woman_12` | [View image](https://picwish.com/idphoto-clothes) |
| Women's Clothing | `woman_13` | [View image](https://picwish.com/idphoto-clothes) |
| Women's Clothing | `woman_14` | [View image](https://picwish.com/idphoto-clothes) |
| Women's Clothing | `woman_15` | [View image](https://picwish.com/idphoto-clothes) |
| Women's Clothing | `woman_16` | [View image](https://picwish.com/idphoto-clothes) |
| Women's Clothing | `woman_17` | [View image](https://picwish.com/idphoto-clothes) |
| Women's Clothing | `woman_18` | [View image](https://picwish.com/idphoto-clothes) |
| Women's Clothing | `woman_19` | [View image](https://picwish.com/idphoto-clothes) |
| Women's Clothing | `woman_20` | [View image](https://picwish.com/idphoto-clothes) |
| Children's Clothing | `child_1` | [View image](https://picwish.com/idphoto-clothes) |
| Children's Clothing | `child_2` | [View image](https://picwish.com/idphoto-clothes) |
| Children's Clothing | `child_3` | [View image](https://picwish.com/idphoto-clothes) |
| Children's Clothing | `child_4` | [View image](https://picwish.com/idphoto-clothes) |
| Children's Clothing | `child_5` | [View image](https://picwish.com/idphoto-clothes) |
| Children's Clothing | `child_6` | [View image](https://picwish.com/idphoto-clothes) |
| Children's Clothing | `child_7` | [View image](https://picwish.com/idphoto-clothes) |
| Children's Clothing | `child_8` | [View image](https://picwish.com/idphoto-clothes) |
| Children's Clothing | `child_9` | [View image](https://picwish.com/idphoto-clothes) |
| Children's Clothing | `child_10` | [View image](https://picwish.com/idphoto-clothes) |
## Status codes
Determine success by combining the HTTP response status code (`status`) with the task status code (`data.state`).
### HTTP response status codes
| Code | Meaning |
| --- | --- |
| 200 | The request is successful. |
| 400 | Wrong parameter passed by the client. Check whether a parameter is missing or has an incorrect value. |
| 401 | Unauthorized API key. Check that X-API-KEY is correct and the service is enabled. |
| 404 | The requested URL or resource does not exist. Check that the URL or task_id is correct. |
| 413 | The uploaded file exceeds the allowed size. Refer to the supported image size. |
| 429 | Request frequency exceeds the QPS limit (default QPS is 2). Slow down or contact us to raise your QPS. |
| 500 | Server-side exception. Please contact support. |
### Task status codes (data.state)
1 = succeeded; greater than 1 = still processing; less than 0 = failed.
| Code | Meaning |
| --- | --- |
| -17 | Processing failed because the prompt is invalid. |
| -16 | Processing failed because a third-party review detected prohibited content. |
| -15 | Processing failed due to insufficient resources. |
| -14 | Processing failed because the input image content does not meet the requirements. |
| -13 | Processing failed because the task was canceled due to an exception. |
| -11 | Processing failed because the result is empty. |
| -10 | Processing failed because internal review detected prohibited content. |
| -9 | Processing failed because the internal program failed during loop processing. |
| -8 | Processing timed out. The maximum processing time is 180 seconds. |
| -7 | Invalid image file (e.g. corrupted image or incorrect format). |
| -5 | The image_url image exceeds the size limit (30MB). |
| -3 | The server failed to download your file. Check that the source image URL is available. |
| -2 | Processing completed, but uploading the result to OSS failed. |
| -1 | Processing failed. |
| 0 | Queued. The task is waiting in the queue. |
| 1 | Completed. Processing succeeded. |
| 2 | Preparing. |
| 3 | Waiting. |
| 4 | Processing in progress. |
| 5 | Internally publishing the result. |
| 6 | Processing. Internal loop processing is in progress. |