# 任务 API

> Documentation Index / 文档总索引  
> https://x2v.light-ai.top/llms.txt  
> Source: https://x2v.light-ai.top/api-docs#task-api  
> Locale: zh-CN  
> 本页内容已为 Agent/LLM 阅读优化。

对异步媒体生成任务进行报价和执行。

## 媒体输入

可访问 URL 使用 `{"type":"url","data":"https://..."}`，本地字节使用 `{"type":"base64","data":"..."}`。部分字段可接收列表，多角色 S2V 可接收目录包；构造请求前读取 OpenAPI 的 `MediaInput` 和所选模型规格。

## 报价与提交

`POST /api/v1/billing/quote` 预估积分；媒体报价使用 `input_meta`，无需上传字节。`POST /api/v1/task/submit` 对参数校验和任务创建具有最终权威。保存返回的 `task_id`，用于状态查询和恢复。

## 状态与结果

`GET /api/v1/task/query?task_id=...` 返回异步状态。终态为 `SUCCEED`、`FAILED` 和 `CANCEL`；已知状态包括 `CREATED`、`PENDING`、`RUNNING`、`SUCCEED`、`FAILED`、`CANCEL`。成功后调用 `/api/v1/task/result_url` 并传 `output_image` 或 `output_video`。签名 URL 仅临时有效。

## Related / 相关主题

[quick-start](/api-docs/quick-start.md) · [authentication](/api-docs/authentication.md) · [model-discovery](/api-docs/model-discovery.md) · [workflow-api](/api-docs/workflow-api.md) · [errors](/api-docs/errors.md)

OpenAPI: https://x2v.light-ai.top/openapi.json · Live models: https://x2v.light-ai.top/api/v1/model/list · Skill: https://github.com/ModelTC/LightX2V-Skills
