PicMa Studio API Developer Docs
This API set provides async task submission and querying for AI image and video processing — photo restoration, enhancement, filters, text-to-image, video super-resolution, denoising, image-to-video, and more. All tasks are asynchronous: submit a task to obtain a taskId, then poll until it completes.
Overview
This API set provides AI image processing and video processing capabilities. The docs are organized into Image APIs, Video APIs, and Common APIs. All tasks are asynchronous. The standard workflow is:
- Call a specific processing API to submit a task. It returns
taskIdand an initial status (queuing). - Poll the generic task-query API
GET /v1/tasks/{task_id}(shared by image and video tasks) until the status becomes completed or failed. - On success, get the processed image or video from
output.urlin the result.
How to get specsCode
Some APIs (e.g. AI Image Filter, AI Portrait, AI Hetu Image Filter, ID Photo, Hetu Style Video) require a specsCode to select a specific style or capability. Follow these steps:
- Sign in to the PicMa Studio Developer Platform
- Open Capability Market and find the algorithm you want to integrate
- Open the capability detail page to view the
specsCodeand sample output images - Choose the effect you want from the samples and use the matching
specsCodein your API request
specsCode means an output resolution tier (e.g. 720P, 1080P) — not a Capability Market style code. Invalid or unavailable style codes return 1003002.Base Info & Auth
https://api.developer.magictiger.ai/v1/photo-restore, https://api.developer.magictiger.ai/v1/tasks/{task_id}.Every request must carry the token in the header:
Authorization: Bearer {token}
Content-Type: application/json
Common Response
All APIs return a unified ReplyAi structure:
{
"code": 0,
"msg": "request success",
"data": { }
}
| Field | Type | Description |
|---|---|---|
code | int | Status code. 0 means success; others are error codes |
msg | String | Status message |
data | Object | Business payload (task APIs return TaskResultDto) |
Error Codes
| Code | Description |
|---|---|
0 | Success |
-1 | Request failed / service degraded (fallback when circuit breaking, rate limiting or isolation triggers) |
3 | Invalid parameter |
4 | Illegal parameter (e.g. expansion coordinates out of bounds) |
5 | Parameter signature validation failed |
6 | Trial quota exhausted |
9 | Permission denied |
999 | Server error, please retry later |
1001001 | Task creation failed |
1001002 | Resource (image/video) URL validation failed |
1001003 | Resource (image/video) size exceeds the limit |
1001004 | Unsupported file type |
1001005 | Unsupported resolution / ratio / number of input images (illegal resolution or ratio value, or input images exceed the limit) |
1002001 | Task ID does not exist |
1002002 | Task has been deleted |
1003001 | Interface has been discontinued / taken offline |
1003002 | Failed to get configuration, please contact the administrator |
Workflow (Full Example)
Using "Photo Restoration" as an example:
Step 1 · Submit a task
curl -X POST 'https://api.developer.magictiger.ai/v1/photo-restore' \
-H 'Authorization: Bearer {token}' \
-H 'Content-Type: application/json' \
-d '{ "imageUrl": "https://example.com/old-photo.jpg" }'
Response:
{
"code": 0,
"msg": "request success",
"data": {
"taskId": "550e8400-e29b-41d4-a716-446655440000-20260717103000",
"status": "queuing",
"pointsConsumed": 10
}
}
Step 2 · Poll task status
curl -X GET 'https://api.developer.magictiger.ai/v1/tasks/550e8400-e29b-41d4-a716-446655440000-20260717103000' \
-H 'Authorization: Bearer {token}'
Repeat until status is completed, then get the result image from data.output.url.
Request Parameters (DTO)
Image API request bodies are mostly based on PhotoRestoreReqDto; video APIs use separate video DTOs (see below).
PhotoRestoreReqDto (base body)
Used directly by: Photo Restoration, Photo Enhancement, Enhance & Restore Pro, Super Resolution, Motion Deblurring, Scratch Removal, B&W Colorization, Damaged Photo Repair, Low-light Enhancement, Background Removal, Target Removal, Image Watermark Removal, Face Segmentation, One-click Inpainting.
| Field | Type | Required | Description |
|---|---|---|---|
imageUrl | String | Yes | URL of the image to process |
clientTaskId | String | No | Client-defined task ID for idempotency |
PhotoPromptReqDto (with prompt)
Extends PhotoRestoreReqDto。Used by: Partial Repainting.
| Field | Type | Required | Description |
|---|---|---|---|
imageUrl | String | Yes | URL of the composite image (original + mask side-by-side; see Partial Repainting input requirements) |
clientTaskId | String | No | Client-defined task ID |
prompt | String | Yes | Text prompt describing the desired content for the white mask region |
PhotoChangeReqDto (with target image)
Extends PhotoRestoreReqDto。Used by: Clothes Change.
| Field | Type | Required | Description |
|---|---|---|---|
imageUrl | String | Yes | Original image URL |
clientTaskId | String | No | Client-defined task ID |
changeImageUrl | String | Yes | Target image URL (e.g. a clothing image) |
PhotoExpansionDto (expansion body)
Extends PhotoRestoreReqDto。Used by: Image Expansion.
| Field | Type | Required | Description |
|---|---|---|---|
imageUrl | String | Yes | URL of the image to process |
clientTaskId | String | No | Client-defined task ID |
expandImagesJsonDto | ExpandImagesJsonDto | Yes | Expansion parameters, see below |
ExpandImagesJsonDto
| Field | Type | Required | Description |
|---|---|---|---|
width | Integer | Yes | Canvas width |
height | Integer | Yes | Canvas height |
startX | Integer | Yes | Top-left start X coordinate |
startY | Integer | Yes | Top-left start Y coordinate |
startX must not exceed width,startY must not exceed height; otherwise error code 4 (illegal parameter) is returned.PhotoSpecsCodeReqDto (specs code)
Extends PhotoRestoreReqDto。Used by: AI Image Filter, AI Portrait.
| Field | Type | Required | Description |
|---|---|---|---|
imageUrl | String | Yes | URL of the image to process |
clientTaskId | String | No | Client-defined task ID |
specsCode | String | Yes | Specs code (maps to a specific filter / portrait style) |
gender | Integer | No | Gender: 0 = male, 1 = female (optional for multi-person cases) |
specsCode, see Overview · How to get specsCode.PhotoFilterReqDto (specs-code filter / ID photo)
Extends PhotoRestoreReqDto。Used by: AI Hetu Image Filter, ID Photo.
| Field | Type | Required | Description |
|---|---|---|---|
imageUrl | String | Yes | URL of the image to process |
clientTaskId | String | No | Client-defined task ID |
specsCode | String | Yes | Specs code (Hetu filter style or ID photo spec; returns 1003002) |
specsCode, see Overview · How to get specsCode.PhotoGptImagePromptReqDto (text-to-image / image-to-image)
Used by: Doubao Seedream 4.0 / 4.5 / 5.0-lite / 5.0-pro, GPT Image 2, Gemini 3.1 Flash Image (Nano Banana 2), Gemini 3 Pro Image (Nano Banana Pro), AI Hetu Image.
| Field | Type | Required | Description |
|---|---|---|---|
prompt | String | Yes | Text prompt |
clientTaskId | String | No | Client-defined task ID |
imageUrls | List<String> | No | Input image URL list, multiple images supported (omit for pure text-to-image; max count per API listed below) |
resolution | String | No | Output resolution, default 2K; allowed values vary by API (e.g. 1K/2K/4K) |
ratio | String | No | Output aspect ratio, allowed values vary by API |
resolution、ratio is invalid, or when imageUrls exceeds the API's max count, error code 1001005。PhotoTemplateNumberReqDto (template index)
Extends PhotoRestoreReqDto。Previously used by Sky Filter and Face Dynamization, which are now offline.
| Field | Type | Required | Description |
|---|---|---|---|
imageUrl | String | Yes | URL of the image to process |
clientTaskId | String | No | Client-defined task ID |
templateNumber | Integer | Yes | Template index |
VideoEnhanceReqDto (video enhance)
Used by: Video Super Resolution, Video Face Super Resolution, Video Denoising, Video Color Enhancement, Video B&W Colorization, Video Low-light Enhancement, Video High-texture SR, Video Deinterlace.
| Field | Type | Required | Description |
|---|---|---|---|
videoUrl | String | Yes | Input video URL (≤100MB) |
clientTaskId | String | No | Client-defined task ID |
outputFmt | String | No | Output container: mp4/mov/mkv/ts, default mp4 |
encodeType | Integer | No | 0=H.264, 1=H.265, default 0 |
encodeQuality | Integer | No | 0low / 1medium / 2high, default 1 |
specsCode | String | No | Must be uppercase: 720P/1080P/4K/8K; omit to match input resolution |
720P, 1080P, 480P, 4K, and 8K must be uppercase. Lowercase (e.g. 720p) will fail validation. Here specsCode is an output resolution tier, not a Capability Market style code.VideoRmWaterMarkReqDto (video watermark removal)
Extends VideoEnhanceReqDto. Used by: Video Watermark Removal.
| Field | Type | Required | Description |
|---|---|---|---|
| (inherited fields) | — | — | Same as VideoEnhanceReqDto |
waterMarkParam | VideoWaterMarkDto | Yes | Watermark bounding box (see below) |
VideoWaterMarkDto (JSON field names must be uppercase)
(0,0); X increases rightward, Y increases downward. X/Y are the watermark top-left corner; W/H are width/height in pixels (all ≥ 0).| Field | Type | Required | Description |
|---|---|---|---|
X | Integer | Yes | Watermark top-left X (≥0) |
Y | Integer | Yes | Watermark top-left Y (≥0) |
W | Integer | Yes | Watermark width (≥0) |
H | Integer | Yes | Watermark height (≥0) |
VideoRmBgReqDto (Video background removal)
Used by: Video Background Removal.
| Field | Type | Required | Description |
|---|---|---|---|
videoUrl | String | Yes | Input video URL (≤100MB) |
clientTaskId | String | No | Client-defined task ID |
VideoStyleFilterReqDto (Hetu style video)
Used by: Hetu Style Video.
| Field | Type | Required | Description |
|---|---|---|---|
imageUrl | String | Yes | Input image URL (≤20MB) |
clientTaskId | String | No | Client-defined task ID |
specsCode | String | Yes | Style specs code (returns 1003002 if invalid); duration and output specs are determined by the style config |
specsCode (fixed tier; not multiplied by duration/resolution). For style specsCode, see Overview · How to get specsCode.VideoStyleFilterCustomReqDto (Hetu style video custom)
Used by: Hetu Style Video (Custom).
| Field | Type | Required | Description |
|---|---|---|---|
imageUrl | String | Yes | Input image URL (≤20MB) |
clientTaskId | String | No | Client-defined task ID |
outputDuration | Integer | Yes | Output duration (seconds), 2–5 |
outputRes | String | Yes | Must be uppercase: 480P / 720P |
prompt | String | Yes | Custom prompt |
outputRes accepts only uppercase 480P and 720P.outputDuration.VideoStyleFilterFramesReqDto (Hetu style video frames)
Used by: Hetu Style Video (Frames).
| Field | Type | Required | Description |
|---|---|---|---|
imageUrls | List<String> | No | Start/end frame images, max 2; excess returns 1001005 |
clientTaskId | String | No | Client-defined task ID |
specsCode | String | Yes | Style specs code (returns 1003002 if invalid); duration and output specs are determined by the style config |
specsCode (fixed tier; not multiplied by duration/resolution). For style specsCode, see Overview · How to get specsCode.Task Result Schema (TaskResultDto)
Both a successful task creation (code=0) and the task-query API's data field return TaskResultDto. The field set varies by scenario:
| Scenario | Returned fields |
|---|---|
| Create task (POST) | taskId、status、pointsConsumed |
Query task (GET /v1/tasks/{task_id}) | All fields below (conditionally returned by task status) |
| Field | Type | Description |
|---|---|---|
taskId | String | Task ID (used for polling) |
status | String | queuing queuing / processing processing / completed completed / failed failed |
pointsConsumed | Integer | Points consumed (from points record; may be null) |
clientTaskId | String | Client-defined task ID (echoed as-is on query) |
reqInfoJson | Object | Request info JSON (returned on query only for text-to-image or multi-image-to-image tasks; contains the user's original request parameters such as prompt、imageUrls、resolution、ratio, etc.) |
errorMsg | String | Error message (returned only when status=failed) |
errorCode | Integer | Error code (returned only when status=failed) |
input | MediaInfo | Input image info (returned only when the task has an input image URL; may be absent for pure text-to-image tasks) |
output | MediaInfo | Output image info (returned only when status=completed; relative URLs are auto-completed to full addresses) |
Query task field assembly logic
When querying task status (GET /v1/tasks/{task_id}), the server assembles fields as follows:
| Field | Assembly rule |
|---|---|
reqInfoJson | Returned only for text-to-image or multi-image-to-image tasks; contains the user's original request info (e.g. prompt、imageUrls、resolution、ratio, etc.) |
clientTaskId | Echoes the clientTaskId |
pointsConsumed | Read from points record; null |
errorCode / errorMsg | 仅当 status=failed 时返回 |
input | Returned only when an input image URL exists, with url、width、height、size |
output | 仅当 status=completed 时返回 |
MediaInfo
| Field | Type | Description |
|---|---|---|
url | String | Resource URL |
width | Integer | Width (px) |
height | Integer | Height (px) |
size | Long | File size (bytes) |
Status flow: queuing → processing → completed / failed
Image APIs
The APIs below submit async image processing tasks. Input is typically an image URL (or a text-to-image prompt). Poll the common query API for the result image when complete.
Photo Restoration
Capability code: photo-restore
Capability: Intelligently restores old, blurry or low-resolution photos as a whole, improving clarity and overall quality.
Use cases: old photo restoration, low-res portrait/landscape repair, etc.
Request notes: Body PhotoRestoreReqDto; required imageUrl; optional clientTaskId. Auth: Bearer Token.
Output notes: Async task; get the result image from output.url when complete.
{
"imageUrl": "https://example.com/photo.jpg",
"clientTaskId": "my-task-001"
}
Photo Enhancement
Capability code: photo-enhance
Capability: Enhances details and image quality for a sharper, clearer picture.
Use cases: everyday photo quality boost, detail sharpening.
Request notes: Body PhotoRestoreReqDto; required imageUrl; optional clientTaskId.
Output notes: Async task; get the result image from output.url when complete.
Enhance & Restore Pro
Capability code: photo-enhance-restore
Capability: An advanced two-in-one capability combining quality enhancement with detail restoration.
Use cases: photo processing that needs higher-quality restoration and enhancement.
Request notes: Body PhotoRestoreReqDto; required imageUrl; optional clientTaskId.
Output notes: Async task; get the result image from output.url when complete.
Super Resolution
Capability code: photo-sr
Capability: Performs general super-resolution upscaling while preserving clarity at larger sizes.
Use cases: upscaling low-resolution images, producing higher-clarity assets.
Request notes: Body PhotoRestoreReqDto; required imageUrl; optional clientTaskId.
Output notes: Async task; get the result image from output.url when complete.
Motion Deblurring
Capability code: photo-deblurring
Capability: Removes blur caused by camera shake or subject motion to recover a clear image.
Use cases: camera-shake blur, motion-trail photo repair.
Request notes: Body PhotoRestoreReqDto; required imageUrl; optional clientTaskId.
Output notes: Async task; get the result image from output.url when complete.
Scratch Removal
Capability code: photo-scratch-removal
Capability: Intelligently removes scratches, creases and similar defects from old photos.
Use cases: scratch cleanup after digitizing paper old photos.
Request notes: Body PhotoRestoreReqDto; required imageUrl; optional clientTaskId.
Output notes: Async task; get the result image from output.url when complete.
B&W Colorization
Capability code: photo-colorization
Capability: Intelligently colorizes black-and-white photos with natural, realistic colors.
Use cases: B&W old photo colorization, historical footage renewal.
Request notes: Body PhotoRestoreReqDto; required imageUrl; optional clientTaskId.
Output notes: Async task; get the result image from output.url when complete.
Damaged Photo Repair
Capability code: photo-damaged-restore
Capability: One-click repair for severely damaged old photos with tears, missing areas or stains.
Use cases: repair of torn, stained or heavily damaged photos.
Request notes: Body PhotoRestoreReqDto; required imageUrl; optional clientTaskId.
Output notes: Async task; get the result image from output.url when complete.
Low-light Enhancement
Capability code: photo-low-light-enhance
Capability: Boosts brightness and detail for low-light, backlit or underexposed photos.
Use cases: night scenes, indoor low light, underexposed photo brightening.
Request notes: Body PhotoRestoreReqDto; required imageUrl; optional clientTaskId.
Output notes: Async task; get the result image from output.url when complete.
Partial Repainting
Capability code: photo-partial-repainting
Capability: Intelligently repaints a specified region of the image based on a prompt to replace or adjust content.
Use cases: local scene swap, local content rewrite, inpainting-style edits.
Request notes: Body PhotoPromptReqDto; required imageUrl (must be a preprocessed composite) and prompt; optional clientTaskId.
Output notes: Async task; get the result image from output.url when complete.
imageUrl must be a preprocessed composite: stitch the original image and the edit mask side by side before upload/hosting. Do not send the original alone.
- Left half: original image
- Right half: mask (same size as the original); white = region to repaint, black = keep unchanged
- If the original is
W×H, the composite should be2W×H(equal halves, horizontal stitch)
{
"imageUrl": "https://example.com/original-with-mask.jpg",
"prompt": "dress the person in a red dress"
}
Clothes Change
Capability code: photo-change-clothes
Capability: Intelligently dresses a person in the target outfit for a one-click clothes-change effect.
Use cases: e-commerce try-on, portrait outfit preview.
Request notes: Body PhotoChangeReqDto; required imageUrl, changeImageUrl; optional clientTaskId. The server validates both images separately.
Output notes: Async task; get the result image from output.url when complete.
{
"imageUrl": "https://example.com/person.jpg",
"changeImageUrl": "https://example.com/clothes.jpg"
}
Image Expansion
Capability code: photo-expansion
Capability: Intelligently expands image borders within the specified canvas and auto-fills new content.
Use cases: composition expansion, filling content around the image edges.
Request notes: Body PhotoExpansionDto; required imageUrl, expandImagesJsonDto (width/height/startX/startY). Returns error code 4 when startX > width or startY > height.
Output notes: Async task; get the result image from output.url when complete.
{
"imageUrl": "https://example.com/photo.jpg",
"expandImagesJsonDto": {
"width": 1024,
"height": 1024,
"startX": 200,
"startY": 200
}
}
Sky Filter (Offline)
Capability code: photo-sky-filter
1003001 (interface offline).Face Dynamization (Offline)
Capability code: photo-face-dynamization
1003001 (interface offline).AI Image Filter
Capability code: photo-filter
Capability: Applies an AI filter style to a photo by a specified specs code.
Use cases: stylized filters, batch application of preset filters.
Request notes: Body PhotoSpecsCodeReqDto; required imageUrl, specsCode; optional gender, clientTaskId. Returns 1003002 when style config is missing.
Output notes: Async task; get the result image from output.url when complete.
{
"imageUrl": "https://example.com/photo.jpg",
"specsCode": "filter_001",
"gender": 1
}
AI Portrait
Capability code: photo-portrait
Capability: Generates an AI portrait-style effect for a photo by a specified specs code (with pre/post-processing).
Use cases: portrait style conversion, template-based portrait generation.
Request notes: Body PhotoSpecsCodeReqDto; required imageUrl, specsCode; optional gender, clientTaskId. Returns 1003002 when style config is missing.
Output notes: Async task; get the result image from output.url when complete.
{
"imageUrl": "https://example.com/photo.jpg",
"specsCode": "portrait_001",
"gender": 1
}
AI Hetu Image Filter
Capability code: photo-hetu-filter
Capability: Applies a Hetu filter style to a photo by a specified specs code.
Use cases: Hetu style filter application.
Request notes: Body PhotoFilterReqDto; required imageUrl, specsCode; optional clientTaskId. Returns 1003002 when style config is missing.
Output notes: Async task; get the result image from output.url when complete.
{
"imageUrl": "https://example.com/photo.jpg",
"specsCode": "hetu_001"
}
Doubao Seedream 4.0
Capability code: photo-doubao-seedream-4-0
Capability: Prompt-based text-to-image / image-to-image generation.
Use cases: creative image generation, reference-guided generation.
Request notes: Body PhotoGptImagePromptReqDto; required prompt; optional imageUrls (max 10), resolution (1K/2K/4K), ratio (e.g. 1:1, 16:9, 9:16, etc.).
Output notes: Async task; get the result image from output.url when complete.
{
"prompt": "a cyberpunk city at night",
"imageUrls": ["https://example.com/ref.jpg"],
"resolution": "2K",
"ratio": "16:9"
}
Doubao Seedream 4.5
Capability code: photo-doubao-seedream-4-5
Capability: Prompt-based text-to-image / image-to-image generation (4.5).
Use cases: creative generation requiring higher quality or newer model capabilities.
Request notes: Body PhotoGptImagePromptReqDto; required prompt; optional imageUrls (max 10), resolution (1K/2K/4K), ratio (same as 4.0).
Output notes: Async task; get the result image from output.url when complete.
{
"prompt": "a watercolor forest cabin",
"resolution": "2K",
"ratio": "4:3"
}
Doubao Seedream 5.0 Lite
Capability code: photo-doubao-seedream-5-0-lite
Capability: Prompt-based text-to-image / image-to-image generation (5.0 Lite).
Use cases: creative generation balancing quality and cost.
Request notes: Body PhotoGptImagePromptReqDto; required prompt; optional imageUrls (max 10), resolution (1K/2K/3K), ratio (same as 4.0).
Output notes: Async task; get the result image from output.url when complete.
Doubao Seedream 5.0 Pro
Capability code: photo-doubao-seedream-5-0-pro
Capability: Prompt-based text-to-image / image-to-image generation (5.0 Pro).
Use cases: creative scenarios requiring higher output quality.
Request notes: Body PhotoGptImagePromptReqDto; required prompt; optional imageUrls (max 10), resolution (1K/2K), ratio (same as 4.0).
Output notes: Async task; get the result image from output.url when complete.
GPT Image 2
Capability code: photo-photo-gpt-image-2
Capability: Prompt-based text-to-image / image-to-image generation.
Use cases: general creative generation, multi-image reference generation.
Request notes: Body PhotoGptImagePromptReqDto; required prompt; optional imageUrls (max 14), resolution (1K/2K, points vary by resolution), ratio (same as 4.0).
Output notes: Async task; get the result image from output.url when complete.
{
"prompt": "a corgi wearing sunglasses",
"resolution": "2K",
"ratio": "1:1"
}
Gemini 3.1 Flash Image(Nano Banana 2)
Capability code: photo-gemini-3-1-flash-image
Capability: Prompt-based text-to-image / image-to-image generation (Gemini 3.1 Flash / Nano Banana 2).
Use cases: multi-aspect creative generation, multi-image reference generation.
Request notes: Body PhotoGptImagePromptReqDto; required prompt; optional imageUrls (max 14), resolution (1K/2K/4K, points vary by resolution), ratio (supports 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 1:4, 4:1, 1:8, 8:1).
Output notes: Async task; get the result image from output.url when complete.
Gemini 3 Pro Image(Nano Banana Pro)
Capability code: photo-gemini-3-pro-image
Capability: Prompt-based text-to-image / image-to-image generation (Gemini 3 Pro / Nano Banana Pro).
Use cases: creative scenarios requiring higher output quality and stability.
Request notes: Body PhotoGptImagePromptReqDto; required prompt; optional imageUrls (max 14), resolution (1K/2K/4K, points vary by resolution), ratio (supports 1:1, 4:3, 3:4, 16:9, 9:16, 3:2, 2:3, 21:9).
Output notes: Async task; get the result image from output.url when complete.
AI Hetu Image
Capability code: photo-hetu-image
Capability: Prompt-based Hetu text-to-image / image-to-image generation.
Use cases: creative scenarios requiring Hetu-style image generation.
Request notes: Body PhotoGptImagePromptReqDto; required prompt; optional imageUrls (max 1), resolution (1K/2K), ratio.
Output notes: Async task; get the result image from output.url when complete.
Background Removal
Capability code: photo-remove-bg
Capability: One-click background removal (cutout).
Use cases: product cutout, portrait cutout, transparent-background assets, etc.
Request notes: Body PhotoRestoreReqDto; required imageUrl; optional clientTaskId. Use a clear image with a complete subject.
Output notes: Output is typically transparent PNG; download after async polling.
{
"imageUrl": "https://example.com/product.jpg",
"clientTaskId": "rmbg-001"
}
Target Removal
Capability code: photo-target-removal
Capability: Intelligently removes distracting objects from the scene.
Use cases: remove passers-by, clutter, distracting elements, etc.
Request notes: Body PhotoRestoreReqDto; required imageUrl; optional clientTaskId.
Output notes: Async task; get the result image from output.url when complete.
{
"imageUrl": "https://example.com/street.jpg"
}
Image Watermark Removal
Capability code: photo-remove-watermark
Capability: Removes image watermarks and corner marks.
Use cases: remove watermarks from owned assets (ensure compliant usage).
Request notes: Body PhotoRestoreReqDto; required imageUrl; optional clientTaskId.
Output notes: Output is typically PNG; download after async polling.
{
"imageUrl": "https://example.com/photo-with-wm.jpg"
}
Face Segmentation
Capability code: photo-face-segmentation
Capability: Segments face regions from the image.
Use cases: face-region pipelines, face masks / face cutout workflows.
Request notes: Body PhotoRestoreReqDto; required imageUrl; optional clientTaskId. Face should be clearly visible.
Output notes: Output is segmentation-oriented (transparent/PNG); download after async polling.
{
"imageUrl": "https://example.com/face.jpg"
}
One-click Inpainting
Capability code: photo-inpainting
Capability: One-click removal of unwanted elements with intelligent background fill.
Use cases: remove unwanted objects with auto fill; focuses more on background completion than Target Removal.
Request notes: Body PhotoRestoreReqDto; required imageUrl; optional clientTaskId.
Output notes: Async task; get the result image from output.url when complete.
{
"imageUrl": "https://example.com/clutter.jpg"
}
ID Photo
Capability code: photo-id-photo
Capability: Converts a portrait to ID-photo style; spec is determined by specsCode.
Use cases: ID photo creation, standard ID background output.
Request notes: Body PhotoFilterReqDto; required imageUrl, specsCode; optional clientTaskId. Returns 1003002 when spec is missing. Use a clear front-facing single-person portrait.
Output notes: Async task; get the result image from output.url when complete.
{
"imageUrl": "https://example.com/portrait.jpg",
"specsCode": "id_photo_001"
}
Video APIs
The APIs below submit async video processing tasks or image-to-video tasks. After submission, poll GET /v1/tasks/{task_id} for results.
Video Enhance Rules
Scope: Enhances input video with super-resolution, denoising, colorization, low-light enhancement, deinterlacing, watermark removal, etc.
Input limits: Video URL must be reachable; file ≤ 100MB; common extensions supported (mp4, mov, mkv, webm, avi, ts, etc.).
Resolution limits: Short side ≥ 270, long side ≤ 3840; otherwise returns 1001005.
Output specs: specsCode optional (must be uppercase 720P/1080P/4K/8K); omit to match input resolution and frame rate. Here specsCode is an output resolution tier, not a Capability Market style code.
Billing: Points = probed duration (seconds) × tier unit price.
Query: After submission, poll with GET /v1/tasks/{task_id}.
Video Super Resolution
Capability code: video-sr
Capability: Improves overall video clarity and perceived resolution.
Use cases: upscaling low-res footage, general quality enhancement.
Request notes: Body VideoEnhanceReqDto; required videoUrl; optional output format/encoding/spec fields.
Output notes: Get the result video from output.url when complete.
{
"videoUrl": "https://example.com/input.mp4",
"specsCode": "1080P",
"outputFmt": "mp4"
}
Video Face Super Resolution
Capability code: video-sr-face
Capability: Super-resolution focused on face regions.
Use cases: portrait video, interviews, selfie content clarity boost.
Request notes: Body VideoEnhanceReqDto; fields same as Video Enhance Rules.
Output notes: Get the result video from output.url when complete.
Video Denoising
Capability code: video-denoising
Capability: Reduces video noise for a cleaner picture.
Use cases: grain noise from high ISO / low-light shooting.
Request notes: Body VideoEnhanceReqDto.
Output notes: Get the result video from output.url when complete.
Video Color Enhancement
Capability code: video-color-enhance
Capability: Improves color expression and saturation.
Use cases: color enhancement for flat or washed-out footage.
Request notes: Body VideoEnhanceReqDto.
Output notes: Get the result video from output.url when complete.
Video B&W Colorization
Capability code: video-colorization
Capability: Intelligently colorizes black-and-white or near-monochrome video.
Use cases: old footage restoration, B&W material colorization.
Request notes: Body VideoEnhanceReqDto.
Output notes: Get the result video from output.url when complete.
Video Low-light Enhancement
Capability code: video-low-light-enhance
Capability: Improves visible detail in dark / low-light scenes.
Use cases: night scenes, indoor low-light footage brightening.
Request notes: Body VideoEnhanceReqDto.
Output notes: Get the result video from output.url when complete.
Video High-texture SR
Capability code: video-high-texture-sr
Capability: Preserves high-texture detail while upscaling.
Use cases: architecture, nature and other texture-rich content.
Request notes: Body VideoEnhanceReqDto.
Output notes: Get the result video from output.url when complete.
Video Deinterlace
Capability code: video-deinterlace
Capability: Removes combing / interlace artifacts.
Use cases: old TV signals, interlaced-to-progressive conversion.
Request notes: Body VideoEnhanceReqDto.
Output notes: Get the result video from output.url when complete.
Video Watermark Removal
Capability code: video-remove-watermark
Capability: Removes watermark regions in video by bounding box.
Use cases: remove corner marks/watermarks from owned assets (ensure compliant usage).
Request notes: Body VideoRmWaterMarkReqDto; required videoUrl, waterMarkParam. X/Y are the watermark top-left (origin at frame top-left); W/H are width/height in pixels (≥0); JSON field names must be uppercase.
Output notes: Get the result video from output.url when complete.
{
"videoUrl": "https://example.com/input.mp4",
"waterMarkParam": { "X": 100, "Y": 40, "W": 180, "H": 60 },
"outputFmt": "mp4"
}
Video Background Removal
Capability code: video-remove-background
Capability: Segments the subject from the background and outputs a video with a transparent background.
Use cases: portrait/product video matting, transparent dynamic assets.
Request notes: Body VideoRmBgReqDto; required videoUrl; optional clientTaskId.
Output notes: The result is an MOV video with an alpha channel (background removed). Download from output.url when complete.
{
"videoUrl": "https://example.com/input.mp4"
}
Hetu Style Video
Capability code: video-hetu-style
Capability: Generates a short video from an input image by style specs code.
Use cases: turn still images into motion video with preset styles.
Request notes: Body VideoStyleFilterReqDto; required imageUrl, specsCode; optional clientTaskId. Returns 1003002 if the style is invalid. Duration and resolution come from the style config — do not send outputDuration / outputRes.
Output notes: Get result video from output.url; billed by the style unit price of specsCode.
{
"imageUrl": "https://example.com/style-ref.jpg",
"specsCode": "hetu_video_001"
}
Hetu Style Video (Custom)
Capability code: video-hetu-style-custom
Capability: Generates a short video from an input image via custom prompt.
Use cases: image-to-video with free-form style/motion description.
Request notes: Body VideoStyleFilterCustomReqDto; required imageUrl, prompt, outputDuration (2–5), outputRes (must be uppercase 480P/720P); optional clientTaskId.
Output notes: Get the result video from output.url; billed as resolution unit price × duration.
{
"imageUrl": "https://example.com/ref.jpg",
"prompt": "slow push-in, warm sunset atmosphere",
"outputDuration": 4,
"outputRes": "720P"
}
Hetu Style Video (Frames)
Capability code: video-hetu-style-frames
Capability: Generates a transition short video from start/end frame images.
Use cases: given start/end frames, generate intermediate transition animation.
Request notes: Body VideoStyleFilterFramesReqDto; imageUrls max 2; required specsCode; optional clientTaskId. Excess images return 1001005; invalid style returns 1003002. Duration and resolution come from the style config — do not send outputDuration / outputRes.
Output notes: Get the result video from output.url; billed by the style unit price of specsCode.
{
"imageUrls": [
"https://example.com/frame-start.jpg",
"https://example.com/frame-end.jpg"
],
"specsCode": "hetu_video_001"
}
Common APIs
Image and video tasks share the query API below.
Query Task Status (generic polling API)
Capability code: tasks/{task_id}
| Param | Type | Required | Description |
|---|---|---|---|
task_id | String | Yes | The taskId returned at task creation (path parameter) |
reqInfoJson is returned only for text-to-image or multi-image-to-image tasks; input is returned only when an input resource URL exists; output is returned only when status=completed.Example · processing (single image) processing
{
"code": 0,
"msg": "request success",
"data": {
"taskId": "550e8400-e29b-41d4-a716-446655440000-20260717103000",
"status": "processing",
"pointsConsumed": 10,
"clientTaskId": "my-task-001",
"input": { "url": "https://example.com/photo.jpg", "width": 800, "height": 600, "size": 123456 }
}
}
Example · processing (multi-image-to-image) processing
{
"code": 0,
"msg": "request success",
"data": {
"taskId": "550e8400-e29b-41d4-a716-446655440000-20260717103000",
"status": "processing",
"pointsConsumed": 10,
"clientTaskId": "my-task-002",
"reqInfoJson": {
"prompt": "a cyberpunk city at night",
"imageUrls": [
"https://example.com/ref1.jpg",
"https://example.com/ref2.jpg"
],
"resolution": "2K",
"ratio": "16:9"
},
"input": { "url": "https://example.com/ref1.jpg", "width": 1024, "height": 768, "size": 234567 }
}
}
reqInfoJson returns the user's original request info (including the imageUrls array); input returns only the primary input image info.Example · processing (text-to-image) processing
{
"code": 0,
"msg": "request success",
"data": {
"taskId": "550e8400-e29b-41d4-a716-446655440000-20260717103000",
"status": "processing",
"pointsConsumed": 10,
"clientTaskId": "my-task-003",
"reqInfoJson": {
"prompt": "a corgi wearing sunglasses",
"resolution": "2K",
"ratio": "1:1"
}
}
}
input field; reqInfoJson returns the user's original request info.Example · completed completed
{
"code": 0,
"msg": "request success",
"data": {
"taskId": "550e8400-e29b-41d4-a716-446655440000-20260717103000",
"status": "completed",
"pointsConsumed": 10,
"clientTaskId": "my-task-001",
"input": { "url": "https://example.com/photo.jpg", "width": 800, "height": 600, "size": 123456 },
"output": { "url": "https://cdn.example.com/output/result.jpg", "width": 1600, "height": 1200, "size": 654321 }
}
}
Example · failed failed
{
"code": 0,
"msg": "request success",
"data": {
"taskId": "550e8400-e29b-41d4-a716-446655440000-20260717103000",
"status": "failed",
"pointsConsumed": 10,
"clientTaskId": "my-task-001",
"errorCode": 999,
"errorMsg": "processing failed",
"input": { "url": "https://example.com/photo.jpg", "width": 800, "height": 600, "size": 123456 }
}
}
1002001 when the task does not exist; 1002002 when the task has been deleted (data is null).Code Examples
Using "Photo Restoration" to show the full flow (submit task + poll result). For other APIs, just change the request path and body.
Python
import time
import requests
BASE_URL = "https://api.developer.magictiger.ai"
TOKEN = "YOUR_TOKEN"
HEADERS = {"Authorization": f"Bearer {TOKEN}", "Content-Type": "application/json"}
def create_task(path, payload):
resp = requests.post(f"{BASE_URL}/v1/{path}", json=payload, headers=HEADERS, timeout=30)
data = resp.json()
if data["code"] != 0:
raise RuntimeError(f"create task failed: {data['code']} {data['msg']}")
return data["data"]["taskId"]
def wait_result(task_id, interval=3, timeout=300):
deadline = time.time() + timeout
while time.time() < deadline:
data = requests.get(f"{BASE_URL}/v1/tasks/{task_id}", headers=HEADERS, timeout=30).json()["data"]
if data["status"] == "completed":
return data
if data["status"] == "failed":
raise RuntimeError(f"task failed: {data.get('errorMsg')}")
time.sleep(interval)
raise TimeoutError("task timeout")
tid = create_task("photo-restore", {"imageUrl": "https://example.com/old-photo.jpg"})
print("output url:", wait_result(tid)["output"]["url"])
Node.js
const BASE_URL = "https://api.developer.magictiger.ai";
const TOKEN = "YOUR_TOKEN";
const headers = { Authorization: `Bearer ${TOKEN}`, "Content-Type": "application/json" };
async function createTask(path, payload) {
const resp = await fetch(`${BASE_URL}/v1/${path}`, { method: "POST", headers, body: JSON.stringify(payload) });
const { code, msg, data } = await resp.json();
if (code !== 0) throw new Error(`create task failed: ${code} ${msg}`);
return data.taskId;
}
async function waitResult(taskId, interval = 3000, timeout = 300000) {
const deadline = Date.now() + timeout;
while (Date.now() < deadline) {
const { data } = await (await fetch(`${BASE_URL}/v1/tasks/${taskId}`, { headers })).json();
if (data.status === "completed") return data;
if (data.status === "failed") throw new Error(`task failed: ${data.errorMsg}`);
await new Promise((r) => setTimeout(r, interval));
}
throw new Error("task timeout");
}
(async () => {
const tid = await createTask("photo-restore", { imageUrl: "https://example.com/old-photo.jpg" });
console.log("output url:", (await waitResult(tid)).output.url);
})();
Java(OkHttp)
OkHttpClient client = new OkHttpClient();
MediaType JSON = MediaType.parse("application/json");
String base = "https://api.developer.magictiger.ai", token = "YOUR_TOKEN";
RequestBody body = RequestBody.create(
"{\"imageUrl\":\"https://example.com/old-photo.jpg\"}", JSON);
Request req = new Request.Builder()
.url(base + "/v1/photo-restore")
.header("Authorization", "Bearer " + token)
.post(body)
.build();
try (Response resp = client.newCall(req).execute()) {
System.out.println(resp.body().string()); // parse data.taskId, then poll GET /v1/tasks/{taskId}
}
Best Practices
- Prepare images: prefer stable, publicly accessible HTTPS direct links; avoid short-lived signed URLs that may expire before the server downloads them (error code
1001002). - Control size: keep each image ≤ 20MB; compress before uploading to speed up downloads and reduce failures.
- Idempotency: generate a unique
clientTaskIdper business request to avoid duplicate tasks and duplicate billing on retries. - Polling backoff: start at ~2s and gradually back off to ~5s to avoid triggering rate limiting.
- Timeout fallback: set an overall max wait (e.g. 5 minutes); on timeout, run your fallback logic and alert.
- Handle degradation: when you receive
code=-1with "Service temporarily unavailable", retry with exponential backoff. - Persist results: download the
output.urlimage promptly and store it in your own storage to avoid loss after the URL expires. - Video watermark coordinates: origin is the frame top-left;
X/Yare the watermark top-left,W/Hare width/height in pixels; JSON field names must be uppercase.
FAQ
Q1: The task stays in queuing / processing — is that normal?
Yes, it means the task is queued or being processed. Keep polling with a backoff strategy; if it takes far longer than expected, contact support with the taskId.
Q2: Why do I get 1001002 resource URL validation failed?
Usually the image URL is unreachable, requires auth, has expired, or is not a direct image link. Make sure the URL can be downloaded anonymously by the server.
Q3: Is clientTaskId required?
No. But a unique value is strongly recommended for idempotency, to avoid duplicate tasks and duplicate billing.
Q4: How do I know how many points each task consumed?
The TaskResultDto.pointsConsumed field returns the points consumed by the task.
Q5: Can the output image URL be used long-term?
Not recommended. The output URL has an expiry; download and store it in your own storage promptly after completion.
Q6: What should I do when I receive "Service temporarily unavailable"?
This is a degraded response (code=-1). Retry later with exponential backoff.
API Cheat Sheet
Browse by category: Image APIs, Video APIs, and Common APIs.
| API | Method | Path | Body |
|---|---|---|---|
| Image APIs | |||
| Photo Restoration | POST | /v1/photo-restore | PhotoRestoreReqDto |
| Photo Enhancement | POST | /v1/photo-enhance | PhotoRestoreReqDto |
| Enhance & Restore Pro | POST | /v1/photo-enhance-restore | PhotoRestoreReqDto |
| Super Resolution | POST | /v1/photo-sr | PhotoRestoreReqDto |
| Motion Deblurring | POST | /v1/photo-deblurring | PhotoRestoreReqDto |
| Scratch Removal | POST | /v1/photo-scratch-removal | PhotoRestoreReqDto |
| B&W Colorization | POST | /v1/photo-colorization | PhotoRestoreReqDto |
| Damaged Photo Repair | POST | /v1/photo-damaged-restore | PhotoRestoreReqDto |
| Low-light Enhancement | POST | /v1/photo-low-light-enhance | PhotoRestoreReqDto |
| Partial Repainting | POST | /v1/photo-partial-repainting | PhotoPromptReqDto |
| Clothes Change | POST | /v1/photo-change-clothes | PhotoChangeReqDto |
| Image Expansion | POST | /v1/photo-expansion | PhotoExpansionDto |
| Sky Filter (Offline) | POST | /v1/photo-sky-filter | - |
| Face Dynamization (Offline) | POST | /v1/photo-face-dynamization | - |
| AI Image Filter | POST | /v1/photo-filter | PhotoSpecsCodeReqDto |
| AI Portrait | POST | /v1/photo-portrait | PhotoSpecsCodeReqDto |
| AI Hetu Image Filter | POST | /v1/photo-hetu-filter | PhotoFilterReqDto |
| Doubao Seedream 4.0 | POST | /v1/photo-doubao-seedream-4-0 | PhotoGptImagePromptReqDto |
| Doubao Seedream 4.5 | POST | /v1/photo-doubao-seedream-4-5 | PhotoGptImagePromptReqDto |
| Doubao Seedream 5.0 Lite | POST | /v1/photo-doubao-seedream-5-0-lite | PhotoGptImagePromptReqDto |
| Doubao Seedream 5.0 Pro | POST | /v1/photo-doubao-seedream-5-0-pro | PhotoGptImagePromptReqDto |
| GPT Image 2 | POST | /v1/photo-photo-gpt-image-2 | PhotoGptImagePromptReqDto |
| Gemini 3.1 Flash Image(Nano Banana 2) | POST | /v1/photo-gemini-3-1-flash-image | PhotoGptImagePromptReqDto |
| Gemini 3 Pro Image(Nano Banana Pro) | POST | /v1/photo-gemini-3-pro-image | PhotoGptImagePromptReqDto |
| AI Hetu Image | POST | /v1/photo-hetu-image | PhotoGptImagePromptReqDto |
| Background Removal | POST | /v1/photo-remove-bg | PhotoRestoreReqDto |
| Target Removal | POST | /v1/photo-target-removal | PhotoRestoreReqDto |
| Image Watermark Removal | POST | /v1/photo-remove-watermark | PhotoRestoreReqDto |
| Face Segmentation | POST | /v1/photo-face-segmentation | PhotoRestoreReqDto |
| One-click Inpainting | POST | /v1/photo-inpainting | PhotoRestoreReqDto |
| ID Photo | POST | /v1/photo-id-photo | PhotoFilterReqDto |
| Video APIs | |||
| Video Super Resolution | POST | /v1/video-sr | VideoEnhanceReqDto |
| Video Face Super Resolution | POST | /v1/video-sr-face | VideoEnhanceReqDto |
| Video Denoising | POST | /v1/video-denoising | VideoEnhanceReqDto |
| Video Color Enhancement | POST | /v1/video-color-enhance | VideoEnhanceReqDto |
| Video B&W Colorization | POST | /v1/video-colorization | VideoEnhanceReqDto |
| Video Low-light Enhancement | POST | /v1/video-low-light-enhance | VideoEnhanceReqDto |
| Video High-texture SR | POST | /v1/video-high-texture-sr | VideoEnhanceReqDto |
| Video Deinterlace | POST | /v1/video-deinterlace | VideoEnhanceReqDto |
| Video Watermark Removal | POST | /v1/video-remove-watermark | VideoRmWaterMarkReqDto |
| Video Background Removal | POST | /v1/video-remove-background | VideoRmBgReqDto |
| Hetu Style Video | POST | /v1/video-hetu-style | VideoStyleFilterReqDto |
| Hetu Style Video (Custom) | POST | /v1/video-hetu-style-custom | VideoStyleFilterCustomReqDto |
| Hetu Style Video (Frames) | POST | /v1/video-hetu-style-frames | VideoStyleFilterFramesReqDto |
| Common APIs | |||
| Query Task Status | GET | /v1/tasks/{task_id} | None (path param) |
Glossary
| Term | Description |
|---|---|
| Async task | A task mode that returns a taskId immediately and requires polling for the final result |
| taskId | Unique task identifier returned at creation, used for polling |
| clientTaskId | Client-defined task ID for idempotency |
| reqInfoJson | User's original request info returned on query for text-to-image or multi-image-to-image tasks |
| pointsConsumed | Number of points consumed per task |
| Bearer Token | Token auth in the header as Authorization: Bearer {token} |
| Rate limit / Circuit breaker / Isolation | Request-protection mechanisms enabled server-side for stability; return a degraded response when triggered |
Changelog
| Version | Date | Notes |
|---|---|---|
| v1.5 | 2026-08-20 | Added Overview section「How to get specsCode」: obtain style codes and sample images from Capability Market detail pages; clarified video enhance resolution specsCode vs Capability Market style codes |
| v1.4 | 2026-08-19 | Added Video Background Removal API docs; output is alpha-channel MOV — use an alpha-capable player for preview (mpv recommended) |
| v1.3 | 2026-08-19 | Hetu Style Video / Frames: removed outputDuration and outputRes (determined by style config; billed by style unit price); Custom still requires duration and uppercase resolution, billed as resolution unit price × duration |
| v1.2 | 2026-08-17 | Added background removal, target removal, watermark removal, face segmentation, one-click inpainting, ID photo; added 9 video enhance APIs and 3 Hetu style video APIs; added video DTOs and common validation rules; docs reorganized into Image / Video / Common categories |
| v1.1 | 2026-08-04 | API changes: added AI Image Filter, AI Portrait, AI Hetu Image Filter, Doubao Seedream 4.0/4.5/5.0-lite/5.0-pro, GPT Image 2, Gemini 3.1 Flash Image, Gemini 3 Pro Image, AI Hetu Image; photo-filter switched to specs-code mode; Sky Filter and Face Dynamization taken offline |
| v1.0 | 2026-07-17 | Initial release covering multiple image-processing APIs and 1 task-query API, with code examples, best practices, FAQ and glossary |