POST /v1/videos/generations
使用此 HTTP 端点文档列出的请求字段和权限。
请求示例#
curl -X POST 'https://platform.tongai.io/v1/videos/generations' \ -H "Authorization: Bearer $TONG_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: 45be69f1-c266-4a09-a82c-bf3c6303eb03" \ -d '{ "quote_id": "example", "media_conversation_id": "aaaaaaaaaaaaaaaaaaaaaaaa", "prompt": "A quiet street at blue hour", "parameters": {}}'配置
curl --version身份验证#
为自己的账户使用服务器端 API 密钥,为各客户的账户使用 OAuth。切勿将密钥放入提示词或工具参数。
generation:writecredits:spend参数#
Idempotency-Keystring必填UUID,例如 e8aa0a87-6cd9-42eb-975a-b72bf43218c8。
请求正文#
application/jsonquote_idstring必填使用字母、数字或连字符。
最小长度:1 个字符。
最大长度:120 个字符。
media_conversation_idstring必填24 位十六进制 ID。
promptstring必填描述您希望创作的结果。
最小长度:1 个字符。
最大长度:32000 个字符。
input_asset_idsstring[]可选最多项目数:30。
默认值:[]。
parametersobject必填workspace_project_idstring可选24 位十六进制 ID。
响应架构#
{ "id": "e8aa0a87-6cd9-42eb-975a-b72bf43218c8", "tool": "example", "category": "example", "channel": "api", "state": "queued", "status": "accepted", "stage": "admission", "dispatch_status": "pending", "created_at": "2026-10-22T09:00:00.000Z", "updated_at": "2026-10-22T09:00:00.000Z", "detail_expires_at": "2026-10-22T09:00:00.000Z", "detail_expired": false, "timing": { "dispatch_started_at": "2026-10-22T09:00:00.000Z", "acknowledged_at": "2026-10-22T09:00:00.000Z", "completed_at": "2026-10-22T09:00:00.000Z", "dispatch_acknowledgement_ms": 0, "end_to_end_ms": 0 }, "review": null, "result": null, "error": { "code": "example" }, "billing": { "status": "none", "usage_credits": "0.000000", "wallet_debited_credits": "0.000000" }}HTTP 202
application/jsonidstring必填已保存操作的唯一 ID。
UUID,例如 e8aa0a87-6cd9-42eb-975a-b72bf43218c8。
toolstring必填categorystring必填channelstring必填"api""mcp"statestring必填已保存任务当前的执行状态。
"queued""running""waiting""needs_review""paused""reconciling""succeeded""failed""cancelled"statusstring必填跟踪操作时使用的总体状态。
"accepted""running""needs_review""paused""reconciling""succeeded""failed""cancelled"stagestring必填操作当前所处的阶段。
"admission""dispatch""review""generation""reconciliation""complete"dispatch_statusstring必填表示工具是否接受了请求。确认接受并不代表生成已完成。
"pending""unknown""acknowledged"created_atstring必填ISO 8601 日期和时间,例如 2026-10-22T09:00:00Z。
updated_atstring必填ISO 8601 日期和时间,例如 2026-10-22T09:00:00Z。
detail_expires_atstring | null必填已存储操作详情的到期时间。null 表示当前未设置到期时间。
ISO 8601 日期和时间,例如 2026-10-22T09:00:00Z。
detail_expiredboolean必填已存储的操作详情是否已到期。
timingobject必填用于跟踪此操作的时间戳和耗时。
显示嵌套字段
dispatch_started_atstring | null必填ISO 8601 日期和时间,例如 2026-10-22T09:00:00Z。
acknowledged_atstring | null必填ISO 8601 日期和时间,例如 2026-10-22T09:00:00Z。
completed_atstring | null必填ISO 8601 日期和时间,例如 2026-10-22T09:00:00Z。
dispatch_acknowledgement_msnumber | null必填最小值:0。
end_to_end_msnumber | null必填最小值:0。
reviewJSON | null必填操作需要人工输入时的审核信息;否则为 null。
resultJSON | null必填此工具返回的输出,尚无输出时为 null。
errorobject | null必填操作失败时的公开错误代码;否则为 null。
显示嵌套字段
codestring必填billingobject必填客户积分用量和钱包扣费。输出就绪与账单结算是独立状态。
显示嵌套字段
statusstring必填"none""pending""settled""released""reconciling"usage_creditsstring必填保留六位小数的十进制字符串,例如 1.250000。
wallet_debited_creditsstring必填保留六位小数的十进制字符串,例如 1.250000。
released_creditsstring可选保留六位小数的十进制字符串,例如 1.250000。
refunded_creditsstring可选保留六位小数的十进制字符串,例如 1.250000。
unfunded_creditsstring可选保留六位小数的十进制字符串,例如 1.250000。
pending_creditsstring可选保留六位小数的十进制字符串,例如 1.250000。
tokensobject可选显示嵌套字段
inputnumber可选最小值:0。
outputnumber可选最小值:0。
cachednumber可选最小值:0。
cache_writenumber可选最小值:0。
componentsobject[]可选显示嵌套字段
idstring可选source_idstring必填toolstring必填modelstring | null必填channelstring必填"api""mcp"credential_idstring必填kindstring必填"text_pool""reasoning""generation"usage_creditsstring必填保留六位小数的十进制字符串,例如 1.250000。
wallet_debited_creditsstring必填保留六位小数的十进制字符串,例如 1.250000。
evidence_atstring可选ISO 8601 日期和时间,例如 2026-10-22T09:00:00Z。
updated_atstring可选ISO 8601 日期和时间,例如 2026-10-22T09:00:00Z。
quoteobject可选报价可用时返回的配置、价格和提交值。
显示嵌套字段
idstring必填UUID,例如 e8aa0a87-6cd9-42eb-975a-b72bf43218c8。
operation_idstring必填UUID,例如 e8aa0a87-6cd9-42eb-975a-b72bf43218c8。
toolstring必填operationstring | null必填modelstring | null必填configurationobject必填submit_valuestring必填submit_fieldstring必填quoted_creditsstring | null必填保留六位小数的十进制字符串,例如 1.250000。
expires_atstring | null必填ISO 8601 日期和时间,例如 2026-10-22T09:00:00Z。
错误与限制#
| HTTP | 错误 | 恢复 |
|---|---|---|
400 | 无效请求REQUEST_INVALID | 重试前请修正错误指出的字段。 |
401 | 无效凭据CREDENTIAL_INVALID | 检查凭据、有效期以及是否已被撤销。 |
402 | 积分不足INSUFFICIENT_CREDITS | 为凭据所属账户充值积分,然后继续已保存的任务。 |
403 | 权限被拒绝SCOPE_REQUIRED | 使用具有所需权限且可访问所选资源的凭据。 |
404 | 资源不可用RESOURCE_UNAVAILABLE | 检查资源 ID,并确认其属于已授权账户。 |
409 | 操作意图冲突IDEMPOTENCY_CONFLICT | 仅为原始请求复用意图标识。不同操作请使用新的 UUID。 |
429 | 已达速率限制RATE_LIMITED | 等待 Retry-After 指定的时间后再重试同一请求。 |
503 | 暂时不可用DEPENDENCY_UNAVAILABLE | 等待 Retry-After 指定时间并使用同一意图重试。超时后检查已保存的操作。 |