Run this single command to generate a video using our sample assets. Replace YOUR_API_KEY with your key.Here’s what you’ll be working with:
Source Video
Alpha Video
Reference Image
Output
curl -X POST https://api.beeble.ai/v1/switchx/generations \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "generation_type": "video", "source_uri": "https://cdn.beeble.ai/public/developer-api/source.mp4", "reference_image_uri": "https://cdn.beeble.ai/public/developer-api/reference.png", "alpha_uri": "https://cdn.beeble.ai/public/developer-api/alpha.mp4", "alpha_mode": "custom", "max_resolution": 720, "prompt": "Video depicts a young woman with long red hair and freckles, smiling and gently looking to her right, as she walks through the sun-dappled courtyard of a traditional Korean palace." }'
Poll the job status until it completes, then download the result.
# Check status (repeat until "completed")# Replace YOUR_GENERATION_ID with the "id" from the response abovecurl https://api.beeble.ai/v1/switchx/generations/YOUR_GENERATION_ID \ -H "x-api-key: YOUR_API_KEY"# Download the result# Replace with the "render" URL from the completed responsecurl -o output.mp4 "RENDER_URL_FROM_OUTPUT"
A single copy-paste script that creates a generation, polls until complete, and downloads the result.
"""Beeble SwitchX API — Complete ExampleInstall: pip install requestsUsage: python beeble_quickstart.py"""import timeimport requestsAPI_KEY = "YOUR_API_KEY"BASE_URL = "https://api.beeble.ai/v1"HEADERS = {"x-api-key": API_KEY, "Content-Type": "application/json"}# 1. Start generation using sample assetsprint("Starting generation...")response = requests.post( f"{BASE_URL}/switchx/generations", headers=HEADERS, json={ "generation_type": "video", "source_uri": "https://cdn.beeble.ai/public/developer-api/source.mp4", "reference_image_uri": "https://cdn.beeble.ai/public/developer-api/reference.png", "alpha_uri": "https://cdn.beeble.ai/public/developer-api/alpha.mp4", "alpha_mode": "custom", "max_resolution": 720, "prompt": "Video depicts a young woman with long red hair and freckles, " "smiling and gently looking to her right, as she walks through " "the sun-dappled courtyard of a traditional Korean palace.", },)response.raise_for_status()job = response.json()job_id = job["id"]print(f"Job created: {job_id} (status: {job['status']})")# 2. Poll until completewhile True: result = requests.get( f"{BASE_URL}/switchx/generations/{job_id}", headers={"x-api-key": API_KEY}, ).json() status = result["status"] progress = result.get("progress", 0) print(f" Status: {status} ({progress}%)") if status == "completed": break if status == "failed": raise Exception(f"Job failed: {result.get('error')}") time.sleep(5)# 3. Download resultrender_url = result["output"]["render"]print(f"Downloading result...")with open("output.mp4", "wb") as f: f.write(requests.get(render_url).content)print("Saved to output.mp4")