POST
/
v1
/
animation
Python
from magic_hour import Client
from os import getenv

client = Client(token=getenv("API_TOKEN"))
res = client.v1.animation.create(
    assets={
        "audio_file_path": "api-assets/id/1234.mp3",
        "audio_source": "file",
        "image_file_path": "api-assets/id/1234.png",
    },
    end_seconds=15.0,
    fps=12.0,
    height=960,
    style={
        "art_style": "Painterly Illustration",
        "camera_effect": "Accelerate",
        "prompt": "Cyberpunk city",
        "prompt_type": "ai_choose",
        "transition_speed": 5,
    },
    width=512,
    name="Animation video",
)
{
  "id": "cuid-example",
  "estimated_frame_cost": 450,
  "credits_charged": 450
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <api_key>, where <api_key> is your API key. To get your API key, go to Developer Hub and click "Create new API Key".

Body

application/json

Body

The body is of type object.

Response

200
application/json

Success