POST https://api.kodisc.com/render/video

Body

Required

  • apiKey (string): API key generated via the Kodisc Dev dashboard.
  • code (string): Code used to generate the video.
  • className (string): Class to render within the code.

Optional

  • quality (string): Quality to render the video at. It can be one of the following qualities:
    • “low” (480p15, 15 fps)
    • “medium” (720p30, 30 fps)
    • “high” (1080p30, 30 fps)
    • “twok” (1440p30, 30 fps)
    • “fourk” (2160p30, 30 fps)

Body must be FormData in order to work.

Response

  • success (boolean): Whether the request succeeded or not. It can fail due to multiple factors including invalid API key, insufficient credits, failed video rendering (will charge API key for a failed request)
  • error (string?): Error message if success is false.
  • video (string?): If the request succeeded, this is the URL of the generated video on Kodisc’s CDN.
  • thumbnail (string?): If the request succeeded, this is the URL of the generated thumbnail on Kodisc’s CDN.

Example

TypeScript
const code = `
from manim import *

class ManimScene(Scene):
    def construct(self):
        self.wait(3)
`;

const body = new FormData();
body.append("apiKey", "kodisc_xxxx");
body.append("code", code);
body.append("className", "ManimScene");
body.append("quality", "medium");

const response = await fetch("https://api.kodisc.com/render/video", {
    method: "POST",
    body
});
const json = (await response.json()) as {
    success: boolean;
    error?: string;
    video?: string;
    thumbnail?: string;
};