DocsVideo API
Video

Unified Video API

The frontend-friendly integration entry point for MidSync video generation.

POST /unified-video/generateScope: Depends on API key scopes configured in backend

Best for

Teams building customer-facing video generation flows.

Unified video generation
Quote before submit
Model-specific request bodies with runtime metadata

How to call it

bash

curl --request POST \
  --url https://api.midsync.dev/unified-video/generate \
  --header "Authorization: Bearer <your_api_key>" \
  --header "Content-Type: application/json" \
  --data '{
    "model": "seedance-1.5-pro",
    "prompt": "A cinematic beach at sunset with gentle waves",
    "resolution": "720p",
    "aspectRatio": "16:9",
    "duration": 8,
    "generateAudio": true
  }'

Overview

This page documents the unified video flow used by the product frontend and authenticated API integrations.

Use GET /unified-video/models as the form source of truth, POST /unified-video/quote for pricing preview, and POST /unified-video/generate for the real task creation.

How to use this API

Step 1

Choose a supported video model such as seedance-1.5-pro, kling-2.5-turbo, runway, or grok-video.

Step 2

Call GET /unified-video/models first, then send the same body to POST /unified-video/quote and POST /unified-video/generate.

Step 3

Store taskId, providerTaskId, model, and pointsCharged from the response, then use your callback flow or status lookup.

Endpoints

  • GET /unified-video/models returns runtime metadata and POST /unified-video/quote previews points before POST /unified-video/generate.
  • Model-specific parameter rules are documented in the model pages below.
  • Usage and billing history should be read from GET /v1/usage/logs and GET /v1/usage/summary.

Model support by variant

Model
Best for
Key inputs
Pricing rule
seedance-1.5-pro
Text-to-video and image-to-video
prompt, images, aspectRatio, resolution, duration
Matrix by resolution, duration, and generateAudio

seedance-1.5-pro request fields

Required

model and prompt. prompt length must be 3..2500.

Optional media

images accepts 0 to 2 image URLs. Use 0 for text-to-video and 1 to 2 for image-to-video.

Output controls

aspectRatio supports 1:1, 4:3, 3:4, 16:9, 9:16, 21:9, 2:3, 3:2. resolution supports 480p, 720p, 1080p. duration supports 4, 8, 12.

Toggles

fixedLens, generateAudio, and nsfwChecker are optional booleans. projectId is optional internal context.

Callback

callbackUrl is an optional URL. When provided, the server will POST the video result to this URL upon completion.

Validation rules

  • seedance-1.5-pro must not use firstFrameUrl, lastFrameUrl, referenceImageUrls, referenceVideoUrls, referenceAudioUrls, returnLastFrame, or webSearch.
  • seedance-1.5-pro images.length must not exceed 2.
  • seedance-2 and seedance-2-fast are temporarily disabled and should stay hidden in customer-facing UI.

Pricing notes

  • seedance-1.5-pro uses a dynamic pricing matrix based on resolution, duration, and generateAudio.
  • The public response should be treated as the authoritative charged-points result for the submitted request.

Response shape

Response shape

json

{
  "success": true,
  "taskId": "generated-task-id",
  "providerTaskId": "provider-task-id",
  "model": "seedance-1.5-pro",
  "providerModel": "bytedance/seedance-1.5-pro",
  "pointsCharged": 25,
  "status": "submitted",
  "estimatedTime": "~2-3 min",
  "estimatedTimeSec": 140
}
Store taskId, providerTaskId, and model after create-task succeeds.

Developer guidance

  • Use the unified-video model docs and endpoint docs consistently for frontend integrations.
  • Keep model-specific parameter rules in the model docs, but keep the public entry path stable as /unified-video/generate.
  • Use usage logs and summary for customer-facing spend visibility.

Receiving results: callbackUrl vs polling

When you include callbackUrl in the generate request, the server will POST the completed result to that URL automatically. This is the recommended approach for production integrations.

Alternatively, you can poll GET /unified-video/:taskId/status until the status changes to completed or failed. Polling is useful for debugging or when webhooks are not feasible.

Ready to test with your own key?

Create a general API key in Settings, then come back here to copy a request example.

Open API Keys