Skip to main content

Documentation Index

Fetch the complete documentation index at: https://apixo.ai/docs/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Wan 2.7 is an Alibaba video model for text-to-video, image-to-video, reference-guided generation, and video editing. Use this page when you are ready to call the API after trying the model in the APIXO playground.
CapabilityValue
Model IDwan-2-7-video
Modestext-to-video, image-to-video, reference-to-video, video-edit
PromptRequired for text-to-video and reference-to-video; optional for image-to-video and video-edit
Resolutions720p, 1080p
Aspect ratios16:9, 9:16, 1:1, 4:3, 3:4
Mode-specific ratio rulesDefault 16:9 for text-to-video and reference-to-video; not supported for image-to-video; optional for video-edit
Durationtext-to-video/image-to-video: 2-15 (default 5); reference-to-video: 2-15 or 2-10 when any reference video is used (default 5); video-edit: 0 or 2-10 (default 0)
Public media fieldsimage_urls, video_urls, audio_urls

Public input contract

  • Public media input fields are image_urls, video_urls, and audio_urls.
  • Use audio_urls (not audio_url) for audio input.

Endpoint and authentication

Base URL:
https://api.apixo.ai/api/v1
MethodEndpointPurpose
POST/generateTask/wan-2-7-videoSubmit a generation or edit task
GET/statusTask/wan-2-7-video?taskId={taskId}Poll task status and retrieve results
All requests require your APIXO API key:
Authorization: Bearer YOUR_API_KEY
Submit requests also require:
Content-Type: application/json

Copy-paste async quickstart

This minimal request submits a text-to-video task and returns a taskId.
curl -X POST "https://api.apixo.ai/api/v1/generateTask/wan-2-7-video" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "input": {
      "mode": "text-to-video",
      "prompt": "a cinematic rainy night in tokyo",
      "resolution": "1080p",
      "ratio": "16:9",
      "duration": 5
    }
  }'
Successful response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678"
  }
}
Save the taskId; you need it to poll for the final result.

Poll for result

curl -X GET "https://api.apixo.ai/api/v1/statusTask/wan-2-7-video?taskId=task_12345678" \
  -H "Authorization: Bearer YOUR_API_KEY"
Processing response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "processing",
    "createTime": 1767965610929
  }
}
Success response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://r2.apixo.ai/video.mp4\"]}",
    "createTime": 1767965610929,
    "completeTime": 1767965652317,
    "costTime": 41388
  }
}
Failed response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "failed",
    "failCode": "PromptInvalid",
    "failMsg": "Prompt is invalid or rejected by provider",
    "createTime": 1767965610929,
    "completeTime": 1767965620132
  }
}
Parse resultJson after state becomes success:
const payload = JSON.parse(data.resultJson);
const videoUrls = payload.resultUrls;

Request body

Text-to-video

{
  "request_type": "async",
  "input": {
    "mode": "text-to-video",
    "prompt": "a cinematic rainy night in tokyo",
    "audio_urls": [
      "https://example.com/background.mp3"
    ],
    "negative_prompt": "blurry, low quality",
    "resolution": "1080p",
    "ratio": "16:9",
    "duration": 8,
    "prompt_extend": true,
    "watermark": false,
    "seed": 12345
  }
}

Image-to-video (first and optional last frame)

{
  "request_type": "async",
  "input": {
    "mode": "image-to-video",
    "image_urls": [
      "https://example.com/first-frame.png",
      "https://example.com/last-frame.png"
    ],
    "audio_urls": [
      "https://example.com/driving-audio.mp3"
    ],
    "prompt": "smooth camera motion with gentle wind",
    "resolution": "720p",
    "duration": 6
  }
}

Reference-to-video

{
  "request_type": "async",
  "input": {
    "mode": "reference-to-video",
    "prompt": "keep character style and outfit consistency",
    "image_urls": [
      "https://example.com/ref-1.png"
    ],
    "video_urls": [
      "https://example.com/ref-clip.mp4"
    ],
    "audio_urls": [
      "https://example.com/ref-voice-1.mp3",
      "https://example.com/ref-voice-2.mp3"
    ],
    "resolution": "1080p",
    "ratio": "16:9",
    "duration": 6
  }
}

Video-edit

{
  "request_type": "async",
  "input": {
    "mode": "video-edit",
    "video_urls": [
      "https://example.com/input.mp4"
    ],
    "image_urls": [
      "https://example.com/reference.png"
    ],
    "prompt": "change the style into clay animation",
    "negative_prompt": "blurry, low quality",
    "resolution": "720p",
    "ratio": "1:1",
    "duration": 0,
    "audio_setting": "auto",
    "prompt_extend": true,
    "watermark": false
  }
}

Parameters

request_type
string
default:"async"
required
Result delivery mode. Use async for polling with statusTask, or callback for webhook delivery.
callback_url
string
Required when request_type is callback. Must be a public HTTPS URL that can receive the final task payload. See Webhooks.
input
object
required
Wan 2.7 input parameters.

