Wan Alpha Serverless API

Generate transparent-background video with a real alpha channel.

PlaygroundAPI
Pricing
~130.00s
POST /v2/wan-alpha · submit + poll
 1# pip install "segmind>=1.1.0"
 2# export SEGMIND_API_KEY="YOUR_API_KEY"
 3from segmind import SegmindClient, InferenceFailed, InferenceTimeout
 4
 5# Async (v2) — recommended for long-running / video models.
 6# run() blocks up to 600s; submit_async + job.wait(timeout=...) sets a longer
 7# deadline and keeps the request_id so you can re-poll later.
 8client = SegmindClient()                      # reads SEGMIND_API_KEY
 9payload = {
10    "prompt": "Medium shot. A red fox trots and turns its head, its thick fur and bushy tail ruffled by the wind. The background of this video is transparent. Realistic style.",
11    "negative_prompt": "",
12    "resolution": "832*480",
13    "num_frames": 81,
14    "fps": 16,
15    "output_format": "webm",
16    "output_quality": 85,
17    "seed": 92979684,
18    "remove_first_frame": False,
19    "remove_last_frame": False,
20}
21job = client.submit_async("wan-alpha", **payload)
22print(job.request_id)                         # available immediately
23try:
24    result = job.wait(timeout=900, interval=2.0)
25    print(result["status"])                  # COMPLETED
26    print(result.get("output"))              # model output (e.g. video URL)
27except InferenceTimeout as e:
28    print("still running:", e.request_id)    # re-poll later with this id
29except InferenceFailed as e:
30    print("failed:", e.detail)
31
32# Fast models (<=600s) can use the one-liner instead:
33# result = segmind.run("wan-alpha", **payload)

API Endpoint

POSThttps://api.segmind.com/v1/wan-alpha

Parameters

promptrequired
string

What the video should show. Include the words "transparent background" and a shot type (close-up / medium shot / wide shot) - the model needs both to key the subject cleanly. A style tag helps.

fpsoptional
integer

Playback frame rate, 5 to 30. Use 16 for natural motion. This sets how long the frames take to play back, not how many are generated, so it does not change the price.

Default: 16Range: 5 - 30
negative_promptoptional
string

What to keep out of the clip. Leave blank to use the model default.

Default: ""
num_framesoptional
integer

Frames to generate, 81 to 121 in steps of 4. At the default 16 fps, 81 frames is about 5 seconds and 121 about 7.5 seconds.

Default: 81Range: 81 - 121
output_formatoptional
string

WebM video or animated WebP, both carrying the alpha channel. WebM is the one most editors and browsers composite directly.

Default: "webm"
Allowed values :
WebM video"webm"
Animated WebP"webp"
output_qualityoptional
integer

Encoder quality, 1 to 100. Use 85 for balance and 95 for fine detail; higher keeps more detail in a larger file.

Default: 85Range: 1 - 100
remove_first_frameoptional
boolean

Drop the opening frame, which can carry keying artifacts. Enable if edges flicker.

Default: false
remove_last_frameoptional
boolean

Drop the closing frame, which can carry keying artifacts. Enable if edges flicker.

Default: false
resolutionoptional
string

Output size and aspect. Use 480p for drafts and 720p for final delivery. The 512 x 512 presets render at 480p and are scaled down, so they cost the same as the 480p pair.

Default: "832*480"
Allowed values :
832 x 480 - Landscape (480p)"832*480"
480 x 832 - Portrait (480p)"480*832"
1280 x 720 - Landscape (720p)"1280*720"
720 x 1280 - Portrait (720p)"720*1280"
512 x 512 - Square, landscape fit"512*512 (fit horizontal)"
512 x 512 - Square, portrait fit"512*512 (fit vertical)"
seedoptional
integer

Reuse a seed to reproduce a clip. -1 picks a random one.

Default: -1

Response Type

Returns: Video

Asynchronous requests (v2)

Use Async for video, long-running (>~60s), or high-concurrency workloads; Sync is simplest for fast image & LLM calls. Async submits a request and you poll it to completion.

  1. 1
    POST /v2/wan-alpha

    Submitreturns request_id, status_url, response_url

  2. 2
    GET /v2/requests/{id}/status

    Polluntil COMPLETED or FAILED

  3. 3
    GET /v2/requests/{id}

    Resultfinal response body

Status states

QUEUEDAccepted, waiting for a worker
PROCESSINGRunning on a worker
COMPLETEDDone — result body is ready
FAILEDErrored (incl. content/RAI blocks)
  • A FAILED request is served as HTTP 422 — the body still carries the error detail.
  • An unknown or expired request_id returns HTTP 404.
  • Results are retained for 1 hour, then expire.
  • Content / RAI blocks surface as FAILED, not a separate state.
  • Track completion by polling the status endpoint.

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out