For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
跳至內容

Video Generation API

Learn how to generate videos with ApiSmart using HappyHorse and Seedance, including text, image, video, audio, multimodal inputs, task polling, and resolution settings.

Use the Video Generation API to create videos with supported ApiSmart video models.

Depending on the selected model, you can generate videos from text, images, videos, audio, and multimodal references.

Video generation is asynchronous. After creating a task, use the returned task ID to check its status until generation completes.

🎬 Endpoints

Create a Video Task

Method: POST

Endpoint: /v1/video/tasks

Full URL:

https://gw.apismart.ai/v1/video/tasks

Query a Video Task

Method: GET

Endpoint: /v1/video/tasks/{id}

Retrieve Video Content

Method: GET

Endpoint: /v1/videos/{id}/content

🔑 Authentication

Include your ApiSmart API Key in the Authorization header:

For JSON requests, also include:

🧩 Supported Video Models

ApiSmart currently supports two video model families.

HappyHorse

  • happyhorse-1.0

  • happyhorse-1.1

Seedance

  • doubao-seedance-2.0

  • doubao-seedance-2-0-fast

  • doubao-seedance-2-0-mini

  • doubao-seedance-2-5

Capabilities, supported resolutions, inputs, and billing rules vary by model.

For pricing information, see Model Pricing and Billing.


HappyHorse

HappyHorse supports several generation workflows. The API automatically determines the workflow based on the inputs included in the request.

Input
Workflow

Prompt only

Text-to-video

One image

Image-to-video

Multiple images

Reference-to-video

Video input

Video editing

When multiple input types are present, workflow detection follows this priority:

Video editing → Reference-to-video → Image-to-video → Text-to-video

✨ Text-to-Video

🖼️ Image-to-Video

Provide a single image URL using image:

🧩 Multiple Reference Images

Use images when your request needs multiple reference images:

When referencing multiple HappyHorse images in a prompt, follow the reference order used by the model.

🎞️ Video Editing

HappyHorse also supports video input.

For video editing, you can provide duration to specify the generated video length. If it is omitted, the service can use the source video duration.

⚠️ HappyHorse Resolution and Duration

Always explicitly specify the resolution and duration when creating standard HappyHorse generation requests.

If resolution is omitted, HappyHorse billing defaults to:

1080p

If duration is omitted, billing defaults to:

5 seconds

For example, with happyhorse-1.0:

Default billing

1080p × 5 seconds = $1.35

Explicitly requesting:

results in:

720p × 5 seconds = $0.725

Explicitly setting these parameters helps prevent unexpected charges.

HappyHorse request formats may use resolution or size for resolution-related configuration. Follow the format shown for the workflow you are implementing.


Seedance

Seedance uses the content array to combine text and multimodal references.

Supported content types include:

  • text

  • image_url

  • video_url

  • audio_url

✨ Text-to-Video

🖼️ Reference Image

Use reference_image when an image should guide the generated video.

🎞️ First and Last Frame Generation

Seedance can generate the transition between a specified first frame and last frame.

Use:

  • role: "first_frame"

  • role: "last_frame"

Example:

You can also provide only a first_frame if you want the generated video to begin with a specific image.

Image references can use public HTTP/HTTPS URLs or Base64 Data URIs.

🎥 Reference Video

Use reference_video when an existing video should guide generation:

Requests that contain video input can use a different Seedance pricing tier.

See Model Pricing and Billing for current pricing details.

🎵 Images, Video, and Audio

Seedance also supports multimodal reference combinations.

Available roles include:

Role
Purpose

reference_image

Reference image

first_frame

First frame of the generated video

last_frame

Last frame of the generated video

reference_video

Reference video

reference_audio

Reference audio

reference_audio cannot be used by itself. It must be combined with a supported image or video reference.

A multimodal request can look like:

Referencing Multiple Assets in Prompts

When multiple non-text assets are included, use:

  • 图片1, 图片2, ...

  • 视频1, 视频2, ...

  • 音频1, 音频2, ...

Numbering starts from 1 and follows the order of non-text items in the content array.

Do not add spaces between the Chinese asset type and its number.

📦 Seedance Input Limits

Seedance supports up to 12 reference assets in total, including:

  • Up to 9 images

  • Up to 3 videos

  • Up to 3 audio files

The combined total must not exceed 12.

📎 Base64 Image Input

In addition to public URLs, image_url.url can contain a Base64 Data URI:

The data:image/...;base64, prefix is required.


⚙️ Request Parameters

Parameter
Models
Type
Description

model

All

string

Video model ID

prompt

All

string

Text generation instruction

duration

All

integer

Video duration in seconds

resolution / size

