HappyHorse 1.1 Video Generation
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"action": "<string>",
"prompt": "<string>",
"image_urls": [
"<string>"
],
"reference_images": [
"<string>"
],
"url": "<string>",
"audio_setting": "<string>",
"duration": 123,
"resolution": "<string>",
"aspect_ratio": "<string>",
"seed": 123,
"watermark": true
}
'import requests
url = "https://toapis.com/v1/videos/generations"
payload = {
"model": "<string>",
"action": "<string>",
"prompt": "<string>",
"image_urls": ["<string>"],
"reference_images": ["<string>"],
"url": "<string>",
"audio_setting": "<string>",
"duration": 123,
"resolution": "<string>",
"aspect_ratio": "<string>",
"seed": 123,
"watermark": True
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
action: '<string>',
prompt: '<string>',
image_urls: ['<string>'],
reference_images: ['<string>'],
url: '<string>',
audio_setting: '<string>',
duration: 123,
resolution: '<string>',
aspect_ratio: '<string>',
seed: 123,
watermark: true
})
};
fetch('https://toapis.com/v1/videos/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://toapis.com/v1/videos/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' => '<string>',
'action' => '<string>',
'prompt' => '<string>',
'image_urls' => [
'<string>'
],
'reference_images' => [
'<string>'
],
'url' => '<string>',
'audio_setting' => '<string>',
'duration' => 123,
'resolution' => '<string>',
'aspect_ratio' => '<string>',
'seed' => 123,
'watermark' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://toapis.com/v1/videos/generations"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"action\": \"<string>\",\n \"prompt\": \"<string>\",\n \"image_urls\": [\n \"<string>\"\n ],\n \"reference_images\": [\n \"<string>\"\n ],\n \"url\": \"<string>\",\n \"audio_setting\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"seed\": 123,\n \"watermark\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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://toapis.com/v1/videos/generations")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"action\": \"<string>\",\n \"prompt\": \"<string>\",\n \"image_urls\": [\n \"<string>\"\n ],\n \"reference_images\": [\n \"<string>\"\n ],\n \"url\": \"<string>\",\n \"audio_setting\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"seed\": 123,\n \"watermark\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://toapis.com/v1/videos/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"action\": \"<string>\",\n \"prompt\": \"<string>\",\n \"image_urls\": [\n \"<string>\"\n ],\n \"reference_images\": [\n \"<string>\"\n ],\n \"url\": \"<string>\",\n \"audio_setting\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"seed\": 123,\n \"watermark\": true\n}"
response = http.request(request)
puts response.read_bodyHappyHorse
HappyHorse 1.1 Video Generation
Generate, reference, or edit videos with HappyHorse 1.1
POST
/
v1
/
videos
/
generations
HappyHorse 1.1 Video Generation
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"action": "<string>",
"prompt": "<string>",
"image_urls": [
"<string>"
],
"reference_images": [
"<string>"
],
"url": "<string>",
"audio_setting": "<string>",
"duration": 123,
"resolution": "<string>",
"aspect_ratio": "<string>",
"seed": 123,
"watermark": true
}
'import requests
url = "https://toapis.com/v1/videos/generations"
payload = {
"model": "<string>",
"action": "<string>",
"prompt": "<string>",
"image_urls": ["<string>"],
"reference_images": ["<string>"],
"url": "<string>",
"audio_setting": "<string>",
"duration": 123,
"resolution": "<string>",
"aspect_ratio": "<string>",
"seed": 123,
"watermark": True
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
action: '<string>',
prompt: '<string>',
image_urls: ['<string>'],
reference_images: ['<string>'],
url: '<string>',
audio_setting: '<string>',
duration: 123,
resolution: '<string>',
aspect_ratio: '<string>',
seed: 123,
watermark: true
})
};
fetch('https://toapis.com/v1/videos/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://toapis.com/v1/videos/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' => '<string>',
'action' => '<string>',
'prompt' => '<string>',
'image_urls' => [
'<string>'
],
'reference_images' => [
'<string>'
],
'url' => '<string>',
'audio_setting' => '<string>',
'duration' => 123,
'resolution' => '<string>',
'aspect_ratio' => '<string>',
'seed' => 123,
'watermark' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://toapis.com/v1/videos/generations"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"action\": \"<string>\",\n \"prompt\": \"<string>\",\n \"image_urls\": [\n \"<string>\"\n ],\n \"reference_images\": [\n \"<string>\"\n ],\n \"url\": \"<string>\",\n \"audio_setting\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"seed\": 123,\n \"watermark\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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://toapis.com/v1/videos/generations")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"action\": \"<string>\",\n \"prompt\": \"<string>\",\n \"image_urls\": [\n \"<string>\"\n ],\n \"reference_images\": [\n \"<string>\"\n ],\n \"url\": \"<string>\",\n \"audio_setting\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"seed\": 123,\n \"watermark\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://toapis.com/v1/videos/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"<string>\",\n \"action\": \"<string>\",\n \"prompt\": \"<string>\",\n \"image_urls\": [\n \"<string>\"\n ],\n \"reference_images\": [\n \"<string>\"\n ],\n \"url\": \"<string>\",\n \"audio_setting\": \"<string>\",\n \"duration\": 123,\n \"resolution\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"seed\": 123,\n \"watermark\": true\n}"
response = http.request(request)
puts response.read_bodyNote for users in mainland China: Please use
https://toapis.cn as the API endpoint (Base URL). Replace https://toapis.com with https://toapis.cn in the examples in this document.- Public model name:
happyhorse-1.1 - Use
actionto choose text-to-video, first-frame image-to-video, reference-to-video, or video editing - If
actionis omitted, requests with a first-frame image are treated as image-to-video; otherwise they are text-to-video - Async task management through the standard video task status endpoint
Authorizations
string
required
All requests require Bearer Token authentication.
Authorization: Bearer YOUR_API_KEY
Body
string
default:"happyhorse-1.1"
required
Video generation model name. Fixed value:
happyhorse-1.1.string
default:"text-to-video"
Generation mode.Options:
text-to-videoimage-to-videoreference-to-videovideo-edit
string
Text prompt for the video.Required for text-to-video, reference-to-video, and video editing. Optional for image-to-video, but recommended for motion and style control.
string[]
First-frame image URL for image-to-video. Only the first image is used.Compatible fields are also accepted:
input_reference, images, image, or image_with_roles[{ role: "first_frame" }].Image requirements:- Format:
JPEG,JPG,PNG,BMP,WEBP - File size: up to
10MB - Dimensions: at least
300px - Aspect ratio:
1:2.5to2.5:1
string[]
Reference image URLs.Required for
reference-to-video, with 1 to 9 images. Optional for video-edit, with up to 5 images.string
Input video URL for video editing. Required when
action=video-edit.string
default:"auto"
Audio control for video editing. Only applies when
action=video-edit.Options:autoorigin
integer
default:5
Video duration in seconds. Valid range:
3 to 15.string
default:"1080P"
Video resolution.Options:
720P1080P
string
default:"16:9"
Aspect ratio for text-to-video. Image-to-video uses the first-frame image dimensions.Options:
16:99:161:14:33:4
size field is also accepted.integer
Random seed for reproducible generation.
boolean
default:true
Whether to add a watermark.
Text-to-Video Example
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header "Authorization: Bearer YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "happyhorse-1.1",
"action": "text-to-video",
"prompt": "At night under an urban railway bridge, a graffiti teenager comes alive from a concrete wall and performs a high-energy English rap.",
"duration": 10,
"resolution": "1080P",
"aspect_ratio": "16:9",
"seed": 42,
"watermark": true
}'
Image-to-Video Example
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header "Authorization: Bearer YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "happyhorse-1.1",
"action": "image-to-video",
"prompt": "Animate the character naturally while preserving the original visual style.",
"image_urls": ["https://example.com/first-frame.png"],
"duration": 5,
"resolution": "1080P"
}'
Reference-to-Video Example
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header "Authorization: Bearer YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "happyhorse-1.1",
"action": "reference-to-video",
"prompt": "The character from image 1 runs through the scene in image 2, then picks up the prop from image 3. Keep a 3D cartoon style.",
"reference_images": [
"https://example.com/image-01.jpg",
"https://example.com/image-02.png",
"https://example.com/image-03.jpeg"
],
"duration": 5,
"resolution": "1080P",
"aspect_ratio": "16:9",
"watermark": false
}'
Video Edit Example
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header "Authorization: Bearer YOUR_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "happyhorse-1.1",
"action": "video-edit",
"prompt": "Make the video more cinematic while preserving the subject motion.",
"url": "https://example.com/input.mp4",
"reference_images": ["https://example.com/reference.png"],
"resolution": "1080P",
"audio_setting": "origin",
"seed": 42
}'
Query Task
The submit endpoint returns a task ID. Use the standard video task status endpoint to retrieve the result:curl --request GET \
--url https://toapis.com/v1/videos/generations/{task_id} \
--header "Authorization: Bearer YOUR_API_KEY"