> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apisale.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Happy Horse — Video Edit

> Alibaba Happy Horse video-edit: natural-language edits on a source clip with optional reference images. Optimized for video to video via apisale.

## Overview

Alibaba Happy Horse video-edit: natural-language edits on a source clip with optional reference images. Optimized for video to video via apisale.

<Info>
  **Docs** = API contract + Try it (snapshot). **[Explore](https://apisale.ai/explore)** = browser playground. **[Model page](https://apisale.ai/models/alibaba/happy-horse/video-edit)** = product examples.
</Info>

## Endpoint

```http theme={null}
POST https://api.apisale.ai/v1/run/alibaba/happy-horse/video-edit
```

|                |                                   |
| -------------- | --------------------------------- |
| **Model slug** | `alibaba/happy-horse/video-edit`  |
| **Category**   | Video to Video (`video-to-video`) |
| **Lab**        | Alibaba                           |
| **Mode**       | async                             |

## Pricing

**From \$0.087/sec**

apisale price is **30%** below the vendor's official list price.

| Tier                                 | Unit   | Official price | apisale price |
| ------------------------------------ | ------ | -------------- | ------------- |
| 66633fd1-0e8f-4011-ba3e-ea571276f309 | second | \$0.125        | \$0.087       |
| fcdb7a94-c0f0-4077-99e4-a5640135c555 | second | \$0.222        | \$0.155       |

<Info>
  **Official price** = vendor list price. **apisale price** = what you pay through apisale.
</Info>

## Request

```json theme={null}
{‌
  "input": {‌
    "prompt": "Recolor the sky to a deep purple sunset.",
    "duration": 5,
    "resolution": "1080p",
    "audio_setting": "auto",
    "enable_safety_checker": true,
    "video_url": "https://assets.apisale.ai/permanent/official/rehosted/alibaba/happy-horse/video-edit/8e941e9104bf.mp4"
  }
}
```

### Parameters

Fields marked \* are required. Use `Authorization: Key YOUR_API_KEY` for REST.

<ParamField body="input.seed" type="number">
  Optional random seed for reproducibility.
</ParamField>

<ParamField body="input.prompt" type="string" required>
  Text prompt for video generation. Maximum 2500 characters.
</ParamField>

<ParamField body="input.duration" type="number">
  Billing estimate in seconds (3–15). Actual output matches source length, capped at 15s. Default: `5` Values: `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11`, `12`, `13`, `14`, `15` Range: 3 – 15
</ParamField>

<ParamField body="input.video_url" type="string" required>
  Source video URL (MP4/MOV, 3–60s; output capped at 15s).
</ParamField>

<ParamField body="input.resolution" type="string">
  Default: `1080p` Values: `720p`, `1080p`
</ParamField>

<ParamField body="input.audio_setting" type="string">
  auto = model may regenerate audio; origin = keep source audio. Default: `auto` Values: `auto`, `origin`
</ParamField>

<ParamField body="input.reference_image_urls" type="array">
  Optional reference images (@Image1…@Image5 in prompt).
</ParamField>

<ParamField body="input.enable_safety_checker" type="boolean">
  Content moderation on input and output. Default: `true`
</ParamField>

<ParamField body="webhook_url" type="string">
  Optional HTTPS webhook when the run reaches a terminal state.
</ParamField>

<ParamField body="sync" type="boolean">
  Block until completion (same Run response shape).
</ParamField>

<AccordionGroup>
  <Accordion title="Input schema">
    ```json expandable theme={null}
    {‌
      "params": {‌
        "seed": {‌
          "type": "int",
          "description": "Optional random seed for reproducibility."
        },
        "prompt": {‌
          "type": "string",
          "required": true,
          "max_length": 2500,
          "description": "Text prompt for video generation. Maximum 2500 characters."
        },
        "duration": {‌
          "max": 15,
          "min": 3,
          "type": "int",
          "values": [
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
            14,
            15
          ],
          "default": 5,
          "description": "Billing estimate in seconds (3–15). Actual output matches source length, capped at 15s."
        },
        "video_url": {‌
          "type": "media",
          "required": true,
          "description": "Source video URL (MP4/MOV, 3–60s; output capped at 15s)."
        },
        "resolution": {‌
          "type": "enum",
          "values": [
            "720p",
            "1080p"
          ],
          "default": "1080p"
        },
        "audio_setting": {‌
          "type": "enum",
          "values": [
            "auto",
            "origin"
          ],
          "default": "auto",
          "description": "auto = model may regenerate audio; origin = keep source audio."
        },
        "reference_image_urls": {‌
          "type": "array<media>",
          "max_items": 5,
          "description": "Optional reference images (@Image1…@Image5 in prompt)."
        },
        "enable_safety_checker": {‌
          "type": "bool",
          "default": true,
          "description": "Content moderation on input and output."
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>

## Submit response

Returns a **Run** with `run_id`. Poll with [GET /v1/runs/\{run\_id}](/model-apis/poll-runs) or use **Try it** above.

<ResponseField name="run_id" type="string" required>
  Unique run ID — save for polling and webhooks.
</ResponseField>

<ResponseField name="status" type="string" required>
  `queued` (async) or terminal state for sync runs.
</ResponseField>

<ResponseField name="output" type="object">
  Result when `status` is `succeeded` — see **Output schema** below.
</ResponseField>

### Example (async submit)

```json theme={null}
{
  "run_id": "run_550e8400-e29b-41d4-a716-446655440000",
  "endpoint": "alibaba/happy-horse/video-edit",
  "model": "video-edit",
  "capability": "video",
  "mode": "video-to-video",
  "status": "queued",
  "output": null,
  "error": null,
  "billing": null,
  "created_at": "2026-06-27T12:00:00.000Z",
  "started_at": null,
  "completed_at": null,
  "elapsed_ms": null
}
```

Full lifecycle: [Runs lifecycle](/model-apis/runs-lifecycle).

## Output

When `status` is `succeeded`, `output` follows this schema:

<AccordionGroup>
  <Accordion title="Output schema">
    ```json expandable theme={null}
    {‌
      "type": "object",
      "example": {‌
        "videos": [
          {‌
            "url": "https://cdn.example.com/tasks/0.mp4"
          }
        ]
      },
      "required": [
        "videos"
      ],
      "properties": {‌
        "videos": {‌
          "type": "array",
          "items": {‌
            "type": "object",
            "required": [
              "url"
            ],
            "properties": {‌
              "url": {‌
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      },
      "description": "Succeeded task output: single video URL."
    }
    ```
  </Accordion>
</AccordionGroup>

## Example

```bash theme={null}
curl -X POST "https://api.apisale.ai/v1/run/alibaba/happy-horse/video-edit" \
  -H "Authorization: Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "prompt": "Recolor the sky to a deep purple sunset.",
    "duration": 5,
    "resolution": "1080p",
    "audio_setting": "auto",
    "enable_safety_checker": true,
    "video_url": "https://assets.apisale.ai/permanent/official/rehosted/alibaba/happy-horse/video-edit/8e941e9104bf.mp4"
  }
}'
```

## Related

* [Runs lifecycle](/model-apis/runs-lifecycle)
* [Video API overview](/api/video)
* [Account API](/get-started/account-and-monitoring)


## OpenAPI

````yaml openapi-catalog.json POST /v1/run/alibaba/happy-horse/video-edit
openapi: 3.0.3
info:
  title: apisale Model Catalog
  version: '2026-09-01T09:47:50.773Z'
  description: Per-model OpenAPI operations for Mintlify Try playground.
servers:
  - url: https://api.apisale.ai
security: []
paths:
  /v1/run/alibaba/happy-horse/video-edit:
    post:
      tags:
        - Model catalog
        - video
        - Alibaba
      summary: Create Happy Horse — Video Edit
      description: >-
        Alibaba Happy Horse video-edit: natural-language edits on a source clip
        with optional reference images. Optimized for video to video via
        apisale.
      operationId: submit-alibaba-happy-horse-video-edit
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - input
              properties:
                input:
                  type: object
                  properties:
                    seed:
                      description: Optional random seed for reproducibility.
                      type: number
                    prompt:
                      description: >-
                        Text prompt for video generation. Maximum 2500
                        characters.
                      type: string
                    duration:
                      description: >-
                        Billing estimate in seconds (3–15). Actual output
                        matches source length, capped at 15s.
                      type: number
                      minimum: 3
                      maximum: 15
                      default: 5
                    video_url:
                      description: Source video URL (MP4/MOV, 3–60s; output capped at 15s).
                      type: string
                      format: uri
                    resolution:
                      type: string
                      enum:
                        - 720p
                        - 1080p
                      default: 1080p
                    audio_setting:
                      description: >-
                        auto = model may regenerate audio; origin = keep source
                        audio.
                      type: string
                      enum:
                        - auto
                        - origin
                      default: auto
                    reference_image_urls:
                      description: Optional reference images (@Image1…@Image5 in prompt).
                      type: array
                      items:
                        type: string
                    enable_safety_checker:
                      description: Content moderation on input and output.
                      type: boolean
                      default: true
                  required:
                    - prompt
                    - video_url
                  example:
                    prompt: Recolor the sky to a deep purple sunset.
                    duration: 5
                    resolution: 1080p
                    audio_setting: auto
                    enable_safety_checker: true
                    video_url: >-
                      https://assets.apisale.ai/permanent/official/rehosted/alibaba/happy-horse/video-edit/8e941e9104bf.mp4
                webhook_url:
                  type: string
                  format: uri
                sync:
                  type: boolean
                  default: false
            example:
              input:
                prompt: Recolor the sky to a deep purple sunset.
                duration: 5
                resolution: 1080p
                audio_setting: auto
                enable_safety_checker: true
                video_url: >-
                  https://assets.apisale.ai/permanent/official/rehosted/alibaba/happy-horse/video-edit/8e941e9104bf.mp4
      responses:
        '201':
          description: Run accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunObject'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    RunObject:
      type: object
      required:
        - run_id
        - endpoint
        - model
        - capability
        - mode
        - status
        - created_at
      properties:
        run_id:
          type: string
          description: Unique run identifier
        endpoint:
          type: string
          description: Model slug
        model:
          type: string
        capability:
          type: string
        mode:
          type: string
        status:
          type: string
          enum:
            - queued
            - processing
            - succeeded
            - failed
            - timeout
            - cancelled
        output:
          type: object
          nullable: true
        error:
          type: object
          nullable: true
          properties:
            type:
              type: string
              description: Machine-readable error code
            code:
              type: number
              description: HTTP status
            message:
              type: string
        billing:
          type: object
          nullable: true
          properties:
            amount:
              type: string
            currency:
              type: string
              enum:
                - usd
        created_at:
          type: string
          format: date-time
        started_at:
          type: string
          format: date-time
          nullable: true
        completed_at:
          type: string
          format: date-time
          nullable: true
        elapsed_ms:
          type: number
          nullable: true
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Key sk-... (native REST) or Bearer sk-... (vendor SDKs)

````