API Documentation

Introduction

Welcome to the AutomatrAPI documentation. Our API allows you to programmatically generate videos with captions and custom workout plans.

To get started, you'll need an API key. You can get one by signing up for an account and navigating to the API Keys section in your dashboard.

All API requests should include the following headers:

Authorization: Bearer YOUR_API_KEY Content-Type: application/json

Important

The Content-Type: application/json header is required for all POST and PUT requests. Without this header, the server may not correctly parse your request data.

Rate Limits

To ensure the stability of our service, we implement rate limiting on our API endpoints.

  • Standard users: 3 requests per minute
  • Skool members: 5 requests per minute

If you exceed these limits, you'll receive a 429 Too Many Requests response. Rate limits are calculated based on the number of requests made within a 1-minute window.

Credits

Our API uses a credit-based system for generating content. Different operations consume different amounts of credits.

OperationCredits
Generate Video5
Merge Videos10
Generate Workout Plan3
Generate Lofi Video7
Generate Bedtime Story30

API Limitations

Global API Limitations:

  • File Size: Maximum file size is 100MB per file
  • Rate Limits: 100 requests per minute per API key
  • Processing Timeout: Jobs that exceed 30 minutes may be terminated
Video Merger Limits
  • Maximum number of videos: 7 videos per request
  • Maximum duration per clip: 11 seconds
  • Maximum total duration: 80 seconds
  • Supported video formats: MP4, MOV, AVI, WEBM
  • Supported audio formats: MP3, WAV, AAC, M4A
Video Caption Limits
  • Maximum video duration: 5 minutes
  • Maximum caption count: 100 captions per video
  • Supported video formats: MP4, MOV, WEBM
  • Supported audio formats: MP3, WAV, AAC, M4A
Lofi Video Generation Limits
  • Maximum duration: 60 minutes
  • Supported video formats: MP4, MOV, AVI, MKV
  • Supported audio formats: MP3, WAV, M4A, AAC
  • Maximum file size: Same as global limit (100MB)
Bedtime Story Limits
  • Maximum number of scenes: 20 scenes per story
  • Maximum custom duration: 16.67 minutes (1000 seconds)
  • Maximum scene audio length: 60 seconds per scene
  • Maximum background music length: 16.67 minutes
  • Supported image formats: PNG, JPG, JPEG
  • Supported audio formats: MP3, WAV, M4A, AAC
  • Maximum image resolution: 1920x1080 pixels
  • Recommended image aspect ratio: 16:9 for best results

Need Higher Limits?

Contact our support team for custom enterprise plans with increased limits and dedicated resources.

Workout API

The Workout API allows you to generate customized workout plans with detailed exercise instructions, sets, reps, and rest periods.

You can also include YouTube video links for each exercise to provide visual demonstrations.

Key Features:

  • Beautiful Templates: We generate professionally designed workout plans with a modern, visually appealing layout.
  • Automatic YouTube Thumbnails: Simply provide YouTube video URLs, and we automatically extract and display thumbnails in the workout plan.
  • Clickable Exercise Links: Each exercise includes clickable links to demonstration videos for easy reference.
  • PDF Export: Workout plans are delivered as downloadable PDF files for easy sharing and printing.

Generate Workout Plan

Create a new customized workout plan

POSTCosts 3 Credits

Endpoint

https://api.automatrapi.com/v1/workout-plans

Request

Send a POST request to the workout plans endpoint with your workout plan details.

