Happyhorse API Examples
The Happyhorse series models provide video generation and editing capabilities, supporting text-to-video (t2v), image-to-video (i2v), reference video generation (r2v), and video editing (video-edit).
Basic Configuration
Before starting to use the API, please ensure you have obtained an API Key. If not, please refer to Create API Key.
Basic Information
- API Base URL:
https://api.agentsflare.com/v1/videos/generations - Authentication Method: Bearer Token
- Content Type:
application/json
Request Examples
Create Task
bash
curl -X POST "https://api.agentsflare.com/v1/videos/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "happyhorse-1.0-t2v",
"prompt": "A kitten running on the grass, sunlight shining on its body",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}'python
import requests
import json
url = "https://api.agentsflare.com/v1/videos/generations"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"model": "happyhorse-1.0-t2v",
"prompt": "A kitten running on the grass, sunlight shining on its body",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}
response = requests.post(url, headers=headers, json=payload)
result = response.json()
print("Task ID:", result.get("task_id"))javascript
const axios = require('axios');
const url = 'https://api.agentsflare.com/v1/videos/generations';
const payload = {
model: 'happyhorse-1.0-t2v',
prompt: 'A kitten running on the grass, sunlight shining on its body',
duration: 5,
resolution: '720p',
aspect_ratio: '16:9'
};
axios.post(url, payload, {
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
})
.then(response => {
console.log('Task ID:', response.data.task_id);
})
.catch(error => {
console.error('Error:', error.message);
});Query Task Status
bash
curl -X GET "https://api.agentsflare.com/v1/async-result/TASK_ID" \
-H "Authorization: Bearer YOUR_API_KEY"python
import requests
url = f"https://api.agentsflare.com/v1/async-result/{task_id}"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
response = requests.get(url, headers=headers)
result = response.json()
print("Status:", result.get("status"))
if result.get("status") == "completed":
print("Video URL:", result.get("video_url"))Response Example
json
{
"task_id": "hh-xxxxxxxx",
"status": "completed",
"video_url": "https://cdn.agentsflare.com/videos/hh-xxxxxxxx.mp4",
"duration": 5,
"resolution": "720p"
}Supported Models
The following models are available through this interface (sorted by recommendation):
happyhorse-1.0-video-editNewhappyhorse-1.0-r2vNewhappyhorse-1.0-i2vNewhappyhorse-1.0-t2vNew
💡 Tip
The model field in the request example can be replaced with any model name above.