Skip to main content
POST
/
api
/
open
/
v2
/
workflow
/
run
/
submit
提交工作流运行
curl --request POST \
  --url https://www.chenyu.cn/api/open/v2/workflow/run/submit \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "workflow_id": "<string>",
  "revision_id": "<string>",
  "inputs": {},
  "inputs.contains_real_person_material": true,
  "idempotency_key": "<string>",
  "accept_external_cost_risk": true
}
'
{
  "code": 123,
  "msg": "<string>",
  "data": {
    "run_order_id": "<string>",
    "workflow_id": "<string>",
    "revision_id": "<string>",
    "quote_currency": "<string>",
    "quote_amount": "<string>",
    "freeze_status": "<string>",
    "run_status": "<string>",
    "task_id": "<string>",
    "prompt_id": "<string>",
    "billing_run_id": "<string>",
    "idempotent_replay": true
  },
  "data.error": {
    "reason": "<string>",
    "detail": "<string>",
    "engine_code": "<string>",
    "status_code": 123
  }
}

Documentation Index

Fetch the complete documentation index at: https://chenyu.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

提交工作流运行

提交一次工作流运行任务。系统会先按工作流报价进行预扣费,任务完成后按实际消耗结算,多退少补以实际账单为准。
idempotency_key 必填。同一用户、相同工作流、相同幂等键的重复请求会返回同一笔运行记录,避免网络重试造成重复提交。

请求参数

workflow_id
string
required
工作流 ID
revision_id
string
工作流版本 ID。建议使用详情接口返回的 revision_id,不传时使用当前已发布版本
inputs
object
工作流输入参数。key 来自详情接口的 editable_parameter_manifest
inputs.contains_real_person_material
boolean
Seedance 视频生成工作流专用。上传的图片或视频素材包含真人并需要进行火山素材备案时传 true; 未传或为 false 时,图片、视频、音频按普通工作流 S3 公网 URL 方式提交。音频不会进入真人素材备案。
idempotency_key
string
required
幂等键,由调用方生成。建议使用业务订单号、请求流水号或 UUID
accept_external_cost_risk
boolean
是否确认接受第三方模型费用风险。工作流可能产生外部模型费用时应传 true

响应参数

code
integer
响应码,0 表示成功
msg
string
响应信息
data
object
运行提交结果

错误响应

当提交阶段调用执行引擎失败时,接口会返回一个简单原因和详细错误信息,便于定位输入参数、文件获取、实例调度或工作流执行器问题。
code
integer
0 表示失败
msg
string
简单失败原因
data.error
object
执行引擎错误详情

代码示例

import uuid
import requests

url = "https://www.chenyu.cn/api/open/v2/workflow/run/submit"
headers = {
    "Authorization": "Bearer your_api_key",
    "Content-Type": "application/json"
}
payload = {
    "workflow_id": "wf_861ef31e94dcfb10e6e7",
    "revision_id": "wfr_f9f2a2dcb99d73b0c3aa",
    "inputs": {
        "generation_category": "reference_to_video",
        "model": "doubao-seedance-2-0-fast-260128",
        "prompt": "cinematic portrait video",
        "images": [
            {
                "source_type": "url",
                "url": "https://www.chenyu.cn/media/example-image",
                "role": "reference_image"
            }
        ],
        "contains_real_person_material": true,
        "resolution": "720p",
        "duration": "5"
    },
    "idempotency_key": str(uuid.uuid4()),
    "accept_external_cost_risk": False
}

response = requests.post(url, headers=headers, json=payload)
print(response.json())

响应示例

{
  "code": 0,
  "msg": "提交成功",
  "data": {
    "run_order_id": "wfrun_314ff7d8b7a5beff1388",
    "workflow_id": "wf_861ef31e94dcfb10e6e7",
    "revision_id": "wfr_f9f2a2dcb99d73b0c3aa",
    "quote_currency": "CNY",
    "quote_amount": "0.03000000",
    "freeze_status": "frozen",
    "run_status": "queued",
    "task_id": "task_1778147626528703038_eb84d292e0851c08",
    "prompt_id": "prompt_1778147626528707364_b0c0687e49d1f72f",
    "billing_run_id": "wfbill_1778147626528703038",
    "idempotent_replay": false
  }
}

错误示例

{
  "code": 1,
  "msg": "Workflow input content is invalid.",
  "data": {
    "error": {
      "reason": "Workflow input content is invalid.",
      "detail": "input n4_video must be an uploaded file URL or file id",
      "engine_code": "INVALID_WORKFLOW_INPUT",
      "status_code": 400
    }
  }
}