Generate video using HappyHorse 1.0 reference-to-video
curl --request POST \
--url https://api.crun.ai/api/v1/client/job/CreateTask \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"model": "happyhorse-1-0-r2v",
"callback_url": "https://your-domain.com/api/callback",
"input": {
"prompt": "Create a fantasy riding scene using these references for character and style.",
"img_urls": [
"https://example.com/reference-1.jpg",
"https://example.com/reference-2.jpg"
],
"resolution": "720P",
"duration": 5,
"aspect_ratio": "16:9",
"region": "global",
"input_compliance": "enable",
"output_compliance": "enable"
}
}
'import requests
url = "https://api.crun.ai/api/v1/client/job/CreateTask"
payload = {
"model": "happyhorse-1-0-r2v",
"callback_url": "https://your-domain.com/api/callback",
"input": {
"prompt": "Create a fantasy riding scene using these references for character and style.",
"img_urls": ["https://example.com/reference-1.jpg", "https://example.com/reference-2.jpg"],
"resolution": "720P",
"duration": 5,
"aspect_ratio": "16:9",
"region": "global",
"input_compliance": "enable",
"output_compliance": "enable"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'happyhorse-1-0-r2v',
callback_url: 'https://your-domain.com/api/callback',
input: {
prompt: 'Create a fantasy riding scene using these references for character and style.',
img_urls: ['https://example.com/reference-1.jpg', 'https://example.com/reference-2.jpg'],
resolution: '720P',
duration: 5,
aspect_ratio: '16:9',
region: 'global',
input_compliance: 'enable',
output_compliance: 'enable'
}
})
};
fetch('https://api.crun.ai/api/v1/client/job/CreateTask', 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://api.crun.ai/api/v1/client/job/CreateTask",
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',
'callback_url' => 'https://your-domain.com/api/callback',
'input' => [
'prompt' => 'Create a fantasy riding scene using these references for character and style.',
'img_urls' => [
'https://example.com/reference-1.jpg',
'https://example.com/reference-2.jpg'
],
'resolution' => '720P',
'duration' => 5,
'aspect_ratio' => '16:9',
'region' => 'global',
'input_compliance' => 'enable',
'output_compliance' => 'enable'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://api.crun.ai/api/v1/client/job/CreateTask"
payload := strings.NewReader("{\n \"model\": \"happyhorse-1-0-r2v\",\n \"callback_url\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"prompt\": \"Create a fantasy riding scene using these references for character and style.\",\n \"img_urls\": [\n \"https://example.com/reference-1.jpg\",\n \"https://example.com/reference-2.jpg\"\n ],\n \"resolution\": \"720P\",\n \"duration\": 5,\n \"aspect_ratio\": \"16:9\",\n \"region\": \"global\",\n \"input_compliance\": \"enable\",\n \"output_compliance\": \"enable\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://api.crun.ai/api/v1/client/job/CreateTask")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"happyhorse-1-0-r2v\",\n \"callback_url\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"prompt\": \"Create a fantasy riding scene using these references for character and style.\",\n \"img_urls\": [\n \"https://example.com/reference-1.jpg\",\n \"https://example.com/reference-2.jpg\"\n ],\n \"resolution\": \"720P\",\n \"duration\": 5,\n \"aspect_ratio\": \"16:9\",\n \"region\": \"global\",\n \"input_compliance\": \"enable\",\n \"output_compliance\": \"enable\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.crun.ai/api/v1/client/job/CreateTask")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"happyhorse-1-0-r2v\",\n \"callback_url\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"prompt\": \"Create a fantasy riding scene using these references for character and style.\",\n \"img_urls\": [\n \"https://example.com/reference-1.jpg\",\n \"https://example.com/reference-2.jpg\"\n ],\n \"resolution\": \"720P\",\n \"duration\": 5,\n \"aspect_ratio\": \"16:9\",\n \"region\": \"global\",\n \"input_compliance\": \"enable\",\n \"output_compliance\": \"enable\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"message": "success",
"data": {
"task_id": "task_12345678"
}
}HappyHorse 1.0
HappyHorse 1.0 Reference to Video
The HappyHorse referenceto video generation model supports inputting multiple reference images. It generates a smooth video by fusing main subjects from the images with scene descriptions via text prompts.
POST
/
api
/
v1
/
client
/
job
/
CreateTask
Generate video using HappyHorse 1.0 reference-to-video
curl --request POST \
--url https://api.crun.ai/api/v1/client/job/CreateTask \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"model": "happyhorse-1-0-r2v",
"callback_url": "https://your-domain.com/api/callback",
"input": {
"prompt": "Create a fantasy riding scene using these references for character and style.",
"img_urls": [
"https://example.com/reference-1.jpg",
"https://example.com/reference-2.jpg"
],
"resolution": "720P",
"duration": 5,
"aspect_ratio": "16:9",
"region": "global",
"input_compliance": "enable",
"output_compliance": "enable"
}
}
'import requests
url = "https://api.crun.ai/api/v1/client/job/CreateTask"
payload = {
"model": "happyhorse-1-0-r2v",
"callback_url": "https://your-domain.com/api/callback",
"input": {
"prompt": "Create a fantasy riding scene using these references for character and style.",
"img_urls": ["https://example.com/reference-1.jpg", "https://example.com/reference-2.jpg"],
"resolution": "720P",
"duration": 5,
"aspect_ratio": "16:9",
"region": "global",
"input_compliance": "enable",
"output_compliance": "enable"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'happyhorse-1-0-r2v',
callback_url: 'https://your-domain.com/api/callback',
input: {
prompt: 'Create a fantasy riding scene using these references for character and style.',
img_urls: ['https://example.com/reference-1.jpg', 'https://example.com/reference-2.jpg'],
resolution: '720P',
duration: 5,
aspect_ratio: '16:9',
region: 'global',
input_compliance: 'enable',
output_compliance: 'enable'
}
})
};
fetch('https://api.crun.ai/api/v1/client/job/CreateTask', 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://api.crun.ai/api/v1/client/job/CreateTask",
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',
'callback_url' => 'https://your-domain.com/api/callback',
'input' => [
'prompt' => 'Create a fantasy riding scene using these references for character and style.',
'img_urls' => [
'https://example.com/reference-1.jpg',
'https://example.com/reference-2.jpg'
],
'resolution' => '720P',
'duration' => 5,
'aspect_ratio' => '16:9',
'region' => 'global',
'input_compliance' => 'enable',
'output_compliance' => 'enable'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://api.crun.ai/api/v1/client/job/CreateTask"
payload := strings.NewReader("{\n \"model\": \"happyhorse-1-0-r2v\",\n \"callback_url\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"prompt\": \"Create a fantasy riding scene using these references for character and style.\",\n \"img_urls\": [\n \"https://example.com/reference-1.jpg\",\n \"https://example.com/reference-2.jpg\"\n ],\n \"resolution\": \"720P\",\n \"duration\": 5,\n \"aspect_ratio\": \"16:9\",\n \"region\": \"global\",\n \"input_compliance\": \"enable\",\n \"output_compliance\": \"enable\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://api.crun.ai/api/v1/client/job/CreateTask")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"happyhorse-1-0-r2v\",\n \"callback_url\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"prompt\": \"Create a fantasy riding scene using these references for character and style.\",\n \"img_urls\": [\n \"https://example.com/reference-1.jpg\",\n \"https://example.com/reference-2.jpg\"\n ],\n \"resolution\": \"720P\",\n \"duration\": 5,\n \"aspect_ratio\": \"16:9\",\n \"region\": \"global\",\n \"input_compliance\": \"enable\",\n \"output_compliance\": \"enable\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.crun.ai/api/v1/client/job/CreateTask")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"happyhorse-1-0-r2v\",\n \"callback_url\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"prompt\": \"Create a fantasy riding scene using these references for character and style.\",\n \"img_urls\": [\n \"https://example.com/reference-1.jpg\",\n \"https://example.com/reference-2.jpg\"\n ],\n \"resolution\": \"720P\",\n \"duration\": 5,\n \"aspect_ratio\": \"16:9\",\n \"region\": \"global\",\n \"input_compliance\": \"enable\",\n \"output_compliance\": \"enable\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"message": "success",
"data": {
"task_id": "task_12345678"
}
}Query Task Status
After submitting a task, use the unified query endpoint to check progress and retrieve results:Get Task Info
Learn how to query task status and retrieve generation results
For production use, we recommend using the
callback_url parameter to receive automatic notifications when generation completes, rather than polling the status endpoint.Related Resources
Models Overview
Explore all available models
Common API
Check credits and account usage
Authorizations
All APIs require authentication via API Key.
Get API Key:
- Visit API Key Management Page to get your API Key
Usage: Add to request header:
x-api-key: YOUR_API_KEY
Body
application/json
The model name to use for generation. Required field.
- Must be
happyhorse-1-0-r2vfor this endpoint
Available options:
happyhorse-1-0-r2v Input parameters for the HappyHorse 1.0 reference-to-video generation task.
Show child attributes
Show child attributes
Optional. Callback URL for receiving task completion notifications.
Example:
"https://your-domain.com/api/callback"
Was this page helpful?
⌘I
