PiAPI
HomeWorkspace
HomeWorkspace
Join Discord
  1. WanX
  • Get Started
    • Overview
    • Quickstart
    • Make Instruction: How to Use PiAPI to Build a Workflow on Make?
  • Endpoints
    • Song(Udio)
      • Song API Task Creation Examples
      • [Udio] Song Extend
      • Get Task
      • Create Task
      • [Udio] Generate Lyrics
    • Kling
      • Lipsync With PiAPI Kling API Examples
      • Motion Brush With PiAPI Kling API Example
      • Kling Elements Video Generation API
      • Kling Effects Video Generation
      • Cancel Task
        • Cancel Tasks
        • Cancel Task
      • Get Task
      • Create Task
      • Kling Virtual Try-On
    • Hailuo
      • Hailuo Director Mode Example
      • Generate Video
      • Get Task
    • Flux
      • Flux with LoRA and Controlnet
      • Available LoRA and Controlnet
      • Flux API with Redux Variation, Fill, Inpaint and Outpaint
      • Create Task
        • Text to Image
        • Image to Image
      • Get task
    • AI Hug
      • Get Task
      • Create Task
    • LLM
      • Use Cases for GPT-4o Image API
      • How To Avoid Timeouts in Completion API
      • GPT-4o Image Generation API
      • LLM API | Basic Completions
      • Get Task
    • Midjourney
      • PiAPI Penalties on Midjourney Usage
      • Detailed Explaination on Midjourney Task Result
      • Midjourney V7 API Instructions
      • Create Task
        • Imagine
        • Upscale
        • Variation
        • Reroll
        • Describe
        • Seed
        • Blend
        • Inpaint
        • Outpaint
        • Pan
      • Cancel Task
        • Cancel Task
        • Cancel Tasks
      • Get Task
    • Faceswap
      • Multi Faceswap
      • Image Faceswap
      • Video Faceswap
      • Get Task
    • TTS
      • Zeroshot Text-to-Speech F5-TTS
      • Get Task
    • Trellis
      • Create Task
      • Get Task
    • Luma Dream Machine
      • Cancel Task
        • Cancel Tasks
        • Cancel Task
      • Create Task
      • Get Task
    • WanX
      • Generate WanX Task with LoRA Using PiAPI
      • Available LoRA Types for Wanx
      • Use Cases for Wanx LoRA
      • Use Cases for Wanx Control Camera
      • Create Task
        POST
      • Get Task
        GET
    • Skyreels
      • Create Task
      • Get Task
    • Framepack
      • Create Task
      • Get Task
    • Hunyuan Video
      • How to Make a Hunyuan API Call
      • Get Task
      • Generate Video
    • Mmaudio
      • Get Task
      • Generate Audio
    • DiffRhythm
      • Generate Audio
      • Get Task
    • Tools
      • File Upload API
      • Video Upscale
      • Video Upscale-Get Task
      • Remove Background API
      • Remove Background-Get Task
      • Segment With Prompt API
      • Segment With Prompt API-Get Task
      • Image Upscale(Super Resolution) API
      • Image Upscale-Get Task
    • PiAPI Account Management
      • PiAPI Account Info
      • Task List Info
      • User Task History
  • Resources
    • Change Log
    • Output Storage
    • Unified API Schema
    • Webhook
    • Bulk Generation Service
    • Billings
    • PiAPI MCP Server
    • Workspace Manual
      • Host-your-account (HYA) | Back-up Account
      • Host-your-account (HYA) | Debug Checklist
      • Host-your-account (HYA) | Connected Account Status
    • Announcements
      • PiAPI 2025 January 1st Pricing Update
  • Legacy Documentation
    • Midjourney
      • Midjourney Webhook
      • Imagine
      • Reroll
      • Upscale
      • Variation
      • Inpaint
      • Outpaint
      • Pan
      • Describe
      • Blend
      • Seed
      • Fetch
      • Multi Fetch
      • Cancel
    • Face Swap
      • Video Faceswap
      • Multi-face-swap
      • Fetch
    • Dream Machine
      • Video Generation
      • Video Extend
      • Get Video Generation
    • Kling
      • Video Generation
      • Video Extend
      • Get Video Generation
  1. WanX

Create Task

POST
https://api.piapi.ai/api/v1/task

Overview#