Response format

Submit task response

POST /generateTask/wan-2-7-video returns a task ID when the task is accepted:
code
integer
API status code. 200 means the task was accepted.
message
string
Human-readable status message.
data.taskId
string
Unique task identifier used with the status endpoint.

Status response fields

taskId
string
Unique task identifier.
state
string
Current task state: pending, processing, success, or failed.
resultJson
string
JSON string containing generated video URLs in resultUrls. Present when state is success.
failCode
string
Machine-readable failure code. Present when state is failed.
failMsg
string
Human-readable failure message. Present when state is failed.
createTime
integer
Task creation timestamp in Unix milliseconds.
completeTime
integer
Task completion timestamp in Unix milliseconds. Present after completion.
costTime
integer
Processing duration in milliseconds. Present after completion when upstream timing is available.

Webhook callback mode

Use callback mode when your backend should receive the final result automatically instead of polling.
curl -X POST "https://api.apixo.ai/api/v1/generateTask/wan-2-7-video" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "callback",
    "callback_url": "https://your-server.com/webhooks/apixo",
    "input": {
      "mode": "video-edit",
      "video_urls": [
        "https://example.com/input.mp4"
      ],
      "image_urls": [
        "https://example.com/reference.png"
      ],
      "prompt": "change the scene to watercolor style",
      "resolution": "1080p",
      "duration": 0,
      "audio_setting": "origin"
    }
  }'
See Webhooks for delivery requirements and retry behavior.

Billing

Wan 2.7 is billed per second. The selected resolution determines the unit price.
ResolutionAPIXO official price
720p$0.08 / second
1080p$0.12 / second
Billing formulas:
ModeFormula
text-to-videoduration * unitPrice
image-to-videoduration * unitPrice
reference-to-videoduration * unitPrice
video-editbillableSeconds * unitPrice
For video-edit, billing is based on both input and output duration:
  • Input video duration must be greater than 0 and less than 11 seconds.
  • Billable input duration is capped at 10 seconds.
  • If duration = 0, then billableSeconds = cappedInputDuration * 2.
  • If duration = 2-10, then billableSeconds = cappedInputDuration + duration.
  • Maximum billable seconds for video-edit is 20.
For current route and market comparison pricing, see Pricing.

Latency and polling

Wan 2.7 tasks are asynchronous. The backend does not provide a fixed public latency SLA; actual latency varies by mode, resolution, duration, prompt complexity, media fetch speed, and provider queue load.
WorkflowRecommended first pollPoll interval
text-to-video30s after task creation10s
image-to-video30s after task creation10s
reference-to-video30s-45s after task creation10s-15s
video-edit45s-60s after task creation10s-15s
For production workloads, use callback mode to avoid frequent polling on long-running video jobs.
Rate limits and concurrency can vary by account, API key, and route. If you receive 429, slow down requests and retry with backoff. For account-level details, see System APIs.

Errors and troubleshooting

HTTP errors

CodeMeaningWhat to do
400Invalid request body, mode, parameter, or media URL shapeFix the request before retrying
401Missing or invalid API keyCheck the Authorization header
402Insufficient balance or quotaAdd balance or switch account/key
403Key or route cannot access the modelCheck permissions and route strategy
429Rate limit or concurrency limit reachedRetry with exponential backoff
500Server errorRetry with backoff
502Upstream provider errorRetry with backoff
504Upstream timeoutRetry or use callback mode

Task failure codes

failCode is route-dependent and may come from mapped upstream failures. Common values include:
Fail codeMeaningWhat to do
PromptInvalidPrompt is invalid or rejected by providerRewrite prompt and retry
MissingParameter / BadRequestRequired fields are missing or malformedCheck mode-specific required fields
SensitiveContent / SensitiveContentDetectedPrompt or media failed safety checksChange prompt or media
RateLimitExceededProvider or route rate limit was reachedRetry with backoff
Task TimeOut / TimeoutUpstream generation timed outRetry or use callback mode
UnmappedUpstreamErrorUpstream error could not be mapped to a known typeRetry with backoff or contact support with taskId

Parameter troubleshooting

  • mode must be one of text-to-video, image-to-video, reference-to-video, video-edit.
  • prompt is required for text-to-video and reference-to-video.
  • ratio is not allowed in image-to-video.
  • image-to-video requires image_urls or video_urls.
  • If image-to-video includes video_urls, audio_urls is not allowed.
  • reference-to-video requires at least one reference item across image_urls and video_urls, with total count <= 5.
  • If reference-to-video includes audio_urls, its length must equal image_urls + video_urls.
  • video-edit requires exactly one video_urls item.
  • video-edit input clip duration must be greater than 0 and less than 11 seconds.
See Error Codes for the full error reference.