Create Wan Standard video task
curl --request POST \
--url https://gengen.farm/api/gengen/v1/contents/generations/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "wan-3.0",
"prompt": "A cinematic coastal landscape at sunrise."
}
'import requests
url = "https://gengen.farm/api/gengen/v1/contents/generations/tasks"
payload = {
"model": "wan-3.0",
"prompt": "A cinematic coastal landscape at sunrise."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: 'wan-3.0', prompt: 'A cinematic coastal landscape at sunrise.'})
};
fetch('https://gengen.farm/api/gengen/v1/contents/generations/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "wan30:12345678-1234-4234-8234-123456789abc",
"model": "wan-3.0",
"status": "pending",
"outputs": {
"videos": [],
"images": []
}
}Video API
Create Wan video task
Generate videos with Wan 3.0 and Wan 3.0 Prime.
POST
/
contents
/
generations
/
tasks
Create Wan Standard video task
curl --request POST \
--url https://gengen.farm/api/gengen/v1/contents/generations/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "wan-3.0",
"prompt": "A cinematic coastal landscape at sunrise."
}
'import requests
url = "https://gengen.farm/api/gengen/v1/contents/generations/tasks"
payload = {
"model": "wan-3.0",
"prompt": "A cinematic coastal landscape at sunrise."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({model: 'wan-3.0', prompt: 'A cinematic coastal landscape at sunrise.'})
};
fetch('https://gengen.farm/api/gengen/v1/contents/generations/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "wan30:12345678-1234-4234-8234-123456789abc",
"model": "wan-3.0",
"status": "pending",
"outputs": {
"videos": [],
"images": []
}
}Request parameters
| Field | Values and defaults |
|---|---|
model | Required: wan-3.0 or wan-3.0-prime |
prompt | Required, nonempty text, at most 12,000 characters |
mode | text_to_video, image_to_video, reference_to_video; inferred from assets when omitted |
controls.duration | Integer 2–30 seconds; default 5. With video input, total input video duration plus output duration must not exceed 30 seconds |
controls.resolution | 480p, 720p, 1080p; default 1080p |
controls.ratio | 16:9, 4:3, 1:1, 3:4, 9:16, adaptive; default adaptive |
controls.generateAudio | Boolean; default true |
controls.seed | Integer 0–2147483647; omit or use 0 for random generation |
providerOptions.wan.prompt_extend | Boolean; default false |
Image to video
Setmode: "image_to_video" and add a required first frame and optional last frame:
{
"model": "wan-3.0-prime",
"mode": "image_to_video",
"prompt": "The camera gently moves toward the product.",
"assets": {
"firstFrameImage": "https://example.com/first.jpg",
"lastFrameImage": "https://example.com/last.jpg"
},
"controls": { "duration": 5, "resolution": "720p" }
}
Reference to video
Usemode: "reference_to_video" with any combination of the reference arrays. Reference media are optional in this mode.
{
"model": "wan-3.0",
"mode": "reference_to_video",
"prompt": "Recreate the subject in a cinematic scene using the reference motion.",
"assets": {
"referenceImages": ["https://example.com/subject.jpg"],
"referenceVideos": ["https://example.com/motion.mp4"],
"referenceAudios": ["https://example.com/sound.mp3"]
},
"controls": { "duration": 8, "resolution": "720p", "generateAudio": true },
"providerOptions": { "wan": { "prompt_extend": true } }
}
| Reference | Limit |
|---|---|
assets.referenceImages | Up to 10 JPG/JPEG, PNG (no transparency), BMP or WEBP images; at most 20 MB each; each side 240–8000 pixels; long-to-short-side ratio at most 8:1 |
assets.referenceVideos | Up to 5 MP4/MOV videos, each 1–15 seconds, at most 15 seconds combined; up to 100 MB each; at least 16 fps; each side 240–4096 pixels; long-to-short-side ratio at most 8:1 |
assets.referenceAudios | Up to 5 WAV or MP3 files, 1–15 seconds each, at most 15 seconds combined; up to 15 MB each |
providerOptions.wan.referenceDocument | One HTTPS document URL: DOCX, XLSX, PPTX, PDF or Markdown; up to 100 MB and 50 pages |
providerOptions.wan.referencePage | One HTTPS public web page URL |
Response and billing
{
"id": "wan30:12345678-1234-4234-8234-123456789abc",
"model": "wan-3.0",
"status": "pending",
"outputs": { "videos": [], "images": [] },
"createdAt": "2026-10-23T08:00:00.000Z"
}
wan30prime:. Save the returned ID and retrieve the task.
If acceptance is still being reconciled, keep polling the same ID. Do not submit a new generation to check progress.
The wallet reserves the estimated cost before submission. Successful tasks are charged for provider-reported output video seconds plus the combined reference video seconds, using the model, resolution and price fixed when submitted. Images and audio references do not add video seconds. See Pricing for current customer prices. Failed and confirmed cancelled tasks release their reservation; pending tasks remain reserved. Repeat queries do not charge again.
Invalid fields or incompatible modes return HTTP 400, insufficient balance returns 402, and temporary unavailability returns 503. Retrieve and cancel require the API key scope that owns the task.
HTTP failures include error_code and an error message. When the provider gives a specific rejection reason, the message preserves that reason after redacting credentials. A successfully accepted task can still fail later; inspect failureReason when retrieving a failed task.
Reference-video requests reserve up to min(output seconds + 15, 30) seconds of fees without downloading or probing the input. Final billing uses the provider-reported input-plus-output video seconds; unused reservation is released. Media validity is checked by the generation service.
Rate-limit rejections are returned without automatic queuing or retry. Error responses retain the upstream error code, message and supplementary diagnostic details, with credentials redacted. An uncertain submission is never automatically submitted again.
For pending tasks, poll the returned ID. The successful task detail includes usage with billable seconds and the applicable price row. See usage fields.Authorizations
Body
application/json
Response
Accepted. Save the public task ID and poll it.