The Qubico WanX API offers three advanced video generation models that can create high-quality videos from text prompts or images. All generated videos are 480p resolution with 85 frames. WanX model is less censored than other alternatives and can do NSFW content.

Models and Pricing#

Model: Qubico/Wanx
Task TypeDescriptionPrice
txt2video-1.3bLightweight text-to-video generation model$0.12 per generation
txt2video-14bAdvanced text-to-video generation model$0.28 per generation
txt2video-14b-loraGenerate video based on specific LoRA type and a text description$0.28 per generation
img2video-14bImage-to-video transformation model$0.28 per generation
img2video-14b-loraGenerate video based on specific LoRA type and image$0.28 per generation
img2video-14b-keyframeGenerate video from first and last frames$0.28 per generation
img2video-14b-control-cameraGenerate video with fun control camera$0.28 per generation

Special Considerations#

1.
Prompt Quality: The quality of the prompt directly affects the quality of the generated video. Detailed, specific descriptions are recommended.
2.
Video Specifications: All generated videos are 85 frames, 30 steps, 480p resolution.
3.
Processing Time: Video generation requires processing time. Webhook configuration is recommended for receiving task completion notifications.
4.
Image Format: For the img2video-14b model, supported image formats include URL links or base64 encoded image data.
5.
Aspect Ratio: Two aspect ratios are supported: 16:9 and 9:16, with 16:9 as the default.
6.
Motion Type: For the img2video-14b-control-camera model, determines how the camera moves in the generated video. Only one camera motion type is supported in each generation currently, with static as the default.
7.
Motion Speed: For the img2video-14b-control-camera model, determines how fast the camera moves, with 0.2 as the default.

Request

Header Params
x-api-key
string 
optional
your api key
Body Params application/json
optional
One of
model
enum<string> 
required
Model name
Allowed value:
Qubico/wanx
task_type
enum<string> 
required
Task type
Allowed value:
txt2video-1.3b
input
object 
required
config
object (TaskConfig) 
optional
Examples
{
  "model": "Qubico/wanx",
  "task_type": "txt2video-14b-lora",
  "input": {
    "prompt": "A girl with a playful smile leans forward on the ferry railing, holding onto her sunhat as the wind threatens to carry it away. She looks directly at the camera with bright, excited eyes, her laughter almost visible in her expression. The sun reflects off the sparkling water, and behind her, the coastline of a charming island town approaches. The camera slowly zooms out, capturing the anticipation of arrival.",
    "negative_prompt": "Overexposure, static, blurred details, subtitles, still, overall gray, worst quality, low quality, JPEG compression residue, ugly, mutilated, redundant fingers, poorly painted hands, poorly painted faces, deformed, disfigured, deformed limbs, fused fingers, three legs",
    "lora_settings": [
      {
        "lora_type": "ghibli"
      }
    ]
  }
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
cURL
curl --location --request POST 'https://api.piapi.ai/api/v1/task' \
--header 'x-api-key;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "Qubico/wanx",
    "task_type": "txt2video-14b-lora",
    "input": {
        "prompt": "A girl with a playful smile leans forward on the ferry railing, holding onto her sunhat as the wind threatens to carry it away. She looks directly at the camera with bright, excited eyes, her laughter almost visible in her expression. The sun reflects off the sparkling water, and behind her, the coastline of a charming island town approaches. The camera slowly zooms out, capturing the anticipation of arrival.",
        "negative_prompt": "Overexposure, static, blurred details, subtitles, still, overall gray, worst quality, low quality, JPEG compression residue, ugly, mutilated, redundant fingers, poorly painted hands, poorly painted faces, deformed, disfigured, deformed limbs, fused fingers, three legs",
        "lora_settings": [
            {
                "lora_type": "ghibli"
            }
        ]
    }
}'

Responses

🟢200OK
application/json
Task created successfully
Body
task_id
string 
optional
Unique identifier for the task
status
enum<string> 
optional
Current status of the task
Allowed values:
pendingprocessingcompletedfailed
created_at
string <date-time>
optional
Timestamp when the task was created
Example
{
  "task_id": "string",
  "status": "pending",
  "created_at": "2019-08-24T14:15:22Z"
}
🟠400Bad Request
🟠401Unauthorized
🔴500Server Error
Previous
Use Cases for Wanx Control Camera
Next
Get Task