# Task API

> Documentation Index / 文档总索引  
> https://x2v.light-ai.top/llms.txt  
> Source: https://x2v.light-ai.top/en/api-docs#task-api  
> Locale: en  
> This page is optimized for Agent/LLM reading.

Quote and run asynchronous media generation tasks.

## Media input

Use `{"type":"url","data":"https://..."}` for a reachable URL or `{"type":"base64","data":"..."}` for local bytes. Some inputs accept a list and multi-role S2V accepts a directory package; inspect `MediaInput` and the selected model spec before building the body.

## Quote and submit

`POST /api/v1/billing/quote` estimates credits; media quotes use `input_meta` instead of uploading bytes. `POST /api/v1/task/submit` is authoritative for validation and task creation. Save the returned `task_id` for status queries and recovery.

## Status and result

`GET /api/v1/task/query?task_id=...` returns asynchronous status. Terminal statuses are `SUCCEED`, `FAILED`, and `CANCEL`; known states are `CREATED`, `PENDING`, `RUNNING`, `SUCCEED`, `FAILED`, `CANCEL`. After success, request `/api/v1/task/result_url` with `output_image` or `output_video`. The signed URL is temporary.

## Related topics

[quick-start](/en/api-docs/quick-start.md) · [authentication](/en/api-docs/authentication.md) · [model-discovery](/en/api-docs/model-discovery.md) · [workflow-api](/en/api-docs/workflow-api.md) · [errors](/en/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