All

string

Requested resolution

content

All

array

Multimodal content array

image / images

HappyHorse

string / array

Image URL or multiple image URLs

input_reference

HappyHorse

string

Source video URL for video editing

metadata

HappyHorse

object

Additional HappyHorse configuration

ratio

Seedance

string

Aspect ratio such as 16:9 or 9:16

callback_url

Seedance

string

Optional callback URL

return_last_frame

Seedance

boolean

Return the generated final frame

generate_audio

Seedance

boolean

Generate synchronized audio

draft

Seedance

boolean

Enable draft mode

tools

Seedance

array / object

Optional tool configuration

seed

All

integer

Random seed

watermark

Seedance

boolean

Enable or disable watermark

execution_expires_after

Seedance

integer

Task expiration time in seconds

Supported parameters can vary by model and workflow.


📐 Resolution and Duration

Resolution and duration can directly affect video billing.

Default Values

Model Family
Resolution When Omitted
Duration When Omitted

HappyHorse

Billed as 1080p

5 seconds

Seedance

Billed as 720p

Determined by the model

Supported Resolutions

Model ID
Supported Resolutions

happyhorse-1.0

720p, 1080p

happyhorse-1.1

720p, 1080p

doubao-seedance-2.0

480p, 720p, 1080p

doubao-seedance-2-0-fast

480p, 720p, 1080p

doubao-seedance-2-0-mini

480p, 720p, 1080p

doubao-seedance-2-5

480p, 720p

Seedance does not support 4k.

If an unsupported resolution is requested, the API can return:

400 unsupported_resolution

Requests rejected by this validation do not incur a generation charge.

Seedance Output Resolution

For Seedance, the requested resolution determines the billing tier, but the actual output resolution is determined by the model service.

After generation completes, use the resolution field in the task response when you need the actual output resolution.


🔄 Query Task Status

After creating a video task, use the returned task ID:

Task Statuses

Status
Meaning

queued

Waiting in queue

running

Generation in progress

succeeded

Generation completed successfully

failed

Generation failed

cancelled

Task was cancelled

expired

Task expired

Continue polling while the task is queued or running.

📦 Successful Task Response

A successful response can look like:

Use content.video_url to access the generated result when it is returned.

❌ Failed Task Response

A failed task can look like:

For complete error handling guidance, see HTTP Status Codes and API Errors.


🕘 View Recent Generated Videos

Use:

GET /v1/videos

to retrieve recently generated successful videos.

Example:

Query Parameters

Parameter
Default
Description

page

1

Page number

page_size

20

Records per page, up to 100

Video history records can include:

  • Generation ID

  • Task ID

  • Model ID

  • Video URL

  • Duration

  • Resolution

  • Cost

  • Creation time

  • Storage status

Only videos generated successfully are included.

Video history can currently be queried for the most recent 7 days.

Save important generated videos to your own storage rather than relying only on history availability.


👤 Verified Real-Person Assets

Seedance also supports a verified real-person asset workflow for authorized real-person video generation.

This advanced workflow uses:

POST /seedance-gateway

A typical process is:

  1. Create a verification session.

  2. Complete the mobile verification process.

  3. Retrieve the resulting GroupId.

  4. Create a verified asset.

  5. Wait until the asset status becomes Active.

  6. Reference the asset using asset://asset_id in a Seedance video request.

Example:

Verified assets are account-specific. An asset:// reference must belong to the account making the video request.

Because real-person asset management involves a separate verification and asset lifecycle, consider documenting the complete workflow separately if you use this feature extensively.


⚠️ Common Issues

Invalid API Key

401 invalid_api_key

Verify:

Insufficient Balance

402 insufficient_quota

Add funds before retrying the request.

Model Not Available

403 model_not_allowed

The selected video model is not enabled for your account or API Key.

Unsupported Video Model

403 model_not_video_capable

The selected model cannot be used with the Video Generation API.

Unsupported Resolution

400 unsupported_resolution

The requested resolution is not supported by the selected model.

Temporary Service Errors

502, 503, and 504 can indicate temporary provider, gateway, or dependent-service problems.

Use an appropriate retry strategy for temporary failures.


✅ Before Creating a Video Task

Verify that:

  • Your API Key is valid and enabled

  • Your account has sufficient balance

  • The model ID is correct

  • The selected model supports your input type

  • resolution is supported by the model

  • duration is explicitly set when appropriate

  • Seedance reference assets stay within the supported limits

  • reference_audio is not used by itself

  • Your application is prepared to poll asynchronous task status

  • You understand the billing method of the selected video model

➡️ Next Steps

Continue with:

最後更新於

這有幫助嗎?