Understanding the Workout Plan Structure

  • document_settings: Controls the branding of your workout plan, including the logo text and subtitle that appear at the top.
  • client_info: Basic information about who the workout is for.
  • rest_day: Information shown on rest days, including tips and reminders.
  • days: The actual workout schedule, organized by day number.
  • is_rest_day: Set to true for rest days (no exercises needed) or false for training days.
  • exercises: Each exercise includes name, sets, reps, and a YouTube video URL that will display as a thumbnail.
{
  "document_settings": {
    "title": "7-Day Personalized Fitness Plan",
    "header": {
      "logo": {
        "text": "FIT ELITE"
      },
      "subtitle": {
        "text": "PREMIUM FITNESS PROGRAM"
      }
    }
  },
  "client_info": {
    "trainer_name": "Coach Alex",
    "client_name": "John Doe",
    "client_goal": "Weight Loss",
    "client_weight": "95 kg",
    "client_height": "175 cm"
  },
  "rest_day": {
    "title": "ACTIVE RECOVERY",
    "tips": [
      "Allow your muscles to repair and grow",
      "Stay hydrated (aim for 8-10 glasses of water)",
      "Focus on proper nutrition",
      "Practice light stretching or yoga",
      "Get adequate sleep (7-9 hours)",
      "Take a light walk if you feel like moving"
    ],
    "reminder": "Remember: Rest days are essential for progress!"
  },
  "days": {
    "1": {
      "is_rest_day": false,
      "day_title": "Upper Body Strength",
      "exercises": [
        {
          "name": "Push-ups",
          "sets": 3,
          "reps": "10-12",
          "video_url": "https://www.youtube.com/watch?v=IODxDxX7oi4",
          "notes": "Keep core tight, elbows at 45-degree angle"
        },
        {
          "name": "Dumbbell Rows",
          "sets": 3,
          "reps": "10-12",
          "video_url": "https://www.youtube.com/watch?v=pYcpY20QaE8",
          "notes": "Keep back straight, pull dumbbell to hip"
        }
      ]
    },
    "2": {
      "is_rest_day": false,
      "day_title": "Lower Body Focus",
      "exercises": [
        {
          "name": "Squats",
          "sets": 3,
          "reps": "12-15",
          "video_url": "https://www.youtube.com/watch?v=YaXPRqUwItQ",
          "notes": "Keep chest up, knees tracking over toes"
        }
      ]
    },
    "3": {
      "is_rest_day": true
    }
  }
}

This example shows a partial workout plan with one rest day and exercises targeting different muscle groups. Each day has a descriptive title and exercises include proper form instructions.

Response

{
  "job_id": "wk_123456789",
  "status": "processing",
  "message": "Your workout plan is being generated"
}

Check Workout Plan Status

Check the status of a workout plan generation job

GET

Endpoint

https://api.automatrapi.com/v1/workout-plans/{job_id}

Request Example

curl -X GET \
  'https://api.automatrapi.com/v1/workout-plans/wk_123456789' \
  -H 'Authorization: Bearer YOUR_API_KEY'

Response

{
  "job_id": "wk_123456789",
  "status": "completed",
  "output_url": "https://storage.automatrapi.com/workout-plans/wk_123456789.pdf",
  "created_at": "2023-09-15T12:34:56Z",
  "completed_at": "2023-09-15T12:35:30Z"
}

Video Caption API

The Video Caption API allows you to generate professional-looking videos with dynamic captions and voiceovers. This is perfect for creating engaging social media content, educational videos, and marketing materials.

Key Features:

  • Dynamic Captions: Captions appear and disappear at precise timestamps, synchronized with the audio.
  • Custom Styling: Control the appearance of captions including font, size, color, and position.
  • Background Videos: Use your own background videos or choose from our library of stock footage.
  • Background Music: Add background music that automatically adjusts volume during voiceovers.
  • High-Quality Output: Videos are rendered in 1080p with smooth transitions and professional effects.

Generate Video with Captions

Create a new video with synchronized captions and voiceover

POSTCosts 5 Credits

Endpoint

https://api.automatrapi.com/v1/video-generations

Request

Send a POST request to the video generations endpoint with your video details, including captions and media URLs.

Understanding the Video Caption Structure

  • background_music_url: URL to the background music file.
  • voiceover_url: URL to the voiceover audio file.
  • background_video_url: URL to the background video file.
  • captions: Array of caption objects, each containing the text and timing information.
  • words: The text to display for this caption.
  • start: The timestamp (in seconds) when this caption should appear.
  • end: The timestamp (in seconds) when this caption should disappear.
{
  "background_music_url": "YOUR_MUSIC_URL",
  "voiceover_url": "YOUR_VOICEOVER_URL",
  "background_video_url": "YOUR_BACKGROUND_VIDEO_URL",
  "captions": [
    {
      "words": "Life Is Unpredictable, And Sometimes",
      "start": 0.046,
      "end": 2.74
    },
    {
      "words": "It Feels Like Everything That",
      "start": 2.74,
      "end": 3.889
    },
    {
      "words": "Can Go Wrong Does. We",
      "start": 3.889,
      "end": 6.2
    },
    {
      "words": "Face Emotional, Spiritual, And Financial",
      "start": 6.2,
      "end": 9.253
    },
    {
      "words": "Struggles. Yet, It's Not The",
      "start": 9.253,
      "end": 11.865
    }
  ]
}

