Skip to main content

Python SDK for ManimStudio — render Manim animations via API

Project description

manimstudio

Python SDK for ManimStudio — render Manim animations via API, no local Manim install required.

Installation

pip install manim-studio-sdk

No external dependencies — the SDK is stdlib-only (urllib, json).

Requires Python 3.8+.

Getting an API key

Create an API key from your dashboard: https://manimstudio.me/dashboard

Quick start

from manimstudio import ManimStudio

client = ManimStudio(api_key="msk_xxx")

code = """
from manim import *

class Hello(Scene):
    def construct(self):
        self.play(Write(Text("Hello, ManimStudio!")))
"""

job = client.render(code, quality="medium")
job.wait()
job.download("hello.mp4")

print(f"Saved to hello.mp4 — {job.url}")

Client

ManimStudio(api_key, base_url="https://manimstudio.me", timeout=30.0)

from manimstudio import ManimStudio

client = ManimStudio(api_key="msk_xxx")

# Point at a self-hosted instance or local dev server:
client = ManimStudio(api_key="msk_xxx", base_url="http://localhost:8000")

Raises ValueError if api_key is empty.

client.render(code, quality="medium", scene=None, asset_keys=None)

Submit a Manim scene for rendering. Returns a RenderJob immediately — the render happens asynchronously.

job = client.render(
    code=my_scene_code,
    quality="high",        # "low" (480p), "medium" (720p), or "high" (1080p)
    scene="MyScene",       # optional: render one specific Scene class; omit to render all
    asset_keys=["assets/u1/logo.png"],  # optional: pre-uploaded asset keys referenced by the scene
)

client.get_usage()

Get current quota usage for your account.

usage = client.get_usage()
print(usage["tier"], usage["renders"])

RenderJob

Returned by client.render(). Represents an in-progress or completed render.

job.wait(poll_interval=2.0, timeout=1800.0)

Blocks until the job finishes, polling every poll_interval seconds. Raises RenderError if the render fails, or RenderTimeoutError if timeout seconds pass first.

job = client.render(code)
job.wait(poll_interval=1.0, timeout=300.0)

job.poll()

Fetch the job's current status once, without blocking. Returns a RenderResult.

result = job.poll()
print(result.status)  # "queued" | "running" | "done" | "error"

job.status

The job's last-known status ("queued" until you poll() or wait()).

job.url

The primary output URL, once the job is done (relative /api/media/... paths are resolved against the client's base_url).

job.output_urls

All output URLs, for multi-scene jobs.

job.logs

Render logs, once available.

job.download(path, scene_index=0)

Download a finished render to a local file. Raises RenderError if the job isn't done yet — call wait() first.

job.wait()
job.download("scene_0.mp4")           # first/only scene
job.download("scene_1.mp4", scene_index=1)  # second scene, for multi-scene jobs

Error handling

All SDK errors subclass ManimStudioError.

from manimstudio import (
    ManimStudio,
    ManimStudioError,
    AuthenticationError,
    QuotaExceededError,
    QualityNotAvailableError,
    RenderError,
    RenderTimeoutError,
    APIError,
)

client = ManimStudio(api_key="msk_xxx")

try:
    job = client.render(code, quality="high")
    job.wait()
    job.download("output.mp4")
except AuthenticationError:
    # API key is missing, invalid, or revoked.
    # Get/rotate your key at https://manimstudio.me/dashboard
    ...
except QuotaExceededError as e:
    # Render limit reached for your plan.
    print(f"Used {e.used}/{e.limit}, resets in {e.resets_in}s")
except QualityNotAvailableError:
    # Requested quality tier isn't available on your plan.
    ...
except RenderTimeoutError:
    # wait() gave up before the render finished — it may still complete;
    # poll the job again later.
    ...
except RenderError as e:
    # The render itself failed (bad scene code, runtime error, etc).
    print(e)
    print(e.logs)
except APIError as e:
    # Any other non-2xx response from the API.
    print(e.status_code, e)
except ManimStudioError:
    # Catch-all for any SDK error.
    ...
Exception Raised when
AuthenticationError API key missing, invalid, or revoked (HTTP 401)
QuotaExceededError Render limit reached for your plan (HTTP 429). Has .limit, .used, .resets_in
QualityNotAvailableError Requested quality isn't available on your plan (HTTP 403)
RenderTimeoutError job.wait() exceeded its timeout before the job finished
RenderError The render job itself failed. Has .logs
APIError Any other non-2xx API response. Has .status_code

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

manim_studio_sdk-0.1.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

manim_studio_sdk-0.1.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file manim_studio_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: manim_studio_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for manim_studio_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 53a1e7f1be966564dd7a65f73454016c66916d2491e2b7e9a9d91038e4ea0b9b
MD5 a47efd51183f80b147fb669fb4375b30
BLAKE2b-256 a6eb53b876a0de8839de677c74f34130b74ae5c6af0da08535ce285b001d0f4c

See more details on using hashes here.

File details

Details for the file manim_studio_sdk-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for manim_studio_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e30bc1c1a59ae9ad5c05825d69f3b578de57e2895f93004a646e9ff273d39514
MD5 ec6b8b96d50d8437bbdc431e79c92b34
BLAKE2b-256 3848da192e03913aafb3418210a78a15a9fa79276512ddf3e1744b2b841c9621

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page