Skip to main content

Installation

pip install decart-sdk
The Python SDK is currently in private beta. Contact us for early access.

Quick Start

The SDK is fully async and uses standard Python async/await patterns:

What can you build?

The SDK provides two main APIs for different use cases:

Client Setup

Both APIs share the same client initialization:
import os
from decart_sdk import create_decart_client

client = create_decart_client(
    api_key=os.getenv("DECART_API_KEY"),
    base_url="https://custom-endpoint.com",  # optional
)
Parameters:
  • api_key (required) - Your Decart API key from the platform
  • base_url (optional) - Custom API endpoint (defaults to Decart’s production API)

Available Models

Import models from the SDK to use with either API:
from decart_sdk import models

# Video models
models.video("lucy-pro-t2v")         # Text-to-video
models.video("lucy-pro-i2v")         # Image-to-video
models.video("lucy-dev-i2v")         # Image-to-video
models.video("lucy-pro-v2v")         # Video-to-video
models.video("lucy-dev-i2v")         # Video-to-video
models.video("lucy-pro-flf2v")       # First-last frame video

# Image models
models.image("lucy-pro-t2i")         # Text-to-image
models.image("lucy-pro-i2i")         # Image-to-image

# Realtime models
models.realtime("mirage")            # Realtime video transformation
models.realtime("lucy_v2v_720p_rt")  # Realtime video editing

Async/Await

All SDK methods are asynchronous and must be called with await. If you’re new to async Python:
  • Use async def for functions that call SDK methods
  • Call async functions with await
  • Run async code with asyncio.run(main())
  • For scripts or notebooks, you can use the sync wrapper pattern shown above

Type Hints Support

The SDK includes full type hints for better IDE support and type checking. Each model enforces its own required inputs, so you’ll get autocomplete and helpful errors if something is missing.
# Image-to-video requires 'data' field
await client.process({
    "model": models.video("lucy-pro-i2v"),
    "prompt": "Make it cinematic",
    "data": image_file,  # ✅ Required
})

# Text-to-video doesn't need 'data'
await client.process({
    "model": models.video("lucy-pro-t2v"),
    "prompt": "A cat walking",
    "data": image_file,  # ❌ Type error
})

Ready to start building?

I