← Docs

Video Model Guide

Video generation is asynchronous (create task → poll result). TokenHub provides a two-step API compatible with video-synthesis + GET /tasks.

1. Basic Calling Information

ItemDescription
Base URL https://tokenhub.link
Endpoints POST https://tokenhub.link/v1/video/generations
GET https://tokenhub.link/v1/video/tasks/{task_id}?model=<model>
Authentication Authorization: Bearer <TokenHub API Key>. Create the key in API Keys in console. It is shown only once when created.
Model Identifier Use model in request body. For supported models, check Model Catalog. You can call with model name or provider/model format, for example deepseek-v3.2 and alibaba/deepseek-v3.2.
Content-Type Must be application/json.

2. End-to-End Call and Response Example

2.1 Create Task

curl --location 'https://tokenhub.link/v1/video/generations' \
          -H 'X-DashScope-Async: enable' \
          -H "Authorization: Bearer $TOKENHUB_API_KEY" \
          -H 'Content-Type: application/json' \
          -d '{
          "model": "wan2.7-t2v",
          "input": {
              "prompt": "A tense detective investigation with cinematic storytelling. Shot 1 [0-3s], wide shot: rainy New York street with neon lights as a detective in a black trench coat walks quickly. Shot 2 [3-6s], medium shot: the detective enters an old building and the door slowly closes behind him. Shot 3 [6-9s], close-up: focused eyes, distant sirens, and a subtle frown. Shot 4 [9-12s], medium shot: he moves carefully through a dim corridor with a flashlight. Shot 5 [12-15s], close-up: he discovers a key clue and shows a sudden expression of realization."
          },
          "parameters": {
              "resolution": "720P",
              "ratio": "16:9",
              "prompt_extend": true,
              "watermark": true,
              "duration": 15
          }
      }'

Create-task response example:

{
    "output": {
        "task_status": "PENDING",
        "task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx"
    },
    "request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx"
}

2.2 Query Task (Polling)

curl -X GET 'https://tokenhub.link/v1/video/tasks/{task_id}?model=wan2.6-t2v' \
--header "Authorization: Bearer $TOKENHUB_API_KEY"

Polling response example (success):

{
          "request_id": "caa62a12-8841-41a6-8af2-xxxxxx",
          "output": {
              "task_id": "eff1443c-ccab-4676-aad3-xxxxxx",
              "task_status": "SUCCEEDED",
              "submit_time": "2025-09-29 14:18:52.331",
              "scheduled_time": "2025-09-29 14:18:59.290",
              "end_time": "2025-09-29 14:23:39.407",
              "orig_prompt": "An epic yet adorable scene: a small cartoon cat general in detailed golden armor stands bravely on a cliff, riding a tiny but heroic warhorse and reciting a dramatic battle poem. Below, a massive army of mice charges forward with improvised weapons. The scene blends humor, cuteness, and epic war-film atmosphere under dark clouds above distant snowy mountains.",
              "video_url": "https://dashscope-result-sh.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx"
          },
          "usage": {
              "duration": 10,
              "input_video_duration": 0,
              "output_video_duration": 10,
              "video_count": 1,
              "ratio": "16:9",
              "SR": 720
          }
}

3. Detailed Parameters

3.1 Top-level Request Body

FieldTypeRequiredDescription
modelstringYesModel name, such as wan2.6-t2v, wan2.5-t2v-preview, wan2.2-t2v-plus.
inputobjectYesInput object. Core field is prompt, and some models also support audio_url.
parametersobjectNoVideo generation control parameters, see 3.3.

3.2 input Fields

FieldTypeRequiredDescription
input.promptstringYesVideo generation prompt. Different models may have different limits on length, language, and style.
input.negative_promptstringNoNegative prompt.
input.audio_urlstring(URL)ConditionalSome models support audio-driven generation via audio_url; do not pass it when unsupported.

3.3 parameters Fields

