POST
/
v1
/
video-to-video
curl --request POST \
  --url https://api.magichour.ai/v1/video-to-video \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Video To Video video",
  "start_seconds": 0,
  "end_seconds": 15,
  "height": 960,
  "width": 512,
  "fps_resolution": "HALF",
  "style": {
    "art_style": "Marble",
    "version": "v1",
    "prompt_type": "default",
    "prompt": "<string>",
    "model": "Dreamshaper"
  },
  "assets": {
    "video_source": "file",
    "video_file_path": "api-assets/id/1234.mp4",
    "youtube_url": "<string>"
  }
}'
{
  "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
start_seconds
number
required

The start time of the input video in seconds

Required range: x >= 0
Example:

0

end_seconds
number
required

The end time of the input video in seconds

Required range: x >= 0.1
Example:

15

style
object
required
assets
object
required

Provide the assets for video-to-video. For video, The video_source field determines whether video_file_path or youtube_url field is used

name
string
default:Video To Video - dateTime

The name of video

Example:

"Video To Video video"

height
integer

Used to determine the dimensions of the output video.

  • If height is provided, width will also be required. The larger value between width and height will be used to determine the maximum output resolution while maintaining the original aspect ratio.
  • If both height and width are omitted, the video will be resized according to your subscription's maximum resolution, while preserving aspect ratio.

Note: if the video's original resolution is less than the maximum, the video will not be resized.

See our pricing page for more details.

Required range: x >= 64
Example:

960

width
integer

Used to determine the dimensions of the output video.

  • If width is provided, height will also be required. The larger value between width and height will be used to determine the maximum output resolution while maintaining the original aspect ratio.
  • If both height and width are omitted, the video will be resized according to your subscription's maximum resolution, while preserving aspect ratio.

Note: if the video's original resolution is less than the maximum, the video will not be resized.

See our pricing page for more details.

Required range: x >= 64
Example:

512

fps_resolution
enum<string>
default:HALF

Determines whether the resulting video will have the same frame per second as the original video, or half.

  • FULL - the result video will have the same FPS as the input video
  • HALF - the result video will have half the FPS as the input video
Available options:
FULL,
HALF
Example:

"HALF"

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