Text Match Cut API Documentation

Made by: R3AP3R editz

Base URL

http://video-gen.megavault.in/api

Authentication

Currently, the API uses IP-based rate limiting. No authentication is required.

Rate Limits

Endpoints

Generate Video

POST http://video-gen.megavault.in/api/generate

Request Body

{
    "highlighted_text": "Your text here",
    "width": 1920,
    "height": 1080,
    "duration": 5,
    "fps": 5,
    "highlight_color": "#00f7ff",
    "text_color": "#ffffff",
    "background_color": "#0a0a0a",
    "background_style": "solid",
    "blur_type": "radial",
    "blur_radius": 4.0,
    "ai_enabled": true
}

Parameters

Parameter Type Required Default Description
highlighted_text string Yes - Text to highlight in the video
width integer Yes - Video width in pixels (256-4096)
height integer Yes - Video height in pixels (256-4096)
duration integer Yes - Video duration in seconds (1-60)
fps integer No 5 Frames per second (1-60)
highlight_color string No "#00f7ff" Color of the highlight box (hex)
text_color string No "#ffffff" Color of the text (hex)
background_color string No "#0a0a0a" Background color (hex)
background_style string No "solid" Background style ("solid", "newspaper", or "old_paper")
blur_type string No "radial" Type of blur ("gaussian" or "radial")
blur_radius float No 4.0 Blur effect radius
ai_enabled boolean No true Whether to use AI for text generation

Response

{
    "video_id": "550e8400-e29b-41d4-a716-446655440000",
    "status": "processing",
    "message": "Video generation started",
    "status_url": "http://video-gen.megavault.in/api/status/550e8400-e29b-41d4-a716-446655440000"
}

Check Status

GET http://video-gen.megavault.in/api/status/{video_id}

Response

{
    "status": "processing",
    "created_at": "2024-05-17T15:39:23.123456",
    "video_url": null,
    "error": null
}

Status Values

  • processing: Video is being generated
  • completed: Video is ready
  • failed: Generation failed

Get Video

GET http://video-gen.megavault.in/api/video/{video_id}

Response

{
    "status": "success",
    "video_id": "550e8400-e29b-41d4-a716-446655440000",
    "video_url": "http://video-gen.megavault.in/video/550e8400-e29b-41d4-a716-446655440000.mp4"
}

Error Responses

Rate Limit Exceeded

{
    "error": "Rate limit exceeded",
    "message": "Too many video generations. Please try again later."
}

Invalid Request

{
    "error": "Missing required field: highlighted_text"
}

Video Not Found

{
    "status": "error",
    "error": "Video not ready or not found"
}

Server Error

{
    "status": "error",
    "error": "Server error: [error message]"
}

Example Usage

cURL

# Generate video
curl -X POST http://video-gen.megavault.in/api/generate \
  -H "Content-Type: application/json" \
  -d '{
    "highlighted_text": "Hello World",
    "width": 1920,
    "height": 1080,
    "duration": 5
  }'

# Check status
curl http://video-gen.megavault.in/api/status/550e8400-e29b-41d4-a716-446655440000

# Get video
curl http://video-gen.megavault.in/api/video/550e8400-e29b-41d4-a716-446655440000

Python

import requests

# Generate video
response = requests.post('http://video-gen.megavault.in/api/generate', json={
    'highlighted_text': 'Hello World',
    'width': 1920,
    'height': 1080,
    'duration': 5
})
video_id = response.json()['video_id']

# Check status
status = requests.get(f'http://video-gen.megavault.in/api/status/{video_id}').json()

# Get video URL when ready
if status['status'] == 'completed':
    video = requests.get(f'http://video-gen.megavault.in/api/video/{video_id}').json()
    print(f"Video URL: {video['video_url']}")

Notes

  • Videos are automatically deleted after 1 day
  • Maximum video duration is 60 seconds
  • Maximum video dimensions are 4096x4096 pixels
  • Minimum video dimensions are 256x256 pixels
  • FPS must be between 1 and 60
  • Duration must be between 1 and 60 seconds
  • Video URLs are stored in Redis for 30 days
  • The API uses Redis for status tracking and URL storage
  • Failed video generations are automatically cleaned up
← Back to Home