# HappyHorse 1.0

> Alibaba's HappyHorse 1.0 on the Kinovi API — unified text-to-video, image-to-video, multi-image reference-to-video (up to 9 images), and video editing at 720p or 1080p.

Source: https://kinovi.ai/docs/models/happyhorse1.0

- Model ID: `happyhorse1.0`
- Type: Video
- Provider: Alibaba
- From: $0.0801 / s
- Model page: https://kinovi.ai/models/happyhorse
- Playground: https://kinovi.ai/app/gallery?model=happyhorse1.0

## Quickstart

Two calls: submit a task with `createTask`, then poll `recordInfo` with the returned `taskId` until `status` is `success` or `fail`.

Every request carries `Authorization: Bearer <yourApiKey>`. Create and manage keys at [kinovi.ai/api-keys](https://kinovi.ai/api-keys); see the [API reference](https://kinovi.ai/docs/api) for rate limits and error codes.

### Submit a task

`POST https://kinovi.ai/api/v1/jobs/createTask`

```json
{
  "model": "happyhorse1.0",
  "inputs": {
    "happyhorseMode": "t2v",
    "prompt": "A rider galloping across misty green highlands at sunrise, dramatic sweeping drone shot, cinematic orchestral ambiance.",
    "aspectRatio": "16:9",
    "duration": 5,
    "outputResolution": "720p"
  }
}
```

Response `200 OK` — the task is queued and credits are reserved. Use `taskId` to poll for the result.

```json
{
  "taskId": "task_01j9examplehappyh001"
}
```

#### Error responses

| HTTP | Body | When |
|:--|:--|:--|
| `400` | `{ "message": "Invalid inputs for model", "errors": [ … ] }` | Media doesn't match `happyhorseMode` (e.g. missing `imageUrls` in `i2v`/`r2v`, missing `videoUrls` in `video-edit`, `duration` outside `3`–`15`, or missing `prompt` in `t2v`/`r2v`/`video-edit`). Nothing is charged. |
| `401` | `{ "message": "Invalid API Key" }` | Missing or wrong `Authorization` header. |
| `402` | `{ "message": "Insufficient credits", "required": 87, "available": 0 }` | Not enough credits for this duration × resolution. |
| `429` | `{ "message": "Concurrency limit reached (…)", "limit": 5, "current": 5 }` | Too many tasks in progress; wait for one to finish. |

### Query the result

`GET https://kinovi.ai/api/v1/jobs/recordInfo?taskId=task_…`

Poll every few seconds until `status` is `success` or `fail`.

| `status` | Meaning |
|:--|:--|
| `waiting` | Queued, not started yet |
| `generating` | Running |
| `success` | Done — read `output[].url` |
| `fail` | Failed — see `error.code` / `error.message`; credits are refunded |

## Parameters

HappyHorse 1.0 uses one `model` id (`"happyhorse1.0"`) and switches behavior with `inputs.happyhorseMode`:

| `happyhorseMode` | Required media | Optional media | Prompt | Duration |
|:--|:--|:--|:--|:--|
| `t2v` | None | None | **required** | `3`–`15` s (default `5`) |
| `i2v` (default) | 1 first-frame image in `imageUrls` | None | optional | `3`–`15` s (default `5`) |
| `r2v` | 1–9 reference images in `imageUrls` | None | **required** (cite `[Image 1]` or `@Image1`) | `3`–`15` s (default `5`) |
| `video-edit` | 1 source video in `videoUrls` | 0–5 reference images in `imageUrls` | **required** | Follows source video (omit `duration`) |

Reference media fields take any publicly reachable URL — host the files yourself, or upload them to Kinovi first with `POST /api/v1/uploads` and pass the returned `url` (see [Uploading Assets](https://kinovi.ai/docs/uploads)).

| Field | Type | Default | Description |
|:--|:--|:--|:--|
| `model` | `string` | **required** | Must be `"happyhorse1.0"`. |
| `inputs.happyhorseMode` | `string` | `i2v` | `t2v` · `i2v` · `r2v` · `video-edit`. |
| `inputs.prompt` | `string` | – | Motion, scene, or edit instruction. Required for `t2v`, `r2v`, and `video-edit`; optional for `i2v`. |
| `inputs.imageUrls` | `string[]` | – | `i2v`: 1 first-frame image. `r2v`: 1–9 reference images. `video-edit`: 0–5 edit reference images. `t2v`: must be omitted/empty. Your own hosted URLs or [Kinovi uploads](https://kinovi.ai/docs/uploads). |
| `inputs.videoUrls` | `string[]` | – | Required in `video-edit` mode (exactly 1 source video); must be omitted in other modes. Your own hosted URLs or [Kinovi uploads](https://kinovi.ai/docs/uploads). |
| `inputs.duration` | `integer` | `5` | Clip length in whole seconds, `3` to `15`. Ignored/omitted in `video-edit` mode. |
| `inputs.outputResolution` | `string` | `720p` | `720p` · `1080p`. |
| `inputs.aspectRatio` | `string` | `16:9` | `16:9` · `9:16` · `4:3` · `3:4` · `1:1` · `21:9`. Used in `t2v` and `r2v`; `i2v` and `video-edit` follow the source media. |
| `inputs.audio_setting` | `string` | `auto` | `auto` (generate audio) · `origin` (preserve original audio in `video-edit`). |
| `inputs.seed` | `integer` | random | `0`–`2147483647`. |
| `callBackUrl` | `string` | – | Optional webhook called when the task finishes. |

### Full request (`r2v` reference-to-video)

```json
{
  "model": "happyhorse1.0",
  "inputs": {
    "happyhorseMode": "r2v",
    "prompt": "The character from @Image1 strolls down the lantern-lit alley from @Image2 as gentle rain falls.",
    "imageUrls": [
      "https://static.kinovi.ai/generated-images/task_ff01ii3zvib7ndbx8negnh6q-0.png",
      "https://static.kinovi.ai/generated-images/task_u91bn4h34rr0zy2m5o9z31si-0.png"
    ],
    "aspectRatio": "16:9",
    "duration": 5,
    "outputResolution": "1080p",
    "audio_setting": "auto",
    "seed": 42
  },
  "callBackUrl": "https://example.com/hooks/kinovi"
}
```

## Pricing

Priced **per second of video**, by `outputResolution`. Live prices: [kinovi.ai/models/happyhorse](https://kinovi.ai/models/happyhorse).

| | 720p | 1080p |
|:--|--:|--:|
| **per second** | $0.0801 / s | $0.1413 / s |

For `t2v`, `i2v`, and `r2v`, `duration` × the rate is charged at submit. For `video-edit`, credits are settled to the edited clip's duration. Failed tasks are refunded in full.

## Response

### Result fields

**JSON**

```json
{
  "taskId": "task_01j9examplehappyh001",
  "model": "happyhorse1.0",
  "status": "success",
  "creditsUsed": 86.3,
  "output": [
    {
      "url": "https://static.kinovi.ai/videos/happyhorse_example.mp4",
      "width": 1280,
      "height": 720,
      "mediaType": "video/mp4"
    }
  ],
  "error": null,
  "createTime": 1790090613532,
  "completeTime": 1790090784100
}
```

**Table**

| Field | Type | Description |
|:--|:--|:--|
| `taskId` | `string` | The task id returned by `createTask`. |
| `model` | `string` | `"happyhorse1.0"`. |
| `status` | `string` | `waiting` · `generating` · `success` · `fail`. Stop polling on `success` or `fail`. |
| `creditsUsed` | `number` | Credits actually charged. Refunded automatically when `status` is `fail`. |
| `output` | `object[]` | Generated video; empty until `success`. Stored by Kinovi for 7 days after generation. |
| `output[0].url` | `string` | Download URL of the `.mp4` clip. |
| `output[0].width` | `integer` | Pixel width. |
| `output[0].height` | `integer` | Pixel height. |
| `output[0].mediaType` | `string` | `video/mp4`. |
| `error` | `object \| null` | `{ code, message }` when the task failed, otherwise `null`. |
| `createTime` | `number` | Unix epoch milliseconds when the task was accepted. |
| `completeTime` | `number \| null` | Unix epoch milliseconds when the task reached a terminal status. |

## Examples

### Image to video (`i2v`)

**cURL**

```bash
curl -sS -X POST "https://kinovi.ai/api/v1/jobs/createTask" \
  -H "Authorization: Bearer $KINOVI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "happyhorse1.0",
    "inputs": {
      "happyhorseMode": "i2v",
      "prompt": "Slow dolly-in with natural wind catching the subject hair and soft sunset glow.",
      "imageUrls": ["https://static.kinovi.ai/generated-images/task_ff01ii3zvib7ndbx8negnh6q-0.png"],
      "duration": 5,
      "outputResolution": "720p"
    }
  }'
```

**Node.js**

```ts
const API_BASE = "https://kinovi.ai/api/v1";
const headers = {
  Authorization: `Bearer ${process.env.KINOVI_API_KEY}`,
  "Content-Type": "application/json",
};

const { taskId } = await fetch(`${API_BASE}/jobs/createTask`, {
  method: "POST",
  headers,
  body: JSON.stringify({
    model: "happyhorse1.0",
    inputs: {
      happyhorseMode: "i2v",
      prompt: "Slow dolly-in with natural wind catching the subject hair and soft sunset glow.",
      imageUrls: ["https://static.kinovi.ai/generated-images/task_ff01ii3zvib7ndbx8negnh6q-0.png"],
      duration: 5,
      outputResolution: "720p",
    },
  }),
}).then((r) => r.json());

while (true) {
  const info = await fetch(`${API_BASE}/jobs/recordInfo?taskId=${encodeURIComponent(taskId)}`, { headers }).then((r) =>
    r.json(),
  );
  if (info.status === "success") {
    console.log(info.output[0].url);
    break;
  }
  if (info.status === "fail") throw new Error(JSON.stringify(info.error));
  await new Promise((r) => setTimeout(r, 3000));
}
```

**Python**

```python
import json, os, time, urllib.request

API_BASE = "https://kinovi.ai/api/v1"
HEADERS = {
    "Authorization": f"Bearer {os.environ['KINOVI_API_KEY']}",
    "Content-Type": "application/json",
}

payload = {
    "model": "happyhorse1.0",
    "inputs": {
        "happyhorseMode": "i2v",
        "prompt": "Slow dolly-in with natural wind catching the subject hair and soft sunset glow.",
        "imageUrls": ["https://static.kinovi.ai/generated-images/task_ff01ii3zvib7ndbx8negnh6q-0.png"],
        "duration": 5,
        "outputResolution": "720p",
    },
}

req = urllib.request.Request(f"{API_BASE}/jobs/createTask", data=json.dumps(payload).encode(), headers=HEADERS)
task_id = json.load(urllib.request.urlopen(req))["taskId"]

while True:
    info = json.load(urllib.request.urlopen(urllib.request.Request(f"{API_BASE}/jobs/recordInfo?taskId={task_id}", headers=HEADERS)))
    if info["status"] == "success":
        print(info["output"][0]["url"])
        break
    if info["status"] == "fail":
        raise RuntimeError(info["error"])
    time.sleep(3)
```

### Video edit (`video-edit`)

**cURL**

```bash
curl -sS -X POST "https://kinovi.ai/api/v1/jobs/createTask" \
  -H "Authorization: Bearer $KINOVI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "happyhorse1.0",
    "inputs": {
      "happyhorseMode": "video-edit",
      "prompt": "Change the background to a snowy alpine cabin while preserving the subject motion.",
      "videoUrls": ["https://static.kinovi.ai/videos/seedance_video_1775631198994_17cd129c.mp4"],
      "outputResolution": "720p",
      "audio_setting": "origin"
    }
  }'
```

**Node.js**

```ts
const res = await fetch("https://kinovi.ai/api/v1/jobs/createTask", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KINOVI_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    model: "happyhorse1.0",
    inputs: {
      happyhorseMode: "video-edit",
      prompt: "Change the background to a snowy alpine cabin while preserving the subject motion.",
      videoUrls: ["https://static.kinovi.ai/videos/seedance_video_1775631198994_17cd129c.mp4"],
      outputResolution: "720p",
      audio_setting: "origin",
    },
  }),
});
console.log(await res.json());
```

**Python**

```python
import json, os, urllib.request

payload = {
    "model": "happyhorse1.0",
    "inputs": {
        "happyhorseMode": "video-edit",
        "prompt": "Change the background to a snowy alpine cabin while preserving the subject motion.",
        "videoUrls": ["https://static.kinovi.ai/videos/seedance_video_1775631198994_17cd129c.mp4"],
        "outputResolution": "720p",
        "audio_setting": "origin",
    },
}
req = urllib.request.Request(
    "https://kinovi.ai/api/v1/jobs/createTask",
    data=json.dumps(payload).encode(),
    headers={"Authorization": f"Bearer {os.environ['KINOVI_API_KEY']}", "Content-Type": "application/json"},
)
print(json.load(urllib.request.urlopen(req)))
```

## FAQ

### What is the default `happyhorseMode` if I omit it?

`i2v` (first-frame image-to-video). Always pass `"happyhorseMode": "t2v"`, `"r2v"`, or `"video-edit"` explicitly when calling those modes.

### How do I reference uploaded images in `r2v` prompts?

Write either `[Image 1]`, `[Image 2]`, … or `@Image1`, `@Image2`, … (matching the order in `inputs.imageUrls`).

## Related models

- [Wan 3.0 Text-to-Video](https://kinovi.ai/docs/models/wan3.0-text-to-video): Alibaba's Wan 3.0 text-to-video generation on the Kinovi API.
- [Seedance 2.5](https://kinovi.ai/docs/models/seedance2-5): ByteDance's Seedance 2.5 with multimodal references and 4–30 s clips.
- [Kling 4.0](https://kinovi.ai/docs/models/kling-4.0): Kuaishou's Kling 4.0 with text, keyframes, and reference-to-video.
