Use this skill when building or reviewing code that calls Weydub API from a backend service, script, internal tool, CI job, AI coding tool, or automation agent.
Source Of Truth
Read these docs before implementing:
- https://weydub.com/docs/api/
- https://weydub.com/docs/api/quickstart.md
- https://weydub.com/docs/api/api-reference.md
- https://weydub.com/docs/api/auth-and-signing.md
- https://weydub.com/docs/api/async-task-model.md
- https://weydub.com/docs/api/demo-scenarios.md
Then read the workflow page that matches the task:
- Subtitle/text removal: https://weydub.com/docs/api/video-subtitle-removal.md
- Video translation/dubbing: https://weydub.com/docs/api/video-translation.md
- Subtitle extraction: https://weydub.com/docs/api/subtitle-extraction.md
- Image translation: https://weydub.com/docs/api/image-translation.md
Core Contract
- Base URL:
https://api.zhaoli.com - Protocol: HTTPS
- Request method:
POST - Content type:
application/json - Auth headers:
AppKey,AppSign - Signature:
AppSign = md5(md5(request_body) + AppSecret) - Use compact JSON for signing and sending.
- Treat media jobs as asynchronous.
- Confirm account entitlement before using image API, Advanced Lite/Pro removal, high-emotion dubbing, or batch-specific flows.
- Use callbacks in production and polling as a fallback.
- Verify
Callback-Signfor webhook callbacks. - Keep
AppSecretserver-side only.
Unsigned exception:
POST /v-w-c/enum/query2Use it for dynamic enums such as sourceLang, Lang, ProcessStatus, and ImageTaskStatus.
Credential Rules
- Read credentials from
WEYDUB_APP_KEYandWEYDUB_APP_SECRET, or from a secret manager. - Never hardcode credentials.
- Never put
AppSecretin browser/client code. - Never print
AppSecretin logs, screenshots, error messages, or generated docs. - Never paste real credentials into prompts, issue trackers, or retained chat history.
Implementation Pattern
- Build a small backend client with one
apiPost(path, payload)helper. - Serialize
payloadwith compact JSON. - Compute
bodyMd5 = md5(body). - Compute
AppSign = md5(bodyMd5 + AppSecret). - Send
Content-Type,AppKey, andAppSignheaders. - Persist returned project/work/task IDs.
- Poll status or receive callback.
- Verify callback signatures and make callback handlers idempotent.
- Store final
videoUrl,srcSrtUrl,tgtSrtUrl, image result URLs, anderrorDetail.
Four Main Workflows
Remove Subtitles And Text
Endpoint:
POST /v-w-c/gateway/ve/work/freeBasic payload:
{
"urls": ["https://example.com/video.mp4"],
"needChineseOcclude": 1,
"videoInpaintLang": "all"
}Use needChineseOcclude: 2 and videoInpaintMasks for known regions. Use extraOptions.extra_inpaint_config.model for Advanced Lite/Pro when enabled. Do not assume moving text, Advanced Lite, Advanced Pro, or CRF override entitlement.
Common models:
advanced_liteadvanced_large_boxadvanced_full
CRF override can use extraOptions.write_options.crf when enabled. Lower CRF values such as 15 or 16 can add storage/bandwidth cost.
Keep videoInpaintMasks and extraOptions as compact JSON strings in public API payloads unless the account contract says otherwise.
Translate Videos
Endpoint:
POST /v-w-c/gateway/ve/work/freeFull subtitle + dubbing payload:
{
"urls": ["https://example.com/source.mp4"],
"needWanyin": 1,
"sourceLang": "en",
"lang": "es",
"wyTaskType": "FULL",
"wyNeedText": 1
}Other modes:
- Subtitle only:
wyTaskType: "NO_TTS"or account-supported equivalent. - ASR only:
wyTaskType: "ONLY_ASR",wyNeedText: 0. - On-screen text translation:
needWanyin: 0,needChineseOcclude: 11. - High-emotion dubbing:
POST /v-w-c/gateway/ve/work/voice/incorporateonly when enabled.
Keep wyVoiceParam and extraOptions as compact JSON strings when used.
Extract Subtitles
OCR payload:
{
"urls": ["https://example.com/video.mp4"],
"needChineseOcclude": 14,
"videoInpaintLang": "en",
"lang": "en",
"videoInpaintMasks": "[{\"type\":\"trans_only_ocr\",\"region\":[[0,0.8],[1,0.8],[1,1],[0,1]]}]",
"extraOptions": "{\"extra_inpaint_config\":{\"auto_correct_on\":false,\"strip_last_punct_on\":true,\"scene_filter_on\":false}}"
}ASR payload:
{
"urls": ["https://example.com/video.mp4"],
"needWanyin": 1,
"sourceLang": "en",
"lang": "en",
"wyTaskType": "ONLY_ASR",
"needWyEdit": 0,
"wyNeedText": 0,
"extraOptions": "{\"asr_speaker_detect_on\":true,\"extra_video_translate_config\":{\"remove_last_punct_on\":true}}"
}Use OCR for burned-in captions. Use ASR for spoken dialogue.
Translate Images
Confirm image API activation before production use.
Current public endpoint:
POST /v-w-c/gateway/ve/image/translateImage translation payload:
{
"srcLang": "en",
"tgtLang": "es",
"translateOn": 1,
"synthesisOn": 1,
"commodityFilterOn": 0,
"downloadInfo": "{\"url\":\"https://example.com/product.png\",\"fileName\":\"product.png\",\"id\":12345,\"materialName\":\"product.png\"}",
"app": "WD"
}Image text removal payload:
{
"srcLang": "en",
"tgtLang": "en",
"translateOn": 0,
"synthesisOn": 1,
"commodityFilterOn": 0,
"downloadInfo": "{\"url\":\"https://example.com/banner.png\",\"fileName\":\"banner.png\",\"id\":12346,\"materialName\":\"banner.png\"}",
"app": "WD"
}Redo endpoint:
POST /v-w-c/gateway/ve/image/translate/redoFor redo, edit only meta_data.translation, meta_data.fill_color, meta_data.stroke_color, and meta_data.trans_font_size unless support confirms otherwise.
Keep downloadInfo, downloadInfos, and redo result stringified.
Limits And Retention
- Video hard limit: 15 minutes per file.
- Video hard limit: 1000 MB per file.
- Image hard limits:
2000*2000 px,50 MB. - Image formats:
png,jpeg,jpg,bmp,webp. - Image URLs must not contain Chinese characters.
- Video billing unit: 30 seconds. Clips shorter than 30 seconds count as 30 seconds.
- Combined services can stack costs.
- Final failed tasks (
processStatus > 1) deduct zero credits. - Default resource retention keeps source/rendered assets for the last 30 days. Store result assets after callback.
- Default video CRF is
17; lower CRF such as15or16can increase bandwidth/storage cost when enabled.
Callback Rules
- Callback body is the work/task item, not the polling response wrapper.
- Verify
Callback-Signwithmd5(md5(raw_callback_body) + AppSecret). - Return HTTP 200 plus any non-empty body only after durable storage succeeds.
- Failed callbacks for tasks created within 24 hours are retried about every 30 minutes.
- Make handlers idempotent by work ID or image task ID.
- Redo operations can change output URLs; store the latest successful URL.
Demo QA
Use official demo assets before customer media:
- English video:
http://gc9.cdn.izhaoli.cn/ghostcut_demo/TextRemoval_Dubbing_Eng.mp4 - Chinese high-emotion video:
http://gc9.cdn.izhaoli.cn/ghostcut_demo/HighEmotion_Dubbing_cn2en.mp4 - Chinese high-emotion JSON:
http://gc9.cdn.izhaoli.cn/ghostcut_demo/HighEmotion_Dubbing_cn2en.json
This repository may include:
python3 scripts/run-weydub-api-demos.py --dry-run
python3 scripts/run-weydub-api-demos.py --scenario removal --submit --waitDo Not
- Do not create frontend-only examples that expose
AppSecret. - Do not sign pretty JSON and send compact JSON.
- Do not mutate payloads after signing.
- Do not treat create responses as completed jobs.
- Do not invent endpoint availability for an account.
- Do not combine unrelated workflow modes in one request unless the docs show that exact combination.
- Do not skip result storage; Weydub assets follow retention rules.