Skip to content
English

Wan 2.7 Text-to-Video API

POST /v1/tasks

All models are called through the Unified Async API POST /v1/tasks endpoint; only the input fields differ (see input parameters below).

Model summary

Model name wan2.7-video/text-to-video
Type Video generation (text-to-video)
Endpoint POST /v1/tasks
Pricing See HiAPI Pricing

Wan 2.7 Text-to-Video API generates video directly from text and uses resolution plus ratio for quality, framing, and cost control.

Production guidance

Production guidance
  • For production, pass callback.url at the top level of the request body so HiAPI can notify your service when the task reaches a terminal state.
  • GET /v1/tasks/:id is better for local debugging, low-volume jobs, or fallback reconciliation if a callback is missed.
  • Use callback.when=final. Both success and fail are terminal states, so your service should deduplicate by taskId.
API key and pricing
  • All HiAPI task models use the same API key. Create the key in the dashboard and keep it on your server.
  • Pricing depends on model, resolution, duration, and request volume. Use the HiAPI Pricing page as the live source of truth.
  • For image and video generation, validate prompts with lower-cost settings before moving final requests to higher specs or longer durations.

Best suited for

Text-to-video drafts

Generate landscapes, products, and atmospheric shots directly from a prompt.

prompt
Resolution cost control

resolution affects per-second pricing; start with 720P for debugging.

resolutionduration
Ratio control

Use ratio for landscape, portrait, square, 4:3, or 3:4 output.

ratio
Audio input

Some workflows can optionally pass audio_url.

audio_url

Request parameters

model string required

Fixed value wan2.7-video/text-to-video.

example wan2.7-video/text-to-video
input object required

Business parameters for the tested text-to-video structure.

prompt string required

Video prompt, up to 5000 characters.

negative_prompt string optional

Negative prompt, up to 500 characters.

default ""
audio_url string optional

Optional audio file. The online playground accepts file upload only; the backend can convert it to a URL. wav/mp3, 2-30 seconds, max 15MB.

resolution enum optional

Output resolution tier. This affects per-second pricing.

default 1080P enum: 720P1080P
ratio enum optional

Output video aspect ratio.

default 16:9 enum: 16:99:161:14:33:4
duration integer optional

Video duration in seconds, range 2-15.

default 5
prompt_extend boolean optional

Whether to optimize the prompt.

default true
watermark boolean optional

Whether to add an AI-generated watermark.

default false
seed integer optional

Random seed, range 0-2147483647.

callback object optional

Optional callback configuration. In production, pass callback.url so HiAPI can notify your service when the task reaches a terminal state.

url string required

HTTPS URL that receives terminal task notifications.

example https://your-domain.com/hiapi/callback
when enum optional

Callback trigger timing. Use final for terminal-state notifications.

default final enum: final

Example requests

Low-cost text-to-video

Use 720P and 2 seconds to validate the prompt.

Request body
{
  "model": "wan2.7-video/text-to-video",
  "input": {
    "prompt": "A calm sunrise over a quiet lake, cinematic, slow camera movement",
    "resolution": "720P",
    "ratio": "16:9",
    "duration": 2,
    "prompt_extend": false,
    "watermark": false
  }
}
Portrait video

For short-form portrait placements.

Request body
{
  "model": "wan2.7-video/text-to-video",
  "input": {
    "prompt": "A premium coffee product shot with slow camera movement",
    "resolution": "720P",
    "ratio": "9:16",
    "duration": 5,
    "prompt_extend": true,
    "watermark": false
  }
}

Getting the result

  1. The response returns a taskId immediately without waiting for generation to finish.
  2. In production, prefer waiting for callback.url to receive the terminal notification. For local debugging, poll GET /v1/tasks/:id.
  3. When status=success, download the generated video from output[].url.
  4. When status=fail, fix the request based on the returned error instead of retrying the same invalid payload.

Next steps