FieldTypeRequiredDescription
sizestringNoResolution in pixels, such as 1280*720 and 832*480.
durationintegerNoVideo duration in seconds. Supported range varies by model.
prompt_extendbooleanNoWhether to enable prompt expansion.
shot_typestringNoShot mode, for example multi (supported only by some models).
watermarkbooleanNoWhether to add watermark (depends on model support).
seedintegerNoRandom seed for approximate reproducibility.

3.4 Task Status and Polling Recommendations

  • Common task states: PENDING / RUNNING / SUCCEEDED / FAILED / CANCELED / UNKNOWN.
  • Recommended polling interval is around 10-15 seconds; query validity for task_id is typically about 24 hours.
  • After success, download video_url promptly because links are usually temporary.

4. Scenario Examples

4.1 Multi-shot Narrative

curl --location 'https://tokenhub.link/v1/video/generations' \
          -H 'X-DashScope-Async: enable' \
          -H "Authorization: Bearer $TOKENHUB_API_KEY" \
          -H 'Content-Type: application/json' \
          -d '{
          "model": "wan2.7-t2v",
          "input": {
              "prompt": "A tense detective investigation with cinematic storytelling. Shot 1 [0-3s], wide shot: rainy New York street with neon lights as a detective in a black trench coat walks quickly. Shot 2 [3-6s], medium shot: the detective enters an old building and the door slowly closes behind him. Shot 3 [6-9s], close-up: focused eyes, distant sirens, and a subtle frown. Shot 4 [9-12s], medium shot: he moves carefully through a dim corridor with a flashlight. Shot 5 [12-15s], close-up: he discovers a key clue and shows a sudden expression of realization."
          },
          "parameters": {
              "resolution": "720P",
              "ratio": "16:9",
              "prompt_extend": true,
              "watermark": true,
              "duration": 15
          }
}'

4.2 Auto Voiceover

curl --location 'https://tokenhub.link/v1/video/generations' \
          -H 'X-DashScope-Async: enable' \
          -H "Authorization: Bearer $TOKENHUB_API_KEY" \
          -H 'Content-Type: application/json' \
          -d '{
          "model": "wan2.7-t2v",
          "input": {
              "prompt": "An epic yet adorable scene: a small cartoon cat general in detailed golden armor stands bravely on a cliff, riding a tiny but heroic warhorse and reciting a dramatic battle poem. Below, a massive army of mice charges forward with improvised weapons. The scene blends humor, cuteness, and epic war-film atmosphere under dark clouds above distant snowy mountains."
          },
          "parameters": {
              "resolution": "720P",
              "ratio": "16:9",
              "prompt_extend": true,
              "duration": 10
          }
}'

4.3 Custom Audio Input

curl --location 'https://tokenhub.link/v1/video/generations' \
          -H 'X-DashScope-Async: enable' \
          -H "Authorization: Bearer $TOKENHUB_API_KEY" \
          -H 'Content-Type: application/json' \
          -d '{
          "model": "wan2.7-t2v",
          "input": {
              "prompt": "An epic yet adorable scene: a small cartoon cat general in detailed golden armor stands bravely on a cliff, riding a tiny but heroic warhorse and reciting a dramatic battle poem. Below, a massive army of mice charges forward with improvised weapons. The scene blends humor, cuteness, and epic war-film atmosphere under dark clouds above distant snowy mountains.",
              "audio_url": "https://example.com/audio/cinematic-narration.mp3"
          },
          "parameters": {
              "resolution": "720P",
              "ratio": "16:9",
              "prompt_extend": true,
              "duration": 10
          }
}'

4.4 Using Negative Prompt

curl --location 'https://tokenhub.link/v1/video/generations' \
          -H 'X-DashScope-Async: enable' \
          -H "Authorization: Bearer $TOKENHUB_API_KEY" \
          -H 'Content-Type: application/json' \
          -d '{
          "model": "wan2.7-t2v",
          "input": {
              "prompt": "A small cat runs under moonlight.",
              "negative_prompt": "flowers"
          },
          "parameters": {
              "resolution": "720P",
              "ratio": "16:9"
          }
}'

5. Reference Links