This example shows a video with background music, voiceover, and synchronized captions. The captions will appear and disappear at the specified timestamps.

Response

{
  "job_id": "vid_123456789",
  "status": "processing",
  "message": "Your video is being processed"
}

Check Video Generation Status

Check the status of a video generation job

GET

Endpoint

https://api.automatrapi.com/v1/video-generations/status/{job_id}

Request Example

curl -X GET \
  'https://api.automatrapi.com/v1/video-generations/status/vid_123456789' \
  -H 'Authorization: Bearer YOUR_API_KEY'

Response

{
  "job_id": "vid_123456789",
  "status": "completed",
  "output_url": "https://storage.automatrapi.com/videos/vid_123456789.mp4",
  "created_at": "2023-09-15T12:34:56Z",
  "completed_at": "2023-09-15T12:35:30Z"
}

Video Merger API

The Video Merger API allows you to combine multiple videos into a single seamless video with professional transitions. This is perfect for creating compilations, montages, or multi-scene videos.

Key Features:

  • Multiple Transition Types: Choose from fade, dissolve, wipe, and other professional transitions.
  • Custom Transition Duration: Control how long each transition takes.
  • Background Audio: Add background music to your merged video.
  • Automatic Resolution Handling: Videos of different resolutions are automatically adjusted.
  • Fast Processing: Efficient merging algorithm for quick results.

Merge Videos

Combine multiple videos into one with transitions

POSTCosts 6 Credits

Endpoint

https://api.automatrapi.com/v1/video-merger

Request

Send a POST request to the video merger endpoint with your video URLs and transition preferences.

Understanding the Video Merger Options

  • videos: Array of URLs to the videos you want to merge (max 10).
  • transition_type: Type of transition between videos (fade, dissolve, wipe, slide).
  • transition_duration: Duration of each transition in seconds (0.5-3.0).
  • audio_url: Optional URL to background music for the merged video.
{
  "videos": [
    "https://example.com/video1.mp4",
    "https://example.com/video2.mp4",
    "https://example.com/video3.mp4"
  ],
  "transition_type": "fade",
  "transition_duration": 1.5,
  "audio_url": "https://example.com/background-music.mp3"
}

This example shows merging three videos with a 1.5-second fade transition and background music.

Response

{
  "job_id": "vm_123456789",
  "status": "processing",
  "message": "Your videos are being merged"
}

Check Video Merger Status

Check the status of a video merger job

GET

Endpoint

https://api.automatrapi.com/v1/video-merger/{job_id}

Request Example

curl -X GET \
  'https://api.automatrapi.com/v1/video-merger/vm_123456789' \
  -H 'Authorization: Bearer YOUR_API_KEY'

Response

{
  "job_id": "vm_123456789",
  "status": "completed",
  "output_url": "https://storage.automatrapi.com/mergers/vm_123456789.mp4",
  "created_at": "2023-09-15T12:34:56Z",
  "completed_at": "2023-09-15T12:38:30Z"
}

Lofi Video API

The Lofi Video API allows you to generate relaxing lofi videos with custom music and visuals. These videos are perfect for study sessions, relaxation, or background ambiance.

Key Features:

  • Custom Duration: Generate lofi videos of any length up to 60 minutes.
  • Custom Audio: Use your own audio tracks or choose from our library of lofi beats.
  • Visual Effects: Relaxing visual effects and filters applied to your video.
  • Seamless Loops: Videos can be designed to loop seamlessly for continuous playback.
  • High-Quality Output: Videos are rendered in high quality with smooth transitions.

Generate Lofi Video

