Top.Mail.Ru
General icon
General
Галерея icon
Галерея
Unitool Labs icon
Unitool Labs
Блог icon
Блог
MCP icon
MCP
← All models

HappyHorse

happyhorse · Video · unitool

Generations are async: create, wait or poll, the result by link for 7 days. Details: Media generations

HappyHorse 1.1

Mode happyhorse-1-1 · happyhorse:happyhorse-1-1

Price

Depends on the parameters: 88 tokens for the example below, base 23. Get the exact price of your request from POST /v1/quotes.

Price make-up (pricing from GET /v1/models/{id})
JSON
{
  "unit": "tokens",
  "kind": "by_parameters",
  "base": 23,
  "example_price": 88,
  "matrix": [
    {
      "when": {
        "resolution": "1080p"
      },
      "rate": 23.3,
      "per": "duration"
    },
    {
      "when": {
        "resolution": "720p"
      },
      "rate": 17.5,
      "per": "duration"
    }
  ]
}

Parameters

ParameterTypeDescription
promptrequiredstring
resolution720p | 1080pРазрешениеDefault "720p"
aspect_ratio16:9 | 9:16 | 1:1 | 4:3 | 3:4 | 4:5 | 5:4 | 9:21 | 21:9Соотношение сторонDefault "16:9"
durationnumber 3–15ДлительностьDefault 5
reference_imagearray of fileРеференс-изображения. До 9 изображений (reference-to-video). В промпте ссылайтесь как [Image 1], [Image 2] A file_ref (asset:… or attachment:…), an https URL or a data: URL.
image_urlsarray of file (≤ 1)A file_ref (asset:… or attachment:…), an https URL or a data: URL.

Example request

curl
curl https://api.unitool.ai/v1/generations \
  -H "Authorization: Bearer $UNITOOL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Prefer: wait=60" \
  -d '{
  "model": "happyhorse",
  "mode": "happyhorse-1-1",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "duration": 5
  }
}'
Python (requests)
import json, os, time, uuid, requests

API = "https://api.unitool.ai/v1"
headers = {"Authorization": f"Bearer {os.environ['UNITOOL_API_KEY']}"}
body = json.loads(r'''{
  "model": "happyhorse",
  "mode": "happyhorse-1-1",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "duration": 5
  }
}''')
gen = requests.post(f"{API}/generations", json=body,
                    headers={**headers, "Idempotency-Key": str(uuid.uuid4()), "Prefer": "wait=60"}).json()
while gen["status"] in ("queued", "running"):
    time.sleep(5)
    gen = requests.get(f"{API}/generations/{gen['id']}", headers=headers).json()
print(gen["status"], [o["url"] for o in gen["outputs"]])
JavaScript (fetch)
const API = "https://api.unitool.ai/v1";
const headers = { Authorization: `Bearer ${process.env.UNITOOL_API_KEY}`, "Content-Type": "application/json" };
const body = {
  "model": "happyhorse",
  "mode": "happyhorse-1-1",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "duration": 5
  }
};
let gen = await (await fetch(`${API}/generations`, {
  method: "POST", body: JSON.stringify(body),
  headers: { ...headers, "Idempotency-Key": crypto.randomUUID(), Prefer: "wait=60" },
})).json();
while (gen.status === "queued" || gen.status === "running") {
  await new Promise((resolve) => setTimeout(resolve, 5000));
  gen = await (await fetch(`${API}/generations/${gen.id}`, { headers })).json();
}
console.log(gen.status, gen.outputs.map((output) => output.url));

Text/Image to video

Mode happyhorse · happyhorse:happyhorse

Price

Depends on the parameters: 135 tokens for the example below, base 20. Get the exact price of your request from POST /v1/quotes.

Price make-up (pricing from GET /v1/models/{id})
JSON
{
  "unit": "tokens",
  "kind": "by_parameters",
  "base": 20,
  "example_price": 135,
  "matrix": [
    {
      "when": {
        "resolution": "1080p"
      },
      "rate": 47,
      "per": "duration"
    },
    {
      "when": {
        "resolution": "720p"
      },
      "rate": 27,
      "per": "duration"
    }
  ]
}

Parameters

