API Documentation
The VidMachine REST API lets you create and manage projects, generate video ideas, and produce AI videos from your own applications. Use it to automate video creation for YouTube Shorts and TikTok, build custom content pipelines, or integrate VidMachine into existing tools. All requests require authentication via an API key. Create and manage keys in your account under API & MCP (after login). Prefer an assistant? The same key works with the MCP server for Claude Code, Codex, Cursor, OpenCode, Hermes, and other MCP clients.
Authentication
Send your API key using either the
Authorization header or X-API-Key:Authorization: Bearer vidm_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # or X-API-Key: vidm_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Do not commit keys to version control. Rotate keys by revoking and creating a new one in the dashboard.
Base URL
https://vidmachine.ai/api/v1 (replace with your actual app URL in production).Endpoints
GET /projects
List all projects for the account. Returns an array of project objects (id, title, description, type, target_video_duration, video_model_priority, influencer_video_model_priority, image_model_priority, etc.).
curl -X GET "https://vidmachine.ai/api/v1/projects" \ -H "Authorization: Bearer YOUR_API_KEY"
POST /projects
Create a project. Body:
title (required), plus optional description, content_types (array of one or more: ai_video, ai_images, stock_video, ai_influencer, web_page, web_image, code_animation, uploaded_media — the AI mixes segment types per video) or legacy type (single value), target_video_duration, post_format (video or slideshow; slideshow is only valid when content_types is exclusively ai_images, web_image, and/or uploaded_media (uploaded videos are ignored; only image uploads become slides) — TikTok gets a native photo carousel with auto-added music, YouTube gets a rendered slideshow video), target_slides (2–10, default 5; slideshows only), video_model_priority (array of 1–3 model IDs for ai_video segments — excludes Kling Avatar V2, P-Video Avatar, and P-Video 2 Pro Avatar; includes p-video-2-pro-480p at 2 credits/s and p-video-2-pro at 5 credits/s), influencer_video_model_priority (array of 1–3 lip-sync model IDs for ai_influencer segments: p-video-2-pro-avatar-480p, p-video-2-pro-avatar, hailuo-3-480p, hailuo-3, heygen-video, seedance-2-0, seedance-2-0-720p, seedance-2-0-mini, seedance-2-0-mini-720p, seedance-2-5-480p, seedance-2-5, wan-2-7-i2v, p-video-avatar, kling-avatar-v2 — MiniMax H3 lip-sync uses an audio (URL) field with a reference image (480p at 3 credits/s, 768p at 5 credits/s); HeyGen Video lip-sync uses reference audio and the spoken line in the prompt, always at 768p for 4 credits per second; Kling Avatar V2 uses standard mode only, uses each scene's generated starting frame plus scene audio, and bills at 11 credits per second of scene video duration; P-Video 2 Pro Avatar uses each scene's starting frame plus scene audio and bills at 4 credits per second at 480p or 8 credits per second at 768p; P-Video Avatar remains accepted for existing projects at 720p and 5 credits per second; legacy AI Influencer-only projects may still send video_model_priority instead), image_model_priority (ordered list of image model IDs for stills and start frames on ai_video and ai_images—omit or use [] for stock_video / web_image; cover images always use Muse Image regardless of project type; see AI models), caption_preset, caption_max_words (1–5 words shown per caption on screen; default 3), video_text_mode ('none', 'highlights', or 'captions'; default 'captions' — for slideshows, 'none' disables slide text), editing_mode ('standard' or 'dynamic'; default 'standard' — dynamic authors designed chapters and adds 1 credit per 10 seconds on successful export), editing_preset (design preset for dynamic mode: 'modern', 'editorial', 'bold', 'clean', or 'cinema'; default 'modern'), design_tokens (optional object; custom theme tokens for dynamic mode — omit to use the selected preset, pass null to reset), use_narrator (boolean, default true on create; always true for AI Influencer, always false for slideshows), elevenlabs_voice_id, music_enabled (boolean; defaults to true for slideshow projects and false for video projects — set false to render a slideshow silently; TikTok photo posts ignore this and use TikTok's recommended music), song_id (custom background track ID from your song library; omit for automatic selection, null clears it), influencer_mode (scenes, overlay, or mixed — how the AI Influencer presenter is used; overlay and mixed require a target_video_duration of at least 30 seconds and at least one other content type, and bill the circle overlay at 1 credit/s of overlay time), auto_generate, post_on_weekdays, post_at_time, timezone, generate_days_ahead, youtube_social_account_id, tiktok_social_account_id, instagram_social_account_id, tiktok_publish_defaults (object: TikTok Direct Post defaults for scheduled publishing—privacy, caption, interactions, commercial disclosure, consent; validated like the dashboard), ai_disclosure_enabled (boolean, default false — labels videos as AI-generated on YouTube, TikTok, and Instagram; set true to add the AI disclosure), generate_cover_photo. ai_influencer requires use_narrator=true, elevenlabs_voice_id, and a portrait image_url on the project (upload via dashboard after create). The presenter is generated from that reference image. Same validation as the dashboard.curl -X POST "https://vidmachine.ai/api/v1/projects" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title":"My Channel","video_model_priority":["veo-3-1"]}'PATCH /projects/:projectId
Update a project. Body: any subset of project fields (all optional), including
tiktok_publish_defaults or null to clear. music_enabled (defaults to true for slideshows, false for videos) and song_id (custom library track; omit for automatic, null clears it) work as on create — TikTok photo posts use TikTok's recommended music instead. Set generate_cover_photo to true to generate thumbnails for this project's videos — it is false on new projects, which is why scheduled and one-shot videos arrive without a cover. Projects connected to TikTok must keep valid defaults (privacy_level and consent_music: true); switching the TikTok account clears them. Returns the updated project.curl -X PATCH "https://vidmachine.ai/api/v1/projects/PROJECT_UUID" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title":"Updated title"}'POST /ideas/generate
Generate 10 video ideas for a project. Body:
project_id (required). Returns the created ideas. Uses credits.curl -X POST "https://vidmachine.ai/api/v1/ideas/generate" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"project_id":"PROJECT_UUID"}'POST /videos/generate
Generate a full video from a video idea. Body:
idea_id (required). Builds the script, scenes, media, and finished video, then returns the updated video. Uses credits.curl -X POST "https://vidmachine.ai/api/v1/videos/generate" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"idea_id":"IDEA_UUID"}'POST /videos
Create a standalone video draft from a prompt. Body:
prompt (required, 10–2000 characters), plus optional video_orientation (portrait or landscape, default portrait), target_video_duration (seconds; 10–120 for portrait, 10–900 for landscape, default 30), content_types (array of ai_video, ai_images, stock_video, ai_influencer, web_page, web_image, code_animation — uploaded_media is not available for standalone videos, and ai_influencer additionally requires a reference image, which this endpoint does not accept), narrator_voice (ElevenLabs voice ID), video_model_priority, image_model_priority, and influencer_video_model_priority. Returns 201 with ideaId, projectId, title, and started: false. Creating the draft does not use credits and does not start generation; call POST /videos/generate with the returned ideaId to run the pipeline.curl -X POST "https://vidmachine.ai/api/v1/videos" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt":"A 30-second video about the history of coffee","target_video_duration":30}'GET /videos
List videos. Query params:
project_id, status (idea, one_shot, processing, draft, queue, upcoming, published, error, archive), limit, offset. Without status, archived videos are omitted; include archive in status to list them. Returns an array of video objects with project and account info. Status one_shot (queued in dashboard) and processing are system-assigned during generation and cannot be set manually via the API.curl -X GET "https://vidmachine.ai/api/v1/videos?project_id=UUID&status=draft&limit=10" \ -H "Authorization: Bearer YOUR_API_KEY"
GET /videos/:videoId
Fetch one video with its status, progress, final video URL, project and connected accounts, publish IDs, and credits used. Use this to poll a one-shot generation without downloading the whole list.
curl -X GET "https://vidmachine.ai/api/v1/videos/VIDEO_UUID" \ -H "Authorization: Bearer YOUR_API_KEY"
GET /videos/:videoId/content
Read what a video actually contains before editing it. Returns the script (
full_idea, transcript, narrator_audio_url, narrator_audio_duration), the screenplay scene array, the cover (cover_photo_prompt, cover_photo_url), and the final_video_url, plus an asset-derived pipeline_state and next_step — the first missing step in the canonical order: transcript, narrator_audio, screenplay, scene_media, cover, export, then complete. next_step is wait while a generation is running (edits are locked), and draft when the video does not exist yet. Narrated projects only: when the project's use_narrator is false (and for slideshows) the transcript and narrator-audio steps are skipped, because the screenplay step writes the script. pipeline_state includes status, uses_narrator, has_transcript, has_narrator_audio, narrator_audio_stale, has_screenplay, scene_count, scenes_with_media, first_incomplete_scene, has_cover, and has_final_video. Query param include trims the response to a comma-separated subset of script, scenes, cover, and pipeline (repeatable; default all). Read-only.narrator_audio_stale means the saved voice-over no longer matches the script: every narrator render stores a sha256 of the transcript it was generated from, and the flag is true only when that hash differs from the current transcript (whitespace-only edits do not count). It is false when no narrator audio exists yet; rows generated before the hash existed cannot be verified, so any existing audio on them is reported as stale.curl -X GET "https://vidmachine.ai/api/v1/videos/VIDEO_UUID/content" \ -H "Authorization: Bearer YOUR_API_KEY"
GET /videos/:videoId/estimate
Quote the credits still needed to finish a video. Read-only: nothing is generated and no credits are charged. Steps come from the same asset-derived pipeline state as
GET /videos/:videoId/content, so only the missing stages are priced — a draft that already has a transcript and narrator audio is quoted for the screenplay, scene media, cover, and render only, and a finished video returns steps: [] with total: 0. Returns id, balance (the account's current credit balance), steps (an ordered array of { step, credits } using the canonical step names, with zero-cost steps omitted), total, next_step, narrator_audio_stale, and pipeline_state. next_step is the same value the content endpoint returns (wait while a generation is running and edits are locked, complete when every asset exists). Scene media is priced per incomplete scene from its content_type and plan_duration; before a screenplay exists it falls back to the project's content types over the target duration. The render step includes caption, dynamic-editing, and element surcharges when the project uses them. A stale voice-over is not part of the total (it is not a missing stage), so quote narrator_audio separately when narrator_audio_stale is true.curl -X GET "https://vidmachine.ai/api/v1/videos/VIDEO_UUID/estimate" \ -H "Authorization: Bearer YOUR_API_KEY"
PATCH /videos/:videoId
Edit a video. Body:
title, status (archive, draft, upcoming, queue), post_time (ISO string, only when status is upcoming), cover_photo_prompt, cover_photo_url. Same rules as the dashboard: you cannot change status from "idea" or "published"; you cannot set or change status while the video is "one_shot" or "processing" (system-assigned during generation); upcoming/queue require a final video URL; post_time only applies when status is upcoming.curl -X PATCH "https://vidmachine.ai/api/v1/videos/VIDEO_UUID" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title":"New title","status":"upcoming","post_time":"2025-03-01T14:00:00.000Z"}'PATCH /videos/:videoId/transcript
Save the narration transcript. Body:
transcript (required, non-empty string; trimmed before saving). Free: no credits are charged, so this is the path for text you wrote yourself. Returns transcript, transcript_word_count, narrator_audio_stale, pipeline_state, and next_step. narrator_audio_stale is true when the saved narrator audio was rendered from a different transcript (each render stores a hash of the script it used), so render it again with POST /videos/:videoId/narrator-audio before generating the screenplay; it is false when no audio exists yet. Rows whose audio predates the hash are treated as stale, because the mismatch cannot be ruled out. Returns 409 when the video is processing or one_shot (edits are locked), 403 for another account's video, and 404 when the video does not exist.curl -X PATCH "https://vidmachine.ai/api/v1/videos/VIDEO_UUID/transcript" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"transcript":"Most people get their morning coffee wrong. Here is the fix."}'POST /videos/:videoId/transcript/generate
Write the transcript with the LLM from the video's brief (
full_idea) and project settings. No body. Uses credits. Returns transcript, transcript_word_count, narrator_audio_stale, pipeline_state, and next_step; for a narrated project the next step is narrator_audio.curl -X POST "https://vidmachine.ai/api/v1/videos/VIDEO_UUID/transcript/generate" \ -H "Authorization: Bearer YOUR_API_KEY"
POST /videos/:videoId/narrator-audio
Render the narrator voice-over from the saved transcript. Body: optional
voice_id (defaults to the project's configured voice). Uses credits, scaled by character count. Returns narrator_audio_url, narrator_audio_duration, pipeline_state, and next_step. Requires a transcript (400 otherwise). For narrated projects this must run before the screenplay, because scene timing is derived from word-level TTS timings. Each render also stores a hash of the transcript it used, so narrator_audio_stale turns false for the current script.curl -X POST "https://vidmachine.ai/api/v1/videos/VIDEO_UUID/narrator-audio" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"voice_id":"VOICE_ID"}'POST /videos/:videoId/screenplay
Generate the screenplay (the scene list) with the LLM from the video's brief and narrator timings. No body. Uses credits. For narrated projects the transcript and narrator audio must already exist (
400 otherwise): call POST /videos/:videoId/narrator-audio first, because scene timing is derived from word-level TTS timings. Returns screenplay, scene_count, pipeline_state, and next_step. For a single-scene tweak use PATCH /videos/:videoId/scenes/:sceneNumber; for a full rewrite use PUT /videos/:videoId/screenplay.curl -X POST "https://vidmachine.ai/api/v1/videos/VIDEO_UUID/screenplay" \ -H "Authorization: Bearer YOUR_API_KEY"
PUT /videos/:videoId/screenplay
Replace the whole screenplay. Body:
scenes (required, non-empty array of scene objects). Free: no credits. This is the bulk path for rewrites that change the scene count or order (for example "make it 5 scenes"); every scene is validated exactly like the dashboard (timeline, word spans, duration caps), and one invalid scene rejects the whole call with 400. Returns screenplay, scene_count, pipeline_state, and next_step. Returns 409 when the video is processing or one_shot (edits are locked), 403 for another account's video, and 404 when the video does not exist. When narrator audio is missing, the error names generate_narrator_audio.curl -X PUT "https://vidmachine.ai/api/v1/videos/VIDEO_UUID/screenplay" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"scenes":[{"scene_number":1,"content_type":"ai_video","plan_duration":5,"speech_start_word":0,"video_prompt":"A wide shot of a coffee cup","starting_frame_prompt":"A wide shot of a coffee cup"}]}'PATCH /videos/:videoId/scenes/:sceneNumber
Edit one scene.
sceneNumber is 1-based and must match the scene's scene_number. Body: any subset of the allowlisted fields — image_prompt, video_prompt, starting_frame_prompt, plan_duration (positive number of seconds), highlight_text, slide_text, and transition (also accepted as next_transition_type; one of cut, continuous, montage). Pass null or an empty string to clear a text field. Free: no credits.Only those fields can be changed: timing (
speech_start_word, speech_words, …) and media (image_url, video_url, starting_frame_url) fields are rejected so the timeline and render stay consistent. An unknown field returns 400 with the allowed list: { "error": "Unknown scene field(s): video_url. Allowed: image_prompt, video_prompt, starting_frame_prompt, plan_duration, highlight_text, slide_text, next_transition_type, transition" }. An empty patch returns 400, a missing scene returns 404, and a video with no screenplay returns 400 telling you to generate one first. The scene is saved through the same validation as the dashboard. The response returns scene, applied_fields, media_unchanged: true, a notice that the existing media still reflects the old prompt, plus pipeline_state and next_step — regenerate the scene media to pick up a new prompt.curl -X PATCH "https://vidmachine.ai/api/v1/videos/VIDEO_UUID/scenes/2" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"video_prompt":"A slow pan across the cup","plan_duration":6,"transition":"continuous"}'POST /videos/:videoId/scenes/:sceneNumber/media
Generate the media for one scene.
sceneNumber is 1-based and must match the scene's scene_number. Body: kind (required — one of image, video, start_frame) and optional model (a real model ID for that kind: image models for image and start_frame, video models for video; GET /models lists them, and an unknown ID returns 400 instead of silently rendering with a different model).image— the scene still (AI Images).start_frame— the first frame image-to-video models animate.video— the clip itself; most video models need the scene's start frame to exist first (400otherwise).
Paid: stills and start frames bill one image generation, clips bill by generated clip length. The call runs inline, exactly like the dashboard's per-scene button — a clip can take minutes and the request returns when the media exists. There is no job ID and no polling endpoint for this path. The new URL is written onto the scene and the previous one is kept in its history array. Returns the action's data (updated
screenplay, asset) plus scene, kind, model, pipeline_state, and next_step. Returns 404 for an unknown scene number or a video with no screenplay, 409 while the video is processing or one_shot (the pipeline is writing the same scenes), 402 when the credit preflight fails, and 400 when the scene lacks the prompt that kind needs.curl -X POST "https://vidmachine.ai/api/v1/videos/VIDEO_UUID/scenes/2/media" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"kind":"start_frame"}'POST /videos/:videoId/cover/prompt
Write the thumbnail prompt with the LLM from the video's title, brief, and first scenes, and save it to
cover_photo_prompt. Body: optional instructions (extra direction for the writer, e.g. "close-up on the speaker, no text overlay"). Cheap LLM step: no image is rendered. Returns cover_photo_prompt, cover_photo_url, pipeline_state, and next_step. Returns 409 while the video is processing or one_shot. Follow it with POST /videos/:videoId/cover to render the image.curl -X POST "https://vidmachine.ai/api/v1/videos/VIDEO_UUID/cover/prompt" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"instructions":"close-up on the speaker, no text overlay"}'POST /videos/:videoId/cover
Render the video's thumbnail image. Body: optional
prompt (saved to cover_photo_prompt first, so the rendered image and the stored prompt agree; an empty string returns 400 — omit it to reuse the saved prompt, or clear it with PATCH /videos/:videoId), optional image_model (image model ID; default Muse Image), and optional force (boolean). Paid: one image generation.force is required when the project has cover generation disabled. The project setting generate_cover_photo defaults to false, and the shared generator refuses to run while it is off, so a fresh one-off draft returns 409 telling you to pass force: true. force applies to that request only: it never writes the project setting. Returns cover_photo_url, cover_photo_prompt, all_cover_photo_urls, model, forced, pipeline_state, and next_step. Returns 409 while the video is processing or one_shot, 402 when credits are short.curl -X POST "https://vidmachine.ai/api/v1/videos/VIDEO_UUID/cover" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"force":true}'POST /videos/:videoId/export
Assemble the final video from the media that already exists (scene clips and stills, narrator audio, captions, cover) and start the render workflow. No body. Asynchronous: returns immediately with
status: "processing"; poll GET /videos/:videoId until final_video_url appears. It does not generate missing scene media — use POST /videos/:videoId/scenes/:sceneNumber/media for a gap, or POST /videos/generate to fill every gap and render in one job. Calling it while a render is already running is a success, not a conflict: the response is { "status": "processing", "alreadyRunning": true } and no second render starts. Requires a screenplay (400 otherwise), and returns 409 while the video is queued (one_shot) or already generating.curl -X POST "https://vidmachine.ai/api/v1/videos/VIDEO_UUID/export" \ -H "Authorization: Bearer YOUR_API_KEY"
GET /models
Catalog of every image and video model you can call, including the exact
inputs each model accepts, its capabilities, and credit pricing. Every video model returns a clip with audio (generates_audio); supports_audio_input and requires_audio_input describe the optional or required audio_url lip-sync input, so supports_audio_input: false does not mean the model produces silent video. Use the returned model IDs with POST /generations.curl -X GET "https://vidmachine.ai/api/v1/models" \ -H "Authorization: Bearer YOUR_API_KEY"
POST /generations
Queue any catalog model. Body:
model (required) and inputs (required object matching that model's inputs from GET /models). Text inputs are prompts; media inputs are public URLs: image_url (start frame or portrait), last_frame_url, audio_url (lip-sync), and reference_images (array of URLs). Returns 202 with the queued generation and a status_url; generation runs asynchronously. Credits are charged only when the model succeeds, and failed generations are free. Up to 10 queued or processing generations per account at a time (further calls return 429).# Image
curl -X POST "https://vidmachine.ai/api/v1/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"nano-banana-2","inputs":{"prompt":"A neon city at night","aspect_ratio":"9:16"}}'
# Video (image-to-video)
curl -X POST "https://vidmachine.ai/api/v1/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"seedance-2-5","inputs":{"prompt":"Slow camera push in","image_url":"https://example.com/frame.png","duration":7}}'GET /generations
List your API generations. Query params:
status (queued, processing, succeeded, failed), model, limit (default 20, max 100), offset. Returns { generations, limit, offset }.curl -X GET "https://vidmachine.ai/api/v1/generations?status=succeeded&limit=10" \ -H "Authorization: Bearer YOUR_API_KEY"
GET /generations/:generationId
Poll one generation:
status (queued, processing, succeeded, failed), output_url when succeeded, credits charged, error when failed, and timestamps (created_at, started_at, completed_at).curl -X GET "https://vidmachine.ai/api/v1/generations/GENERATION_UUID" \ -H "Authorization: Bearer YOUR_API_KEY"
GET /usage
Return the credit balance for the key owner, split into subscription, purchased, and free buckets. Use it before a paid generation.
curl -X GET "https://vidmachine.ai/api/v1/usage" \ -H "Authorization: Bearer YOUR_API_KEY"
Errors
Responses use standard HTTP status codes. Body is JSON:
{ "error": "message" }. Common codes: 400 validation, 401 invalid or missing API key, 402 insufficient credits, 403 forbidden, 404 resource not found, 500 server error.Credits
API usage uses the same credit balance as your dashboard. Every call that triggers generation (e.g. POST /ideas/generate, POST /videos/generate, POST /generations) consumes credits from the key owner’s account; listing or updating resources typically does not.
POST /generations charges only when the model succeeds and bills videos on the generated clip length; failed generations are not charged. There is no separate API credit pool. For a breakdown of what uses credits, see Credits & billing.Related guides
How to create videos — Dashboard project settings aligned with API fields. Automatic video generation — Enable auto_generate and scheduling from the dashboard or via PATCH /projects. MCP server — Use these endpoints from Claude Code, Codex, Cursor, OpenCode, and Hermes. Quick start — First steps with VidMachine.