Create a new lofi video with custom music and visuals

POSTCosts 7 Credits

Endpoint

https://api.automatrapi.com/v1/lofi-generations

Request

Send a POST request to the lofi generations endpoint with your video and audio URLs.

Understanding the Lofi Video Structure

  • video_url: URL to the video you want to use as the visual base.
  • audio_url: URL to the audio track you want to use.
  • duration_minutes: Desired duration of the lofi video in minutes (max 60).
{
  "video_url": "https://example.com/your-video.mp4",
  "audio_url": "https://example.com/your-audio.mp3",
  "duration_minutes": 10
}

This example shows generating a 10-minute lofi video using a custom video and audio track.

Response

{
  "job_id": "lofi_123456789",
  "status": "processing",
  "message": "Your lofi video is being generated"
}

Check Lofi Video Status

Check the status of a lofi video generation job

GET

Endpoint

https://api.automatrapi.com/v1/lofi-generations/{job_id}

Request Example

curl -X GET \
  'https://api.automatrapi.com/v1/lofi-generations/lofi_123456789' \
  -H 'Authorization: Bearer YOUR_API_KEY'

Response

{
  "job_id": "lofi_123456789",
  "status": "completed",
  "output_url": "https://storage.automatrapi.com/lofi/lofi_123456789.mp4",
  "created_at": "2023-09-15T12:34:56Z",
  "completed_at": "2023-09-15T12:35:30Z"
}

Bedtime Story API

The Bedtime Story API allows you to generate enchanting bedtime stories with panoramic visuals and soothing narration. The API supports both interactive and panoramic video modes with smooth transitions between scenes.

Key Features:

  • Panoramic Mode: Creates a continuous panorama by stitching all scene images together and smoothly panning across them.
  • Interactive Mode: Displays each scene as a static frame with narration, creating an interactive storybook experience.
  • Extended Duration: Supports custom video durations beyond the natural audio length, with background music continuing to play.
  • Natural Audio Timing: Scene audio plays at natural timing (not stretched) while background music continues for the extended duration.
  • Two-Phase Panning: For panoramic videos with extended durations, uses natural panning speed during audio portion and slower panning for the extended portion.

Generate Bedtime Story

Create a new bedtime story video with scenes and narration

POSTCosts 30 Credits

Endpoint

https://api.automatrapi.com/v1/bedtimestory

Request

Send a POST request to the bedtime story endpoint with your story scenes, audio, and configuration.

Understanding the Bedtime Story Structure

  • music_url: URL to the background music that will play throughout the video.
  • video_type: Type of video to generate - either "interactive" (static frames) or "panoramic" (continuous panning).
  • custom_duration: Optional parameter to specify a longer duration for the video beyond the natural audio length.
  • scenes: Array of scene objects, each containing an image_url and audio_url for that scene's visuals and narration.
{
  "music_url": "https://example.com/background_music.mp3",
  "video_type": "panoramic",
  "custom_duration": 180,
  "scenes": [
    {
      "image_url": "https://example.com/scene_1.png",
      "audio_url": "https://example.com/scene_1_narration.mp3"
    },
    {
      "image_url": "https://example.com/scene_2.png",
      "audio_url": "https://example.com/scene_2_narration.mp3"
    },
    {
      "image_url": "https://example.com/scene_3.png",
      "audio_url": "https://example.com/scene_3_narration.mp3"
    }
  ]
}

Response

{
  "job_id": "bs_123456789",
  "status": "processing",
  "message": "Your bedtime story is being generated"
}

Check Bedtime Story Status

Check the status of a bedtime story generation job

GET

Endpoint

https://api.automatrapi.com/v1/bedtimestory/{job_id}/status

Request Example

curl -X GET \
  'https://api.automatrapi.com/v1/bedtimestory/bs_123456789/status' \
  -H 'Authorization: Bearer YOUR_API_KEY'

Response

{
  "job_id": "bs_123456789",
  "status": "completed",
  "output_url": "https://storage.automatrapi.com/bedtimestory/bs_123456789.mp4",
  "created_at": "2023-09-15T12:34:56Z",
  "completed_at": "2023-09-15T12:35:30Z"
}