Skip to content
Stable Diffusion API

API · 2026-05-07 · ModelsLab Team

LiteLLM + ModelsLab — Unified Video Generation API (2026)

How to route video generation requests through LiteLLM to ModelsLab and other providers via a single interface.

LiteLLM provides a unified interface for multiple LLM and AI providers. Combining it with ModelsLab’s video API gives you provider-agnostic video generation.

Setup

from litellm import completion
import os

os.environ["MODELSLAB_API_KEY"] = "..."

# Route a video request through LiteLLM
response = completion(
    model="modelslab/text-to-video",
    messages=[{"role": "user", "content": "an astronaut on the moon"}]
)

Why this matters

  • Switch providers without rewriting integration
  • Failover between providers
  • Cost optimization based on pricing