Video Endpoints
POST /api/v1/studio/video/generate
Generate a video from a text prompt. Supports text-to-video, image-to-video, and reference-guided generation depending on the model.
Request Body
promptstringrequiredVideo description (1–4000 characters).
modelstringrequiredModel: veo, veo-fast, kling-3.0-std, kling-3.0-pro, kling-3.0-4k, wan-2.6, wan-2.7, seedance-2.0, seedance-2.5, grok-video, or grok-video-v1.5.
durationnumberDuration in seconds (varies by model, default varies).
aspectRatiostringAspect ratio: 16:9, 9:16, or 1:1.
resolutionstringResolution: 480p, 720p, or 1080p.
imageUrlstringImage URL for image-to-video generation.
referenceImageUrlstringReference image URL (Seedance only).
referenceImagesstring[]Reference images for Kling 3.0 reference-to-video — up to 4 (std/pro) or 7 (4k). The first image is the start frame.
endImageUrlstringEnd frame image URL (Kling 3.0 image-to-video and WAN 2.7 image-to-video).
sourceVideoUrlstringSource video to transform (WAN 2.7 edit-video only).
audioUrlstringAudio track to condition output on (WAN 2.7 only).
referenceVideosstring[]Multi-video references — WAN 2.7 reference-to-video (≤3) and Seedance reference-to-video (token-mapped, ≤3).
negativePromptstringNegative prompt to avoid certain elements.
generateAudiobooleanGenerate audio along with the video.
cfgScalenumberClassifier-free guidance scale (Kling only, 0–1, default 0.5).
shotTypestringKling 3.0 only — customize (default) or intelligent.
seednumberSeed for reproducibility.
Models
| Model | Provider | Features |
|---|---|---|
| veo | Text-to-video, image-to-video, up to 8s | |
| veo-fast | Faster generation, lower quality | |
| kling-3.0-std | Kuaishou | T2V, I2V, end-frame, audio, 3–15s |
| kling-3.0-pro | Kuaishou | T2V, I2V, end-frame, audio, 3–15s |
| kling-3.0-4k | Kuaishou | T2V, I2V, 4K output, end-frame, audio, 3–15s |
| wan-2.6 | Alibaba | Text-to-video, image-to-video, up to 5s |
| wan-2.7 | Alibaba | Text/image/reference/edit-video, 3–10s, 720p/1080p, optional audio track |
| seedance-2.5 | ByteDance | Text/image/reference-to-video, 4–30s, 480p/720p/1080p, native audio; takes photoreal faces in references |
| seedance-2.0 | ByteDance | Text-to-video, reference-guided, up to 10s |
| seedance-2.0-fast | ByteDance | Faster/cheaper Seedance, text/image/reference-to-video, up to 10s |
| pixverse-v6 | Pixverse | Text-to-video, image-to-video, 5/8s, up to 1080p |
| grok-video | xAI | Text-to-video, up to 10s |
| grok-video-v1.5 | xAI | Image-to-video only (requires imageUrl), 480p/720p, up to 10s |
Example
curl -X POST https://terramind.com/api/v1/studio/video/generate \
-H "Authorization: Bearer sk-tm-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A drone flying over a tropical island at sunset",
"model": "veo",
"duration": 5,
"aspectRatio": "16:9"
}'Response
{
"success": true,
"data": {
"url": "https://storage.googleapis.com/...",
"storagePath": "studios/.../video.mp4",
"format": "mp4",
"duration": 5000,
"model": "veo",
"metadata": {
"aspectRatio": "16:9",
"enhancedPrompt": "A cinematic drone shot..."
}
},
"credits": { "used": 1, "cost": 25.0, "remaining": 9975.0 }
}POST /api/v1/studio/video/remove-background
Remove the background from a video using fal.ai VEED. Three variants: standard (best quality), fast (cheaper), and green-screen (replace the background with a solid color).
Request Body
videoUrlstringrequiredURL of the input video.
durationSecondsnumberrequiredDuration of the source video in seconds — used for billing.
variantstringstandard (default), fast, or green-screen.
backgroundColorstringHex/named color (green-screen only). Defaults to green.
persistToStoragebooleanRe-upload the result to Terramind storage (default true).
Example
curl -X POST https://terramind.com/api/v1/studio/video/remove-background \
-H "Authorization: Bearer sk-tm-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"videoUrl": "https://...mp4",
"durationSeconds": 8,
"variant": "standard"
}'POST /api/v1/studio/video/upscale
Upscale a video to a higher resolution using fal.ai Topaz. Optionally interpolate to a higher target frame rate for smoother motion.
Request Body
videoUrlstringrequiredURL of the input video.
durationSecondsnumberrequiredDuration of the source video in seconds — used for billing.
upscaleFactornumber2 (default) or 4. 4x is significantly more expensive.
targetFpsnumberOptional target frame rate: 24, 30, 48, or 60.
persistToStoragebooleanRe-upload the result to Terramind storage (default true).
Example
curl -X POST https://terramind.com/api/v1/studio/video/upscale \
-H "Authorization: Bearer sk-tm-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"videoUrl": "https://...mp4",
"durationSeconds": 8,
"upscaleFactor": 2,
"targetFps": 60
}'Providers & Pricing
A model can run on more than one provider (fal, Atlas Cloud, the Vercel AI Gateway). You name the model; each call runs on the cheapest provider that can serve it, at that provider's list price × 1.28, and falls back to the next one if the provider fails or refuses. An error in your request is returned, not retried elsewhere. The reservation is held at the most expensive eligible provider and the call is charged at the one that ran; the rest is released. Quotes show range.min and range.max when providers differ, and responses name the provider in data.provider (or provider on a queued job). Upscaled tiers such as 1080p-esr and 4k-esr appear in a model's params.resolutions in the catalog where a provider offers them. Write references as @Image1, @Video1 and @Audio1 whichever provider runs the call; each is sent its own spelling (Kling 4.0 on Atlas Cloud reads @image_1, WAN and MiniMax read Image 1), and a provider that cannot take the request's references is skipped.
To run on one provider, add transport: "fal", "atlas" or "gateway" (also accepted by /api/v1/studio/estimate and the batch endpoint). Only that provider is used, nothing falls back, and the call is held and charged at that provider's list price × 1.28, so a quote has no range. If that provider cannot serve the request (the model does not run there, or not this mode, resolution or input) the call returns 400 INVALID_INPUT naming why; if it could but is not available right now, 409 TRANSPORT_UNAVAILABLE. Any other value is a 400. Omit it to let Terramind route the call.
Billing & Credit Reservation
Video generations are expensive, so credits are reserved when the request is accepted and charged only after the video is successfully stored. Any failure along the way (provider error, missing output URL, download or upload failure) releases the reservation automatically and leaves your balance untouched. Webhook-driven deliveries settle the reservation exactly once per job. Insufficient balance returns 402 INSUFFICIENT_CREDITS; hitting the 6-hour usage window returns 429 WINDOW_EXHAUSTED with a resetAt timestamp. See Credit Reservation for details.