Skip to content

runapi-ai/happyhorse-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RunAPI

HappyHorse API SDKs for JavaScript, Ruby, and Go on RunAPI.

npm RubyGems Go Reference License


The happyhorse ai api SDK packages JavaScript, Ruby, and Go clients for HappyHorse on RunAPI. Use this happyhorse ai api SDK for text, image, and edit-video workflows that need typed installs, JSON request bodies, task polling, and consistent RunAPI errors across services.

HappyHorse belongs to the Alibaba catalog on RunAPI. The public model page is https://runapi.ai/models/happyhorse. The public happyhorse-sdk repository groups the JavaScript, Ruby, and Go packages for this model.

Install

npm install @runapi.ai/happyhorse
gem install runapi-happyhorse
go get github.com/runapi-ai/happyhorse-sdk/go@latest

JavaScript Quick Start

import { HappyHorseClient } from '@runapi.ai/happyhorse';

const client = new HappyHorseClient();

const task = await client.textToVideo.create({
  model: 'happyhorse-character',
  prompt: 'Character1 walks through a paper city and waves at character2.',
  reference_image_urls: [
    'https://cdn.runapi.ai/public/samples/reference-1.jpg',
    'https://cdn.runapi.ai/public/samples/reference-2.jpg',
  ],
  output_resolution: '1080p',
  aspect_ratio: '16:9',
  duration_seconds: 5,
});

const status = await client.textToVideo.get(task.id);

Image-to-Video

const imageTask = await client.imageToVideo.create({
  model: 'happyhorse-image-to-video',
  first_frame_image_url: 'https://cdn.runapi.ai/public/samples/image-to-video.jpg',
  prompt: 'Bring the still frame to life with a gentle cinematic camera move.',
  output_resolution: '1080p',
  duration_seconds: 5,
});

const imageStatus = await client.imageToVideo.get(imageTask.id);

Edit Video

const editTask = await client.editVideo.create({
  model: 'happyhorse-edit-video',
  prompt: 'Make the horse-headed character wear the striped sweater from the reference image.',
  source_video_url: 'https://cdn.runapi.ai/public/samples/video.mp4',
  reference_image_urls: [
    'https://cdn.runapi.ai/public/samples/reference-1.jpg',
  ],
  output_resolution: '1080p',
  audio_setting: 'auto',
});

const editStatus = await client.editVideo.get(editTask.id);

Public Links

License

Licensed under the Apache License, Version 2.0.