Create Reference-to-Video Task
curl --request POST \
--url https://www.anyfast.ai/v1/video/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "happyhorse-1.0-r2v",
"prompt": "A woman in a red qipao gracefully unfolds a folding fan",
"images": [
"https://example.com/ref1.jpg",
"https://example.com/ref2.jpg",
"https://example.com/ref3.jpg"
],
"resolution": "720P",
"ratio": "16:9",
"duration": 5,
"watermark": false,
"seed": 1073741823,
"parameters": {}
}
'import requests
url = "https://www.anyfast.ai/v1/video/generations"
payload = {
"model": "happyhorse-1.0-r2v",
"prompt": "A woman in a red qipao gracefully unfolds a folding fan",
"images": ["https://example.com/ref1.jpg", "https://example.com/ref2.jpg", "https://example.com/ref3.jpg"],
"resolution": "720P",
"ratio": "16:9",
"duration": 5,
"watermark": False,
"seed": 1073741823,
"parameters": {}
}
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: 'happyhorse-1.0-r2v',
prompt: 'A woman in a red qipao gracefully unfolds a folding fan',
images: [
'https://example.com/ref1.jpg',
'https://example.com/ref2.jpg',
'https://example.com/ref3.jpg'
],
resolution: '720P',
ratio: '16:9',
duration: 5,
watermark: false,
seed: 1073741823,
parameters: {}
})
};
fetch('https://www.anyfast.ai/v1/video/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.anyfast.ai/v1/video/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'happyhorse-1.0-r2v',
'prompt' => 'A woman in a red qipao gracefully unfolds a folding fan',
'images' => [
'https://example.com/ref1.jpg',
'https://example.com/ref2.jpg',
'https://example.com/ref3.jpg'
],
'resolution' => '720P',
'ratio' => '16:9',
'duration' => 5,
'watermark' => false,
'seed' => 1073741823,
'parameters' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.anyfast.ai/v1/video/generations"
payload := strings.NewReader("{\n \"model\": \"happyhorse-1.0-r2v\",\n \"prompt\": \"A woman in a red qipao gracefully unfolds a folding fan\",\n \"images\": [\n \"https://example.com/ref1.jpg\",\n \"https://example.com/ref2.jpg\",\n \"https://example.com/ref3.jpg\"\n ],\n \"resolution\": \"720P\",\n \"ratio\": \"16:9\",\n \"duration\": 5,\n \"watermark\": false,\n \"seed\": 1073741823,\n \"parameters\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.anyfast.ai/v1/video/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"happyhorse-1.0-r2v\",\n \"prompt\": \"A woman in a red qipao gracefully unfolds a folding fan\",\n \"images\": [\n \"https://example.com/ref1.jpg\",\n \"https://example.com/ref2.jpg\",\n \"https://example.com/ref3.jpg\"\n ],\n \"resolution\": \"720P\",\n \"ratio\": \"16:9\",\n \"duration\": 5,\n \"watermark\": false,\n \"seed\": 1073741823,\n \"parameters\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.anyfast.ai/v1/video/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"happyhorse-1.0-r2v\",\n \"prompt\": \"A woman in a red qipao gracefully unfolds a folding fan\",\n \"images\": [\n \"https://example.com/ref1.jpg\",\n \"https://example.com/ref2.jpg\",\n \"https://example.com/ref3.jpg\"\n ],\n \"resolution\": \"720P\",\n \"ratio\": \"16:9\",\n \"duration\": 5,\n \"watermark\": false,\n \"seed\": 1073741823,\n \"parameters\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "asyntask_jwgfhsG0m2aDjLmiiELRf74eoWmss6ya",
"task_id": "asyntask_jwgfhsG0m2aDjLmiiELRf74eoWmss6ya",
"object": "video",
"model": "happyhorse-1.0-r2v",
"status": "queued",
"progress": 0,
"created_at": 1777343862
}Alibaba
happyhorse-1.0-r2v
Submit a video generation task with 1–3 reference images. Returns a task_id immediately. Poll GET /v1/video/generations/{task_id} for the result.
POST
/
v1
/
video
/
generations
Create Reference-to-Video Task
curl --request POST \
--url https://www.anyfast.ai/v1/video/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "happyhorse-1.0-r2v",
"prompt": "A woman in a red qipao gracefully unfolds a folding fan",
"images": [
"https://example.com/ref1.jpg",
"https://example.com/ref2.jpg",
"https://example.com/ref3.jpg"
],
"resolution": "720P",
"ratio": "16:9",
"duration": 5,
"watermark": false,
"seed": 1073741823,
"parameters": {}
}
'import requests
url = "https://www.anyfast.ai/v1/video/generations"
payload = {
"model": "happyhorse-1.0-r2v",
"prompt": "A woman in a red qipao gracefully unfolds a folding fan",
"images": ["https://example.com/ref1.jpg", "https://example.com/ref2.jpg", "https://example.com/ref3.jpg"],
"resolution": "720P",
"ratio": "16:9",
"duration": 5,
"watermark": False,
"seed": 1073741823,
"parameters": {}
}
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: 'happyhorse-1.0-r2v',
prompt: 'A woman in a red qipao gracefully unfolds a folding fan',
images: [
'https://example.com/ref1.jpg',
'https://example.com/ref2.jpg',
'https://example.com/ref3.jpg'
],
resolution: '720P',
ratio: '16:9',
duration: 5,
watermark: false,
seed: 1073741823,
parameters: {}
})
};
fetch('https://www.anyfast.ai/v1/video/generations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.anyfast.ai/v1/video/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'happyhorse-1.0-r2v',
'prompt' => 'A woman in a red qipao gracefully unfolds a folding fan',
'images' => [
'https://example.com/ref1.jpg',
'https://example.com/ref2.jpg',
'https://example.com/ref3.jpg'
],
'resolution' => '720P',
'ratio' => '16:9',
'duration' => 5,
'watermark' => false,
'seed' => 1073741823,
'parameters' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.anyfast.ai/v1/video/generations"
payload := strings.NewReader("{\n \"model\": \"happyhorse-1.0-r2v\",\n \"prompt\": \"A woman in a red qipao gracefully unfolds a folding fan\",\n \"images\": [\n \"https://example.com/ref1.jpg\",\n \"https://example.com/ref2.jpg\",\n \"https://example.com/ref3.jpg\"\n ],\n \"resolution\": \"720P\",\n \"ratio\": \"16:9\",\n \"duration\": 5,\n \"watermark\": false,\n \"seed\": 1073741823,\n \"parameters\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.anyfast.ai/v1/video/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"happyhorse-1.0-r2v\",\n \"prompt\": \"A woman in a red qipao gracefully unfolds a folding fan\",\n \"images\": [\n \"https://example.com/ref1.jpg\",\n \"https://example.com/ref2.jpg\",\n \"https://example.com/ref3.jpg\"\n ],\n \"resolution\": \"720P\",\n \"ratio\": \"16:9\",\n \"duration\": 5,\n \"watermark\": false,\n \"seed\": 1073741823,\n \"parameters\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.anyfast.ai/v1/video/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"happyhorse-1.0-r2v\",\n \"prompt\": \"A woman in a red qipao gracefully unfolds a folding fan\",\n \"images\": [\n \"https://example.com/ref1.jpg\",\n \"https://example.com/ref2.jpg\",\n \"https://example.com/ref3.jpg\"\n ],\n \"resolution\": \"720P\",\n \"ratio\": \"16:9\",\n \"duration\": 5,\n \"watermark\": false,\n \"seed\": 1073741823,\n \"parameters\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "asyntask_jwgfhsG0m2aDjLmiiELRf74eoWmss6ya",
"task_id": "asyntask_jwgfhsG0m2aDjLmiiELRf74eoWmss6ya",
"object": "video",
"model": "happyhorse-1.0-r2v",
"status": "queued",
"progress": 0,
"created_at": 1777343862
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Model ID.
Available options:
happyhorse-1.0-r2v Example:
"happyhorse-1.0-r2v"
Text description of the desired video.
Example:
"A woman in a red qipao gracefully unfolds a folding fan"
1–3 reference image URLs.
Required array length:
1 - 3 elementsExample:
[
"https://example.com/ref1.jpg",
"https://example.com/ref2.jpg",
"https://example.com/ref3.jpg"
]
Video resolution.
Available options:
720P, 1080P Example:
"720P"
Aspect ratio.
Available options:
16:9, 9:16, 1:1, 4:3, 3:4 Example:
"16:9"
Video duration in seconds.
Required range:
3 <= x <= 15Example:
5
Whether to add the bottom-right "Happy Horse" watermark.
Example:
false
Random seed for reproducibility.
Required range:
0 <= x <= 2147483647Optional alternative location for the same parameters (DashScope-native style).
Response
Task created successfully
Was this page helpful?
⌘I