MythIQBETA

Command Palette

Search for a command to run...

Video API

Generate and manage videos using AI models through the MythIQ API.

Overview

The Video API allows you to generate videos using various AI models. You can create videos from text prompts, transform images into videos, or create variations of existing videos. The API handles the complexity of video generation and provides a simple interface for your applications.

AI-Powered Video Generation

Create dynamic videos from text prompts or transform static images into motion with MythIQ's video generation API, powered by state-of-the-art AI models.

Endpoints

Model-specific parameters

Each model may support additional parameters beyond those listed here. For model-specific parameters, please refer to the Models page and select the specific model you're interested in.

GET

/v1/media

List media items with filtering and pagination options.

Query Parameters

ParameterTypeDescription
limitintegerMaximum number of items to return (default: 25, max: 100)
pageintegerPage number for pagination (default: 0)
userstringFilter by user ID or 'me' for current user
mediastringSet to 'video' to filter for videos only
sizestringFilter by size (e.g., '1080p')
modelstringFilter by model ID or 'base/slug' format
providerstringFilter by provider ID or slug
searchstringSearch in prompt text
sortstringSort order: 'newest' (default) or 'oldest'

Response

json
{
  "result": {
    "total": 42,
    "medias": [
      {
        "id": "abc123",
        "url": "https://cdn.example.com/user/abc123/main.mp4",
        "mime": "video/mp4",
        "user": "user123",
        "media": "video",
        "model": "runway/gen-2",
        "provider": "runway",
        "prompt": "A camera flying through a dense forest with sunlight streaming through the trees",
        "size": "1080p",
        "duration": 6,
        "createdAt": "2025-03-25T12:00:00Z",
        "modelSlug": "runway/gen-2:1.0",
        "providerName": "Runway"
      },
      // More video items...
    ]
  },
  "success": true
}
POST

/v1/videos/generations

Generate videos using AI models.

Request Body

ParameterTypeDescription
modelstringRequired. Model ID or 'base/slug[:version]' format
promptstringRequired. Text prompt for video generation
sizestringVideo size (default: '1080p')
image_urlstringOptional. Source image URL for video generation
durationnumberDuration in seconds (default varies by model, typically 4-6 seconds)
providerstringOptional. Specific provider ID or slug
routingstringRouting strategy: 'optimal' (default), 'cheapest', or 'compatible'
publicbooleanWhether the generated media is public (default: true)

Response

json
{
  "data": [
    {
      "id": "abc123",
      "url": "https://cdn.example.com/user/abc123/main.mp4",
      "mime": "video/mp4",
      "user": "user123",
      "media": "video",
      "model": "runway/gen-2",
      "provider": "runway",
      "prompt": "A camera flying through a dense forest with sunlight streaming through the trees",
      "size": "1080p",
      "duration": 6,
      "createdAt": "2025-03-25T12:00:00Z"
    }
  ],
  "price": 0.05,
  "success": true,
  "stats": {
    "setupTime": 120,
    "processingTime": 350,
    "generationTime": 15000,
    "retries": 0,
    "providerId": "runway"
  }
}

Examples

Code Examples

Generating a Video from Text

typescript
import { fetch } from 'cross-fetch';

async function generateVideo() {
  const response = await fetch('https://api.mythiq.ai/v1/videos/generations', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': 'Bearer YOUR_API_KEY',
    },
    body: JSON.stringify({
      model: 'runway/gen-2',
      prompt: 'A camera flying through a dense forest with sunlight streaming through the trees',
      size: '1080p',
      duration: 6,
    }),
  });
  
  const data = await response.json();
  console.log(data);
}

Generating a Video from an Image

typescript
import { fetch } from 'cross-fetch';

async function generateVideoFromImage() {
  const response = await fetch('https://api.mythiq.ai/v1/videos/generations', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': 'Bearer YOUR_API_KEY',
    },
    body: JSON.stringify({
      model: 'runway/gen-2',
      prompt: 'Camera slowly zooming out to reveal the entire landscape',
      image_url: 'https://example.com/your-image.jpg',
      size: '1080p',
      duration: 4,
    }),
  });
  
  const data = await response.json();
  console.log(data);
}

Listing Your Videos

typescript
import { fetch } from 'cross-fetch';

async function listVideos() {
  const response = await fetch('https://api.mythiq.ai/v1/media?media=video&user=me&limit=10', {
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
    }
  });
  
  const data = await response.json();
  console.log(data.result.medias);
  console.log(`Total: ${data.result.total}`);
}

Supported Video Models

MythIQ supports various video generation models, each with different capabilities and characteristics. Here are some of the popular models available:

runway/gen-2

Runway's Gen-2 model for generating videos from text descriptions or image inputs.

Supported Sizes

1080p720p576p

Special Parameters

ParameterTypeDescription
image_urlstringURL of an image to use as the starting point (optional)
durationnumberDuration in seconds (2-8, default: 4)

pika/1

Pika Labs' model for generating high-quality videos with detailed motion.

Supported Sizes

1080p720p

Special Parameters

ParameterTypeDescription
image_urlstringURL of an image to use as the starting point (optional)
durationnumberDuration in seconds (3-10, default: 6)
stylestringVisual style (e.g., "cinematic", "anime", "3d")

For a complete and up-to-date list of available video models, please refer to the Models page.

Video Processing

When you generate a video through the API, it goes through several processing steps:

  1. Generation: The AI model creates the video based on your prompt and parameters. This can take anywhere from a few seconds to several minutes depending on the model and complexity.
  2. Transcoding: The generated video is transcoded into multiple formats for optimal playback across different devices and browsers.
  3. Thumbnail Creation: Thumbnails are automatically generated for the video to use in listings and previews.
  4. Storage: The video and its variants are stored in the MythIQ storage system and made available through the CDN.

The API response includes the URL of the processed video, which you can use to display or download the video in your application.

API Video Tutorials