API Reference

HappyHorse Video Generation

Call the Alibaba Cloud Bailian (DashScope) HappyHorse models through TENSORAXIS — text-to-video, image-to-video, reference-to-video, and video editing, plus parameters and billing.

HappyHorse is the TENSORAXIS integration of the Alibaba Cloud Bailian (DashScope) video models (channel HappyHorse). It is an asynchronous task: submit a task to get a task_id, poll the task status, then read the video URL after completion. The shared submit/poll flow lives in the Video Generation overview; this page covers only HappyHorse's four capabilities and parameters.

The four capabilities are distinguished by the model name suffix:

CapabilityModelsDescription
Text-to-video (t2v)happyhorse-1.1-t2v, happyhorse-1.0-t2vGenerate from a prompt only
Image-to-video (i2v)happyhorse-1.1-i2v, happyhorse-1.0-i2vGenerate from one first-frame image
Reference-to-video (r2v)happyhorse-1.1-r2v, happyhorse-1.0-r2vGenerate from multiple reference images
Video editing (video-edit)happyhorse-1.0-video-editEdit from one source video + reference images

Request Fields

POST /v1/video/generations

FieldTypeRequiredDescription
modelstringYesHappyHorse model name (see table above)
promptstringYesVideo prompt; empty returns 400 prompt is required
metadata.mediaarrayPer capabilityMedia input array; each item has type and url; type is first_frame / reference_image / video
imagesstring[]Per capabilityReference image URLs (for r2v); treated as reference images when metadata.media is absent
imagestringPer capabilitySingle image URL (first frame for i2v)
input_referencestringPer capabilityInput reference URL (compat entry for i2v first frame / r2v reference image)
metadataobjectNoResolution, duration, aspect ratio, etc. — see Parameters

Prefer passing media through metadata.media, tagging each item's purpose with type. images / image / input_reference are compatibility entries: when metadata.media is absent, i2v takes input_reference/image as the first frame, and r2v takes images/input_reference as reference images. The source video for video editing must be passed via metadata.media (type: video).

Text-to-Video (-t2v)

Needs only prompt; no media input is accepted.

curl https://api.tensoraxis.ai/v1/video/generations \
  -H "Authorization: Bearer $TENSORAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "happyhorse-1.1-t2v",
    "prompt": "A lake at the foot of a snowy mountain reflects the sunset; the camera slowly pushes in",
    "metadata": {
      "resolution": "1080P",
      "ratio": "16:9",
      "duration": 5
    }
  }'

Image-to-Video (-i2v)

Exactly one first-frame image. Pass it via metadata.media (type: first_frame), or use the compatibility entries input_reference / image. ratio is not accepted (the aspect ratio is determined by the first frame).

curl https://api.tensoraxis.ai/v1/video/generations \
  -H "Authorization: Bearer $TENSORAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "happyhorse-1.1-i2v",
    "prompt": "The subject slowly looks up and smiles",
    "metadata": {
      "resolution": "1080P",
      "duration": 5,
      "media": [
        { "type": "first_frame", "url": "https://example.com/first-frame.jpg" }
      ]
    }
  }'

Reference-to-Video (-r2v)

Generate from multiple reference images. The gateway accepts 1–9 reference images (reference_image items in metadata.media, or top-level images); the upstream recommends ≤5, and anything beyond is subject to the upstream response.

curl https://api.tensoraxis.ai/v1/video/generations \
  -H "Authorization: Bearer $TENSORAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "happyhorse-1.1-r2v",
    "prompt": "Have these characters interact in the same scene",
    "images": [
      "https://example.com/ref-1.jpg",
      "https://example.com/ref-2.jpg"
    ],
    "metadata": {
      "resolution": "1080P",
      "ratio": "16:9",
      "duration": 5
    }
  }'

Video Editing (-video-edit)

Edit from one source video. You must pass exactly one type: video source video via metadata.media; you may add reference images (type: reference_image, ≤5 at the gateway, ≤4 upstream).

  • duration is not accepted: the output keeps the source video's length, so no duration parameter is sent.
  • Supports audio_setting (this capability only): auto (default) / origin.
curl https://api.tensoraxis.ai/v1/video/generations \
  -H "Authorization: Bearer $TENSORAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "happyhorse-1.0-video-edit",
    "prompt": "Replace the background with a dusk city skyline",
    "metadata": {
      "resolution": "1080P",
      "audio_setting": "origin",
      "media": [
        { "type": "video", "url": "https://example.com/source.mp4" },
        { "type": "reference_image", "url": "https://example.com/style.jpg" }
      ]
    }
  }'

Parameters

Parameters under metadata map to upstream DashScope request fields. "Gateway value" is the value this site actually validates/clamps; "Notes" are for reference and are ultimately defined by the upstream response.

ParameterTypeApplies toGateway value / DefaultNotes
resolutionstringAll720P / 1080P, default 1080PUnrecognized values fall back to 1080P
ratiostringt2v / r2v only16:9 / 9:16 / 1:1 / 4:3 / 3:4; upstream defaults to 16:9 when omittedNot accepted by i2v / video-edit
durationintegert2v / i2v / r2vClamped to [3,15], default 5Not accepted by video-edit (output keeps source length)
seedintegerAll[0, 2147483647]Fix randomness; an explicit 0 is preserved and sent
watermarkbooleanAllDefault false (sent explicitly)Whether to add a watermark
audio_settingstringvideo-edit onlyauto (default) / originAudio handling

The official duration range varies by scenario (text-to-video about [2,15], with-video about [2,10]), but the gateway uniformly clamps to [3,15]; out-of-range values are truncated to the boundary.

Billing

HappyHorse is billed per second, multiplied by a resolution coefficient (1080P is about 1.78× of 720P).

  • For t2v / i2v / r2v the duration is known at request time and is settled as actual duration × resolution coefficient.
  • Video editing has no duration input (output = source video length), so it is billed by the declared metadata.duration value; when undeclared, a conservative default (about 10 seconds) is used.

Exact unit prices follow the console "Video Pricing" configuration and the pricing page; operators may override the defaults with the latest official rates.

Task Polling

The shared submit/poll flow, status codes, and OpenAI/Sora-compatible fetch paths are in the Video Generation overview.