ParameterTypeDescription
promptrequiredstring
resolution1080p | 720pРазрешениеDefault "720p"
aspect_ratio16:9 | 9:16 | 1:1 | 4:3 | 3:4Соотношение сторонDefault "16:9"
durationnumber 3–15ДлительностьDefault 5
seednumberseed
image_urlsarray of file (≤ 1)A file_ref (asset:… or attachment:…), an https URL or a data: URL.

Example request

curl
curl https://api.unitool.ai/v1/generations \
  -H "Authorization: Bearer $UNITOOL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Prefer: wait=60" \
  -d '{
  "model": "happyhorse",
  "mode": "happyhorse",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "duration": 5
  }
}'
Python (requests)
import json, os, time, uuid, requests

API = "https://api.unitool.ai/v1"
headers = {"Authorization": f"Bearer {os.environ['UNITOOL_API_KEY']}"}
body = json.loads(r'''{
  "model": "happyhorse",
  "mode": "happyhorse",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "duration": 5
  }
}''')
gen = requests.post(f"{API}/generations", json=body,
                    headers={**headers, "Idempotency-Key": str(uuid.uuid4()), "Prefer": "wait=60"}).json()
while gen["status"] in ("queued", "running"):
    time.sleep(5)
    gen = requests.get(f"{API}/generations/{gen['id']}", headers=headers).json()
print(gen["status"], [o["url"] for o in gen["outputs"]])
JavaScript (fetch)
const API = "https://api.unitool.ai/v1";
const headers = { Authorization: `Bearer ${process.env.UNITOOL_API_KEY}`, "Content-Type": "application/json" };
const body = {
  "model": "happyhorse",
  "mode": "happyhorse",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "duration": 5
  }
};
let gen = await (await fetch(`${API}/generations`, {
  method: "POST", body: JSON.stringify(body),
  headers: { ...headers, "Idempotency-Key": crypto.randomUUID(), Prefer: "wait=60" },
})).json();
while (gen.status === "queued" || gen.status === "running") {
  await new Promise((resolve) => setTimeout(resolve, 5000));
  gen = await (await fetch(`${API}/generations/${gen.id}`, { headers })).json();
}
console.log(gen.status, gen.outputs.map((output) => output.url));

Reference to video

Mode happyhorse-reference-to-video · happyhorse:happyhorse-reference-to-video

Price

Depends on the parameters: 135 tokens for the example below, base 20. Get the exact price of your request from POST /v1/quotes.

Price make-up (pricing from GET /v1/models/{id})
JSON
{
  "unit": "tokens",
  "kind": "by_parameters",
  "base": 20,
  "example_price": 135,
  "matrix": [
    {
      "when": {
        "resolution": "720p"
      },
      "rate": 27,
      "per": "duration"
    },
    {
      "when": {
        "resolution": "1080p"
      },
      "rate": 47,
      "per": "duration"
    }
  ]
}

Parameters

ParameterTypeDescription
promptstring
resolution1080p | 720pРазрешениеDefault "720p"
aspect_ratio16:9 | 9:16 | 1:1 | 4:3 | 3:4Соотношение сторонDefault "16:9"
durationnumber 3–15ДлительностьDefault 5
seednumberseed
reference_imagerequiredarray of file (≤ 9)A file_ref (asset:… or attachment:…), an https URL or a data: URL.

Example request

curl
curl https://api.unitool.ai/v1/generations \
  -H "Authorization: Bearer $UNITOOL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Prefer: wait=60" \
  -d '{
  "model": "happyhorse",
  "mode": "happyhorse-reference-to-video",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "duration": 5,
    "reference_image": [
      "https://example.com/input.png"
    ]
  }
}'
Python (requests)
import json, os, time, uuid, requests

API = "https://api.unitool.ai/v1"
headers = {"Authorization": f"Bearer {os.environ['UNITOOL_API_KEY']}"}
body = json.loads(r'''{
  "model": "happyhorse",
  "mode": "happyhorse-reference-to-video",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "duration": 5,
    "reference_image": [
      "https://example.com/input.png"
    ]
  }
}''')
gen = requests.post(f"{API}/generations", json=body,
                    headers={**headers, "Idempotency-Key": str(uuid.uuid4()), "Prefer": "wait=60"}).json()
while gen["status"] in ("queued", "running"):
    time.sleep(5)
    gen = requests.get(f"{API}/generations/{gen['id']}", headers=headers).json()
