Skip to main content

Overview

The Prism API generates high-quality videos with rich animations and visual effects. This endpoint prioritizes quality over speed, making it ideal for advanced visuals that teach better and presentations.
Prism videos take longer to generate but offer superior visual quality with advanced animations and effects.

WebSocket Endpoint

wss://50fa8sjxo9.execute-api.us-west-2.amazonaws.com/production

Authentication

Include your API key in the WebSocket payload:
{
  "api_key": "YOUR_API_KEY"
}

Request Parameters

action
string
required
Must be set to "Pre-Rendered"
task
string
required
The content or topic for your video (e.g., “explain machine learning”)
api_key
string
required
Your Knowlify API key for authentication
quality
string
default:"high"
Video quality setting. Options: "low", "medium", "high", "production". Higher quality takes longer to generate.

Code Examples

import asyncio
import websockets
import json

task = r'''
explain machine learning
'''

async def send_request(task):
    print("Sending request...")
    uri = "wss://50fa8sjxo9.execute-api.us-west-2.amazonaws.com/production"

    async with websockets.connect(uri) as websocket:
        payload = {
            "action": "Pre-Rendered",
            "task": task,
            "api_key": "YOUR_API_KEY"
        }
        await websocket.send(json.dumps(payload))

        while True:
            try:
                response = await websocket.recv()
                print("Received response:", response)
            except websockets.exceptions.ConnectionClosed:
                print("Connection closed by the server.")
                break

if __name__ == "__main__":
    asyncio.run(send_request(task))

WebSocket Responses

The WebSocket connection will send real-time updates throughout the video generation process:

Progress Updates

{
  "type": "progress",
  "message": "Rendering high-quality video with animations...",
  "progress": 45
}

Completion Response

{
  "video_link": "https://knowlify-videos1.s3.us-west-2.amazonaws.com/video.mp4",
  "vtt_file": "https://knowlify-videos1.s3.us-west-2.amazonaws.com/subtitles.vtt",
  "status": "completed"
}

Error Response

{
  "type": "error", 
  "message": "Invalid API key",
  "error_code": "AUTH_FAILED"
}

Response Fields

Download URL for the generated video
vtt_file
string
URL for the WebVTT subtitle file with synchronized captions
status
string
Generation status: completed, failed
progress
number
Generation progress as percentage (0-100) - only in progress messages
Prism videos typically take 5-8 minutes to generate depending on length and complexity.