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": "<string>",
    "high_quality": false
  },
  "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

height
integer
required

The height of the input video. This value will help determine the final orientation of the output video. The output video resolution may not match the input.

Required range: x >= 300
Example:

960

width
integer
required

The width of the input video. This value will help determine the final orientation of the output video. The output video resolution may not match the input.

Required range: x >= 300
Example:

512

style
object
required
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"

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