print(gen["status"], [o["url"] for o in gen["outputs"]])
JavaScript (fetch)
const API = "https://api.unitool.ai/v1";
const headers = { Authorization: `Bearer ${process.env.UNITOOL_API_KEY}`, "Content-Type": "application/json" };
const body = {
  "model": "happyhorse",
  "mode": "happyhorse-reference-to-video",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "duration": 5,
    "reference_image": [
      "https://example.com/input.png"
    ]
  }
};
let gen = await (await fetch(`${API}/generations`, {
  method: "POST", body: JSON.stringify(body),
  headers: { ...headers, "Idempotency-Key": crypto.randomUUID(), Prefer: "wait=60" },
})).json();
while (gen.status === "queued" || gen.status === "running") {
  await new Promise((resolve) => setTimeout(resolve, 5000));
  gen = await (await fetch(`${API}/generations/${gen.id}`, { headers })).json();
}
console.log(gen.status, gen.outputs.map((output) => output.url));

Video edit

Mode happyhorse-video-edit · happyhorse:happyhorse-video-edit

Price

Depends on the parameters: 135 tokens for the example below, base 20. Get the exact price of your request from POST /v1/quotes.

Price make-up (pricing from GET /v1/models/{id})
JSON
{
  "unit": "tokens",
  "kind": "by_parameters",
  "base": 20,
  "example_price": 135,
  "matrix": [
    {
      "when": {
        "resolution": "720p"
      },
      "when_set": [
        "duration"
      ],
      "rate": 27,
      "per": "duration"
    },
    {
      "when": {
        "resolution": "1080p"
      },
      "rate": 47,
      "per": "duration"
    }
  ]
}

Parameters

ParameterTypeDescription
promptstring
resolution1080p | 720pРазрешениеDefault "720p"
aspect_ratio16:9 | 9:16 | 1:1 | 4:3 | 3:4Соотношение сторонDefault "16:9"
durationnumber 3–15ДлительностьDefault 5
video_urlrequiredfilevideo_url. A file_ref (asset:… or attachment:…), an https URL or a data: URL.
seednumberseed
reference_imagearray of file (≤ 5)A file_ref (asset:… or attachment:…), an https URL or a data: URL.

Example request

curl
curl https://api.unitool.ai/v1/generations \
  -H "Authorization: Bearer $UNITOOL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Prefer: wait=60" \
  -d '{
  "model": "happyhorse",
  "mode": "happyhorse-video-edit",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "duration": 5,
    "video_url": "https://example.com/input.mp4"
  }
}'
Python (requests)
import json, os, time, uuid, requests

API = "https://api.unitool.ai/v1"
headers = {"Authorization": f"Bearer {os.environ['UNITOOL_API_KEY']}"}
body = json.loads(r'''{
  "model": "happyhorse",
  "mode": "happyhorse-video-edit",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "duration": 5,
    "video_url": "https://example.com/input.mp4"
  }
}''')
gen = requests.post(f"{API}/generations", json=body,
                    headers={**headers, "Idempotency-Key": str(uuid.uuid4()), "Prefer": "wait=60"}).json()
while gen["status"] in ("queued", "running"):
    time.sleep(5)
    gen = requests.get(f"{API}/generations/{gen['id']}", headers=headers).json()
print(gen["status"], [o["url"] for o in gen["outputs"]])
JavaScript (fetch)
const API = "https://api.unitool.ai/v1";
const headers = { Authorization: `Bearer ${process.env.UNITOOL_API_KEY}`, "Content-Type": "application/json" };
const body = {
  "model": "happyhorse",
  "mode": "happyhorse-video-edit",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "duration": 5,
    "video_url": "https://example.com/input.mp4"
  }
};
let gen = await (await fetch(`${API}/generations`, {
  method: "POST", body: JSON.stringify(body),
  headers: { ...headers, "Idempotency-Key": crypto.randomUUID(), Prefer: "wait=60" },
})).json();
while (gen.status === "queued" || gen.status === "running") {
  await new Promise((resolve) => setTimeout(resolve, 5000));
  gen = await (await fetch(`${API}/generations/${gen.id}`, { headers })).json();
}
console.log(gen.status, gen.outputs.map((output) => output.url));

We use cookies

By continuing to use the site you agree to our Privacy Policy.