POST /api/generate
Submits a new video generation job to the queue. The job will be processed asynchronously by the worker process.Request Body
The subject or topic of the video. This is used to generate the script and search for relevant footage.Example:
"The history of artificial intelligence"The TikTok voice to use for narration. Available voices depend on the TikTok TTS API.Common options:
en_us_001- US English (Female)en_us_002- US English (Male)en_us_006- US English (Male, Deep)en_us_007- US English (Female, Upbeat)
Number of paragraphs to generate in the script. More paragraphs result in longer videos.Typical range: 1-5
Optional custom prompt to guide script generation. If provided, this overrides the default script generation logic.Example:
"Create a dramatic script about Mars colonization"The Ollama model to use for script generation. If not specified, uses the default model from
/api/models.Example: "llama3.1:8b"Number of threads to use for video processing. Higher values may speed up rendering but use more CPU.
Vertical position of subtitles in the video.Options:
topcenterbottom
Color of subtitle text.Common options:
white, yellow, red, green, blueWhether to add background music to the video. Music files must be uploaded via
/api/upload-songs first.Whether to automatically upload the generated video to YouTube after completion.Requires YouTube API credentials to be configured.
Response
Always
"success" for successful job submission.Human-readable message:
"Video generation queued."Unique identifier for the generation job. Use this to poll job status and retrieve events.Format: UUID v4 (e.g.,
"a1b2c3d4-e5f6-7890-abcd-ef1234567890")Example Request
Example Response
Error Responses
Missing Required Field
400 Bad Request
Next Steps
After submitting a generation job:- Use the returned
jobIdto poll job status: GET /api/jobs/:id - Stream real-time progress events: GET /api/jobs/:id/events
- Cancel the job if needed: POST /api/jobs/:id/cancel