---
title: "POST /generate-video"
method: POST
path: "/generate-video"
---

# POST /generate-video

`POST /generate-video`

Generate videos using supported text-to-video, image-to-video, and video-to-video models. The response includes a runId and pending status; poll the status endpoint for completion. See the docs for the current model list and required inputs.

## Request body

- VideoGenerationRequest
  - `model` string, required — The video model to use for generation. See the docs for the current model list and required inputs.
  - `prompt` string — Text prompt describing the video to generate
  - `script` string — Fully-written script for LongStories models (takes precedence over prompt)
  - `conversationUUID` string — UUID for conversation tracking
  - `projectId` string — Project identifier for LongStories models
  - `framework` 'default' | 'emotional_story' | 'product_showcase' | 'tutorial' — Story framework for LongStories models
  - `shortRequestEnhancer` boolean — Smart Enhancement: if true, automatically choose better framework and add Director Notes if necessary
  - `targetLengthInWords` integer — Target length in words for LongStories models (legacy parameter)
  - `targetLengthInSeconds` integer — Target length in seconds (alternative to words)
  - `directorNotes` string — Prompt for the image generation engine (LongStories). Example: 'Warm lighting' or 'Make the first image very impactful'
  - `aspectRatio` '9:16' | '16:9' — Video aspect ratio for LongStories
  - `scriptConfig` object — Script generation configuration for LongStories
    - `style` 'default' | 'no_style' | 'engaging_conversational' | 'dixit_biography' | 'kind_biography' | 'hero_journey' | 'emotional_story' | 'dramatic_reveal' | 'heartwarming_stories' | 'educational_history' | 'news_brief' — Sets the tone & voice of the generated script
    - `targetLengthInSeconds` integer — Approx. time length of the script in seconds. The actual length may vary slightly.
  - `imageConfig` object — Image generation configuration for LongStories
    - `model` 'flux_schnell' | 'flux_lora' | 'flux_pro' | 'flux_pro_ultra' | 'flux-kontext' | 'recraft' | 'sdxl' | 'sdxl_lora' | 'sd35_large' | 'sd35_medium' | 'sd35_large_turbo' | 'leonardo_flux_precision' | 'leonardo_phoenix_quality' | 'leonardo_phoenix_ultra' | 'reve-v1' | 'hidream_fast' | 'hidream_dev' | 'hidream_full' | 'gpt_image_1' | 'imagen4_preview' | 'midjourney' — Which image model to use for generating images
    - `loraConfig` object — Style configuration (only applies when using Flux LoRA model)
      - `loraSlug` 'ghibsky-comic-book' | 'colour-sketches' | 'sketch-paint' | '90s-anime' | '2000s-crime-thrillers' | 'xno-symbol-flux' — Specialized style to apply
  - `videoConfig` object — Video generation configuration for LongStories
    - `enabled` boolean — Generate video motion from images instead of using static images
    - `model` 'ltx_video_13b_distilled' | 'ltx_video' | 'stable_video' | 'motion' | 'kling_v1_6_std_5s' | 'kling_v2_1_std_5s' | 'ltx_video_13b_dev' | 'skyreels' | 'vidu' | 'kling_v1_6_std_10s' | 'kling_v2_1_std_10s' | 'kling_v2_1_pro_5s' | 'luma_ray2' | 'kling_pro_5s' | 'minimax' | 'wan_i2v' | 'motion_2' | 'kling_v2_1_pro_10s' | 'wan_pro' | 'luma_ray2_hd' | 'kling_pro_10s' | 'kling_v2_1_master_5s' | 'kling_v2_master_5s' | 'veo2' | 'kling_v2_1_master_10s' | 'kling_v2_master_10s' — Which video model to use for motion generation
  - `voiceoverConfig` object — Voiceover configuration for LongStories
    - `enabled` boolean — Enable AI voiceover for the video
    - `voiceId` '9BWtsMINqrJLrRacOk9x' | 'CwhRBWXzGAHq8TQ4Fs17' | 'EXAVITQu4vr4xnSDxMaL' | 'FGY2WhTYpPnrIDTdsKH5' | 'IKne3meq5aSn9XLyUdCD' | 'JBFqnCBsd6RMkjVDRZzb' | 'N2lVS1w4EtoT3dr4eOWO' | 'SAz9YHcvj6GT2YYXdXww' | 'TX3LPaxmHKxFdv7VOQHJ' | 'XB0fDUnXU5powFXDhCwa' | 'Xb7hH8MSUJpSbSDYk0k2' | 'XrExE9yKIg1WjnnlVkGX' | 'bIHbv24MWmeRgasZH58o' | 'cgSgspJ2msm6clMCkdW9' | 'cjVigY5qzO86Huf0OWal' | 'nPczCjzI2devNBz1zQrb' | 'onwK4e9ZLuTAKqWW03F9' | 'pqHfZKP75CvOlQylNhV4' | 'pFZP5JQG7iQjIQuC4Bku' | 'KHCvMklQZZo0O30ERnVn' | 'Nh2zY9kknu6z4pZy6FhD' | 'LlZr3QuzbW4WrPjgATHG' | 'YExhVa4bZONzeingloMX' | 'm1VE7dnwBN0zMer3LcKv' | 'zWDA589rUKXuLnPRDtAG' | 'YYHkBdgrAwQWIaH6m2ai' — Voice for video narration
  - `captionsConfig` object — Captions configuration for LongStories
    - `captionsEnabled` boolean — Show text captions in the video
    - `captionsStyle` 'default' | 'minimal' | 'neon' | 'cinematic' | 'fancy' | 'tiktok' | 'highlight' | 'gradient' | 'intellectual' | 'vida' | 'manuscripts' | 'subtitle' | 'modern' | 'bounce' | 'popcorn' | 'typewriter' | 'handwritten' | 'karaoke' | 'retro' | 'gaming' — Style of video captions
  - `effectsConfig` object — Effects configuration for LongStories
    - `transition` 'fade' | 'random' | 'slide' | 'wipe' | 'flip' | 'none' — Transition style between different images
    - `floating` boolean — Make the images move around slightly with floating effects
  - `musicConfig` object — Music configuration for LongStories
    - `enabled` boolean — Add background music to the video
    - `musicSlug` '' | 'temple_of_treasures' | 'gentle_ambient_loop' | 'serene_ambience' | 'soothing_ambience' | 'soothing_ambient_backdrop' | 'tranquil_ambience' | 'dreamscape' | 'belonging_resonance' | 'vivid_memories' | 'cinematic_intro' | 'cinematic_teaser' | 'dramatic_cinematic_score' | 'thriller_cinema_trailer' | 'fractured_paintings' | 'promise_of_tomorrow' | 'spooky_orchestral_theme' | 'light_upbeat_melody' | 'puzzle_time' | 'stomping_drums_rhythm' | 'stomps_and_claps_rhythm_track' | 'news_theme' | 'adventurous_intro' | 'burlesque_sweetheart' | 'highway_nocturne_national_sweetheart' | 'haptic_sensation' — Choose background music for your video
    - `volume` number — Volume level for background music
    - `loop` boolean — Whether to loop the background music
  - `voice` string — Legacy: Voice ID for narration (use voiceoverConfig.voiceId instead)
  - `captionsShow` boolean — Legacy: Whether to show captions (use captionsConfig.captionsEnabled instead)
  - `captionsStyle` 'default' | 'minimal' | 'neon' | 'cinematic' | 'fancy' | 'tiktok' | 'highlight' | 'gradient' | 'instagram' | 'vida' | 'manuscripts' — Legacy: Style for captions (use captionsConfig.captionsStyle instead)
  - `effects` object — Legacy: Video effects configuration (use effectsConfig instead)
    - `transition` string
    - `floating` boolean
  - `quality` 'low' | 'medium' | 'high' — Legacy: Video quality (handled by videoConfig now)
  - `motion` object — Legacy: Motion configuration (handled by videoConfig now)
    - `enabled` boolean
    - `strength` integer
  - `music` string — Legacy: Music track (use musicConfig instead)
  - `duration` union — Video duration (format varies by model - '5s' for Veo2, '5' for Kling, etc.)
    - string
    - integer
  - `aspect_ratio` '16:9' | '9:16' | '1:1' | '4:3' | '3:4' — Aspect ratio (supported by select models)
  - `negative_prompt` string — Negative prompt to avoid certain elements
  - `cfg_scale` number — Classifier-free guidance scale
  - `imageDataUrl` string — Base64 data URL of input image for image-to-video models. Aliases `image_data_url` and `image` are also accepted and normalized.
  - `imageUrl` string — Public HTTPS URL of the input image (interchangeable with imageDataUrl). The service will prioritize whichever field you supply before falling back to library attachments.
  - `imageAttachmentId` string — Library attachment ID for input image
  - `videoUrl` string — Public HTTPS URL of the input video (extend/edit/upscale). Preferred field name for source videos.
  - `videoDataUrl` string — Base64 data URL of the input video.
  - `video` string — Alternate video field accepted by select providers.
  - `videoAttachmentId` string — Library attachment ID for input video.
  - `prompt_optimizer` boolean — Whether to optimize the prompt (MiniMax model)
  - `num_inference_steps` integer — Number of inference steps
  - `pro_mode` boolean — Enable pro mode for Hunyuan Video
  - `resolution` '720p' | '1080p' | '540p' — Video resolution
  - `num_frames` union — Number of frames to generate
    - integer
    - string
  - `frames_per_second` integer — Frames per second
  - `seed` integer — Optional seed forwarded on model/provider routes that support it. This may improve reproducibility but does not guarantee identical output.
  - `enable_safety_checker` boolean — Enable safety content filtering
  - `showExplicitContent` boolean — Allow explicit content (inverse of safety checker)
  - `enable_prompt_expansion` boolean — Enable automatic prompt expansion
  - `acceleration` boolean — Enable acceleration for faster processing
  - `shift` number — Shift parameter for certain models
  - `age_slider` integer — Age setting for PromptChan model
  - `audioEnabled` boolean — Enable audio for PromptChan model
  - `video_quality` 'Standard' | 'High' — Video quality for PromptChan model
  - `aspect` 'Portrait' | 'Landscape' | 'Square' — Aspect setting for PromptChan model

## Response `202`

Video generation request submitted successfully (asynchronous processing)

- VideoGenerationResponse
  - `runId` string, required — Unique identifier for the video generation request
  - `projectId` string — Project identifier (for LongStories models)
  - `status` 'pending' | 'processing' | 'completed' | 'failed', required — Current status of the generation
  - `model` string, required — The model used for generation
  - `cost` number — Cost of the video generation
  - `paymentSource` string — Payment source used (USD or XNO)
  - `remainingBalance` number — Remaining balance after the generation
  - `prechargeLabel` string — Provider label for the precharge

## Other responses

- `400` — Bad Request - Invalid parameters or safety filter triggered
- `401` — Unauthorized - Invalid or missing API key
- `500` — Server Error - Video generation failed

---

[API](https://skmtc.dev/nano-gpt/apis/nanogpt-api.md) · [All operations](https://skmtc.dev/nano-gpt/apis/nanogpt-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nano-gpt/nanogpt-api/revisions/584e96d146b0/schema)
