Mangogo 营业厅Mangogo 营业厅
首页API 参考Skills插件

POST /v1/apps/tasks

POST/v1/apps/tasks

提交生成任务。外层请求结构统一;inputs 内容随应用变化。

提交生成任务。外层请求结构统一;inputs 内容随应用变化。

鉴权:Bearer Token(完整)

Content-Type:application/json(也支持与 C 端一致的 multipart/form-data 上传文件)

统一请求结构

{  "app_code": "self_face_swap_v3",  "inputs": {}}
字段类型必填说明
app_codestring是应用编码,来自 GET /v1/apps
inputsobject是*业务入参;键名、类型、是否必填由该应用 input_schema 决定

关于 inputs(按应用差异)

  • 不要假设所有应用使用同一套字段名。
  • 创建前请确认目标应用在后台配置的入参(控件角色、param_name、是否必填、计费时长来源等)。
  • 素材建议使用可公网访问的 http(s) URL;服务端下载时仍受 SSRF / 域名策略约束。
  • Token 限定额度时:若预扣金额大于 Token 剩余额度,即使钱包余额充足也会失败。
  • 下方为公开 inputs 示例(不含部分敏感应用);字段名以线上应用配置为准。

各应用 inputs 示例(由数据库生成)

以下示例根据已上架应用的 input_schema、默认素材路径等自动生成。字段名以线上配置为准;占位 URL(example.com)请替换为真实可访问素材。

共 7 个已上架应用。

1.视频角色替换

self_video_to_video_mix_v4

请求结构:

{  "app_code": "self_video_to_video_mix_v4",  "inputs": {    "face_image": "https://example.com/apps-demo/self_video_to_video_mix_v4/face_image.png",    "height": "sample_height",    "source_video": "https://example.com/apps-demo/self_video_to_video_mix_v4/source_video.mp4",    "width": "sample_width"  }}

参数说明:

字段标题类型必填
source_video原视频string是
face_image人脸图string是
width宽度string是
height高度string是

2.图片角色替换

self_face_swap_v3

请求结构:

{  "app_code": "self_face_swap_v3",  "inputs": {    "face_image": "https://example.com/apps-demo/self_face_swap_v3/face_image.png",    "original_image": "https://example.com/apps-demo/self_face_swap_v3/original_image.png"  }}

参数说明:

字段标题类型必填
original_image原图string是
face_image人脸图string是

3.MiniMax H3 Video Character Replacement

self_minimax_h3_video_swap_v1

请求结构:

{  "app_code": "self_minimax_h3_video_swap_v1",  "inputs": {    "ref_images": "https://example.com/apps-demo/self_minimax_h3_video_swap_v1/ref_images.png",    "short_side": "480",    "source_video": "https://example.com/apps-demo/self_minimax_h3_video_swap_v1/source_video.mp4"  }}

参数说明:

字段标题类型必填
source_video源视频string是
ref_images目标角色参考图array是
prompt提示词string否
short_sideShort Sidestring是

4.Face Swap – Chibi Edition

self_face_swap

请求结构:

{  "app_code": "self_face_swap",  "inputs": {    "face_image": "https://example.com/apps-demo/self_face_swap/face_image.png",    "ref_image": "https://example.com/apps-demo/self_face_swap/ref_image.png"  }}

参数说明:

字段标题类型必填
ref_imageReference imagestring是
face_image人脸图string是

5.Virtual Try-On

self_try_on

请求结构:

{  "app_code": "self_try_on",  "inputs": {    "clothing_images": "https://example.com/apps-demo/self_try_on/clothing_images.png",    "old_image": "https://example.com/apps-demo/self_try_on/old_image.png"  }}

参数说明:

字段标题类型必填
old_imageOld Imagestring是
clothing_imagesClothing Imagesarray是

6.Character Composer

self_role_synthesize

请求结构:

{  "app_code": "self_role_synthesize",  "inputs": {    "costume_image": "https://example.com/apps-demo/self_role_synthesize/costume_image.png",    "portrait_image": "https://example.com/apps-demo/self_role_synthesize/portrait_image.png",    "pose_image": "https://example.com/apps-demo/self_role_synthesize/pose_image.png",    "prompt": "sample_prompt",    "style_preset": "none"  }}

参数说明:

字段标题类型必填
portrait_imagePortrait Imagestring是
costume_imageCostume Imagestring是
pose_imagePose Imagestring是
style_presetStyle presetstring是
prompt提示词string是

7.Video Cleaner – Watermark & Subtitle Remover

self_video_clear_v1

请求结构:

{  "app_code": "self_video_clear_v1",  "inputs": {    "source_video": "https://example.com/apps-demo/self_video_clear_v1/source_video.mp4"  }}

参数说明:

字段标题类型必填
source_video原视频string是

请求示例(curl)

curl https://www.mangogo.ai/v1/apps/tasks \  -H "Authorization: Bearer sk-xxx" \  -H "Content-Type: application/json" \  -d '{    "app_code": "self_face_swap_v3",    "inputs": {      "face_image": "https://assets.guid.ai/guid/users/32/2026/09/face.jpg",      "original_image": "https://assets.guid.ai/guid/users/32/2026/09/base.jpg"    }  }'

成功响应

字段顺序固定:

{  "code": 0,  "data": {    "task_id": "c1c51c886bdd2e39",    "task_no": "d5lsag6npfQgth4z",    "app_code": "self_face_swap_v3",    "status": "queued",    "status_label": "Task Queued"  },  "message": "",  "success": true}
data 字段类型说明
task_idstring平台任务 ID,用于查询
task_nostring业务单号,也可用于查询
app_codestring应用编码
statusstring任务状态,见下文
status_labelstring状态展示文案
error_codestring创建即失败时可能出现
error_messagestring创建即失败时可能出现

创建成功后请使用 GET /v1/apps/tasks/{task_id} 轮询,直至 completed / failed / cancelled。

任务状态

status说明
pending已受理,待提交上游
queued排队中
processing处理中
completed已完成
failed失败
cancelled已取消

终态:completed / failed / cancelled。建议轮询间隔 2–5 秒,并设置合理超时。

常见错误

场景典型 message
未提供 / 无效 Token鉴权相关错误(HTTP 401)
用户或 Token 额度不足额度不足 / Insufficient quota
app_code 无效或未上架应用不可用相关错误
inputs 不符合 schema参数无效相关错误
任务不存在或非本人未找到 / 未授权