Skip to main content
Splyce is configured entirely through environment variables. Create a .env file at the project root and set the variables you need. The server reads this file on startup.

Required

VariableDescription
GEMINI_API_KEYGoogle AI API key. Get one from Google AI Studio.

AI models

VariableDefaultDescription
GEMINI_TEXT_MODELgemini-2.0-flashGemini model used for product identification.
GEMINI_VIDEO_ANALYSIS_MODELgemini-2.0-flashGemini model used for video scene analysis.
GEMINI_IMAGE_MODELSgemini-3.1-flash-image-preview,gemini-2.5-flash-imageComma-separated list of Gemini image models tried in order when editing frames. Splyce falls back to the next model if one fails.

Voiceover

VariableDefaultDescription
ELEVENLABS_API_KEYElevenLabs API key. Required for TTS and voice cloning. Omit if using ALLOW_SILENT_VOICEOVER=1.
ELEVENLABS_VOICE_ID21m00Tcm4TlvDq8ikWAMDefault ElevenLabs voice ID used when voice cloning is unavailable or fails.
VOICE_REFERENCE_PATHwolf_voice.mp4 (project root)Path to the audio or video file used as the voice cloning reference. See Voice cloning.
ALLOW_SILENT_VOICEOVERSet to 1, true, or yes to insert a silent audio track instead of generating voiceover. Useful for testing without an ElevenLabs key.

Video processing

VariableDefaultDescription
MAX_VIDEO_UPLOAD_MB200Maximum allowed video upload size in megabytes.
AD_SEGMENT_SECONDS3Duration in seconds of the ad segment spliced into the clip.
AD_FRAME_OFFSET_RATIO0.2Fraction into the ad window where the key frame is extracted. At the default of 0.2, the frame is taken 0.6 s into a 3-second segment.
VIDEO_CACHE_MAX_AGE_S1800How long (in seconds) an uploaded video is cached before being deleted. Defaults to 30 minutes. After expiry you must re-upload the clip.

Server

VariableDefaultDescription
PORT8000Port the Uvicorn server listens on.

Sample .env file

# Required
GEMINI_API_KEY=your_key_here

# Optional: voiceover
ELEVENLABS_API_KEY=your_key_here

# Optional: model overrides
# GEMINI_TEXT_MODEL=gemini-2.0-flash
# GEMINI_VIDEO_ANALYSIS_MODEL=gemini-2.0-flash

# Optional: allow video generation without voiceover
# ALLOW_SILENT_VOICEOVER=1

Build docs developers (and LLMs) love