POST
/
v1
/
image-to-video
curl --request POST \
  --url https://api.magichour.ai/v1/image-to-video \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Image To Video video",
  "end_seconds": 5,
  "height": 960,
  "width": 512,
  "style": {
    "prompt": "a dog running",
    "high_quality": false,
    "quality_mode": "quick"
  },
  "assets": {
    "image_file_path": "api-assets/id/1234.png"
  }
}'
{
  "id": "clx7uu86w0a5qp55yxz315r6r",
  "estimated_frame_cost": 450
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
Body
end_seconds
number
required

The total duration of the output video in seconds.

Required range: 5 <= x <= 60
Example:

5

style
object
required

Attributed used to dictate the style of the output

assets
object
required

Provide the assets for image-to-video.

name
string
default:Image To Video - dateTime

The name of video

Example:

"Image To Video video"

height
integer
deprecated

This field does not affect the output video's resolution. The video's orientation will match that of the input image.

It is retained solely for backward compatibility and will be deprecated in the future.

Required range: x >= 64
Example:

960

width
integer
deprecated

This field does not affect the output video's resolution. The video's orientation will match that of the input image.

It is retained solely for backward compatibility and will be deprecated in the future.

Required range: x >= 64
Example:

512

Response

200
application/json

Success

id
string
required

Unique ID of the video. This value can be used in the get video project API to fetch additional details such as status

Example:

"clx7uu86w0a5qp55yxz315r6r"

estimated_frame_cost
integer
required

Estimated cost of the video in terms of number of frames needed to render the video. Frames will be adjusted when the video completes

Example:

450