The VisionStory AI Video Generation API creates text-to-video, image-to-video, and reference-guided clips with V-Character 5.0 Pro, Seedance, Wan, and Kling models. Use the same API key to discover models, estimate credits, submit jobs, reuse media assets, poll status, and download results.
Choose the video API for your task:
| API | Use it for |
|---|---|
/api/v1/video | A talking avatar speaking a text or audio script; follow the Quick start |
/api/v1/ai_video | Clips driven by a prompt, images, or reference media; follow this guide |
Beta. Any API key backed by an active Pro plan or above can call these endpoints. No separate capability allowlist is required.
AI video API endpoints
| Method | Path | What it does |
|---|---|---|
GET | /api/v1/ai_video/models | Machine-readable capability sheet for every model |
GET | /api/v1/ai_video/cost | Exact credit cost of a task before you submit it |
POST | /api/v1/ai_video | Submit a generation task |
GET | /api/v1/ai_video | Query one task (or up to 20 with video_ids) |
GET | /api/v1/ai_videos | List your tasks, newest first |
DELETE | /api/v1/ai_video | Delete a task |
POST | /api/v1/asset | Upload a reusable media asset |
GET | /api/v1/assets | List your assets |
DELETE | /api/v1/asset | Delete an asset |
Generate an AI video
Submit a text-to-video task, then poll until it finishes:
curl -s -H "X-API-Key: $VISIONSTORY_API_KEY" -H "Content-Type: application/json" -d '{"model_id": "seedance-2.0", "prompt": "A corgi surfing at sunset, cinematic lighting", "duration_sec": 8, "aspect_ratio": "9:16", "resolution": "1080p"}' https://openapi.visionstory.ai/api/v1/ai_video
{
"data": {
"video_id": "YOUR_AI_VIDEO_ID",
"status": "queued",
"cost_credit": 64
}
}
Poll every 5–10 seconds:
curl -s -H "X-API-Key: $VISIONSTORY_API_KEY" "https://openapi.visionstory.ai/api/v1/ai_video?video_id=YOUR_AI_VIDEO_ID"
AI video models and capabilities
GET /api/v1/ai_video/models returns allowed values and defaults for each parameter, plus media constraints. Always drive your integration from this endpoint — new models and parameter values appear there without any API change.
| model_id | Best for | Resolution | Duration | Capabilities |
|---|---|---|---|---|
vs_character_v5_pro | Mixed references and video editing | 720p / 1080p / 2k | 4–15 s or auto with video/audio refs | text-to-video, image-to-video |
kling-4.0 | Audio with image/video references | 720p / 1080p | 3–30 s, integer | text-to-video, image-to-video |
seedance-2.5 | Up to 50 multimodal references, single clips up to 30 s | 480p / 720p / 1080p | 4–30 s | text-to-video, image-to-video |
seedance-2.5-flash | Flash variant with up to 20 multimodal references | 480p / 720p | 4–30 s | text-to-video, image-to-video |
seedance-2.0 | Flagship quality, multimodal references | 480p / 720p / 1080p | 4–15 s | text-to-video, image-to-video |
seedance-2.0-fast | Lower latency and cost | 480p / 720p | 4–15 s | text-to-video, image-to-video |
seedance-2.0-mini | Lightweight, most economical | 480p / 720p | 4–15 s | text-to-video, image-to-video |
| wan-3.0 | Multimodal references | 480p / 720p / 1080p | 2–30 s, integer | text-to-video, image-to-video |
| wan-3.0-prime | Higher-priced Wan variant | 480p / 720p / 1080p | 2–30 s, integer | text-to-video, image-to-video |
| kling-3.0 | Up to 4K output | 720p / 1080p / 4k | 5 or 10 s | text-to-video, image-to-video; no refs |
| kling-3.0-omni | Image/video references | 720p / 1080p | 3, 5, 7, 10, or 15 s | text-to-video with refs; no first_frame |
Read each model's allowed aspect ratios, defaults, and reference limits from discovery. Wan supports adaptive and prompts up to 20000 characters; Seedance and V-Character 5.0 Pro support up to 5000, Kling 4.0 up to 11000, and Kling 3.0 / Omni up to 2500. Resolution defaults to 720p except Kling 3.0 Omni (1080p). Seedance 2.5 defaults to 15 seconds; Seedance 2.5 Flash and the Seedance 2.0 series default to 5 seconds. Flash defaults to aspect ratio 9:16 and supports adaptive. V-Character 5.0 Pro defaults to 10 seconds and aspect ratio auto; Kling 4.0 defaults to 5 seconds. Native audio defaults to on; Kling 4.0 rejects generate_audio=false at submission and quote time.
The Seedance 5000-character limit is the API's validation limit, not a recommended prompt length. Keep each shot concise: preferably no more than 500 Chinese characters or 1000 English words. Longer prompts can dilute the focus and lose details. Read the live model catalog before submitting.
480p applies to Seedance and Wan AI video only. It is not available for Kling or new talking-avatar requests. Historical talking-avatar responses can still contain 480p.
Estimate AI video credits and cost
Generation is billed in credits, charged at submit time and automatically refunded in full if generation fails. Cost depends on model, resolution, and duration (per second). Query the cost endpoint before submitting — it applies exactly the same formula as billing:
curl -s -H "X-API-Key: $VISIONSTORY_API_KEY" "https://openapi.visionstory.ai/api/v1/ai_video/cost?model_id=seedance-2.0&duration_sec=8&resolution=1080p"
{
"data": {
"credit": 64,
"base_credit": 64,
"reference_video": null
}
}
generate_audio does not change the credit price. Reference-video billing depends on the model:
- All Seedance models (2.0, Fast, Mini, 2.5, and Flash) and Kling 4.0 include reference-video seconds up to half the output duration for free. Only excess seconds cost 60% of the output second rate. Sum reference durations, capping each video at 15 seconds for the Seedance 2.0 series or 30 seconds for Seedance 2.5 / Flash and Kling 4.0; round the combined generation and reference cost up once. Fractional per-second rates are supported; final charges and refunds remain integers.
- V-Character 5.0 Pro doubles the generation second rate once when any video reference is present. Images and audio do not add charges; multiple videos do not multiply the rate again. Billing uses the ceiling of the resolved generation duration.
base_credit=creditandreference_video=nullfor this model. - Other references do not add charges.
Pass optional reference_video_duration_sec (a nonnegative number, default 0) to the cost endpoint. For V5 Pro, any positive value selects video-reference pricing. For auto or video editing, pass the resolved reference duration as numeric duration_sec, including fractional seconds (2–15 seconds); do not send auto to the quote endpoint. Submission measures references server-side and returns the actual charge. Quotes return total credit, generation base_credit rounded up, and optional reference_video details (duration_sec, free_duration_sec, excess_duration_sec, unit_cost, cost_credit). The reference surcharge is the rounded total minus base_credit, so the fee details always add up to credit.
visionstory ai-video-cost --model-id kling-4.0 --duration-sec 10 --resolution 720p --reference-video-duration-sec 8
Current per-second rates include:
| Model | 480p | 720p | 1080p | 4k |
|---|---|---|---|---|
| V-Character 5.0 Pro | — | 1 (2 with video) | 2 (4 with video) | — |
| Kling 4.0 | — | 2 | 4 | — |
| Seedance 2.5 | 3 | 6 | 15 | — |
| Seedance 2.5 Flash | 2 | 5 | — | — |
| Seedance 2.0 | 2 | 3 | 8 | — |
| Seedance 2.0 Fast | 0.75 | 1.5 | — | — |
| Seedance 2.0 Mini | 0.5 | 1 | — | — |
| Wan 3.0 | 1 | 2 | 5 | — |
| Wan 3.0 Prime | 2 | 3 | 7 | — |
| Kling 3.0 | — | 2 | 3 | 8 |
| Kling 3.0 Omni | — | 2 | 3 | — |
V-Character 5.0 Pro also supports 2k at 4 credits/s, or 8 with video references. Use the cost endpoint for the current quote rather than caching this table indefinitely. Check your remaining balance with GET /api/v1/billing/credits.
Image, video, and audio inputs
Every media slot (first_frame, end_frame, refs[]) accepts exactly one of three forms:
| Form | Example | Use when |
|---|---|---|
url | {"url": "https://your.site/img.jpg"} | One-off use; fetched by our servers, not added to your asset library |
inline_data | {"inline_data": {"mime_type": "image/png", "data": "<base64>"}} | One-off use, no public URL available |
asset_id | {"asset_id": "YOUR_ASSET_ID"} | Reused materials — upload once via the Assets API, reference many times |
The following media limits describe Seedance inputs. The 2.5 series supports longer references and additional image formats; check the selected model in model discovery. Wan and Kling have their own limits.
| Kind | Max size | Formats | Constraints |
|---|---|---|---|
| Image | 30 MB | jpg, jpeg, png, webp, bmp, tiff, gif; heic / heif for 2.5 / Flash | 300–6000 px per side, aspect ratio between 1:2.5 and 2.5:1 |
| Video | 100 MB | mp4, mov | 2–15 s for the 2.0 series, 2–30 s for 2.5 / Flash; 300–6000 px, aspect ratio 1:2.5–2.5:1; frame rate is normalized server-side |
| Audio | 15 MB | wav, mp3 | 2–15 s for the 2.0 series, 2–30 s for 2.5 / Flash; cannot be the only reference |
Configure an AI video request
POST /api/v1/ai_video has two modes on one endpoint: provide first_frame (optionally end_frame) for image-to-video, provide refs for reference-guided text-to-video (character consistency, style, motion, or voice references), or provide neither for pure text-to-video. refs and first_frame are mutually exclusive. Unknown fields and unsupported values are rejected — nothing is silently ignored.
| Field | Required | Description |
|---|---|---|
model_id | yes | See Models above |
prompt | yes | Text prompt, up to 20000 characters for Wan, 5000 for Seedance / V5 Pro, 11000 for Kling 4.0, and 2500 for Kling 3.0 / Omni |
client_request_id | no | Idempotency key; resubmitting the same value within 24h returns the original task instead of charging again |
duration_sec | no | Integer seconds or auto for V5 Pro with video/audio references; omission uses the model default |
aspect_ratio | no | Defaults to the model default |
resolution | no | Defaults to the model default |
generate_audio | no | Native audio on the output; default true |
first_frame | no | Image media object; switches to image-to-video |
end_frame | no | Image for the last frame; requires first_frame |
refs | no | Model-specific: check refs.max, refs.max_per_kind, and refs.total_duration_sec_max |
Model-specific input combinations
- Seedance 2.5: up to 30 image / 10 video / 10 audio references, at most 50 total. Flash: up to 10 image / 5 video / 5 audio references, at most 20 total. Both accept 2–30-second video/audio references; video and audio each total at most 30 seconds, measured separately.
- Seedance 2.0 / Fast / Mini: up to 9 image / 3 video / 3 audio references, subject to 9 total. Each video/audio reference is 2–15 seconds; each kind totals at most 15 seconds.
- V-Character 5.0 Pro: mixed references accept up to 9 images, 3 videos, and 3 audio files, with at most 12 references total. Each video/audio reference must be 2–15 seconds, and each kind totals at most 15 seconds. Ordered image references are reference-guided generation, not implicit first/end frames. Explicit
first_frameand optionalend_frameremain supported. Aspect ratios areauto,21:9,16:9,3:2,4:3,5:4,1:1,4:5,3:4,2:3,9:16, and9:21.autorequires video/audio refs; with a video it uses the video duration. Video editing is inferred from the prompt intent with one video and a compatible duration, usesmin(requested, video)seconds and preserves original audio. - Kling 4.0: up to 10 image and 5 video references, at most 15 total; each video is 3–30 seconds and the video total cannot exceed 30 seconds. Use
@image_1…@image_10and@video_1…@video_5in the prompt, numbered separately by type in input order. Image-to-video follows the first frame's aspect ratio; native audio is always on, including with video references. - Wan: up to 10 image, 5 video, and 5 audio references, also subject to the discovered total limit. Video and audio reference durations are each limited to 15 seconds in total; an individual longer reference is clipped to its first 15 seconds. Exceeding the aggregate limit returns
37104. Combiningrefswith an explicitaspect_ratioreturns 400. - Kling 3.0:
refs.max=0; image-to-video acceptsfirst_frame, but an explicitaspect_ratioin that mode returns 400. - Kling 3.0 Omni: no
first_frame; up to 7 image/video references, at most 1 video, with video references totaling at most 15 seconds. More than 1 video is rejected before charging. If refs contain video, setgenerate_audio=false; otherwise the request returns 400. - Use
first_frameonly when discovery declares image-to-video support. Always keepfirst_frameandrefsmutually exclusive;end_framerequiresfirst_frame.
Image-to-video with first and last frame:
curl -s -H "X-API-Key: $VISIONSTORY_API_KEY" -H "Content-Type: application/json" -d '{"model_id": "seedance-2.0", "prompt": "The scene slowly comes alive, gentle camera push-in", "first_frame": {"url": "https://your.site/start.jpg"}, "end_frame": {"url": "https://your.site/end.jpg"}, "duration_sec": 6}' https://openapi.visionstory.ai/api/v1/ai_video
Character-consistent generation with a reusable asset:
curl -s -H "X-API-Key: $VISIONSTORY_API_KEY" -H "Content-Type: application/json" -d '{"model_id": "seedance-2.0", "prompt": "The same woman walks through a neon-lit street at night", "refs": [{"asset_id": "YOUR_ASSET_ID"}], "duration_sec": 10}' https://openapi.visionstory.ai/api/v1/ai_video
Poll AI video generation status
Query one task with ?video_id=, or up to 20 at once with ?video_ids=id1,id2,... (batch responses return {"videos": [...]}). Poll every 5–10 seconds.
| status | Meaning |
|---|---|
queued | Accepted, waiting for a worker |
creating | Generating |
created | Done — video_url and cover_url are ready |
failed | Generation failed — see error; credits were refunded automatically |
Seedance moderation is asynchronous: a rejected task resolves to failed and is refunded. Wan and Kling can reject content synchronously with HTTP 403 and code 37110 (prompt) or 37111 (image), without charging. Always handle both submission errors and the failed task state.
Failed generation refunds credits in full. The API does not automatically switch to a different model after failure; returned model_id identifies the actual model.
List and delete AI videos
GET /api/v1/ai_videos lists your tasks, newest first. Pass cursor from the previous page's next_cursor to paginate; next_cursor=0 means no more pages. limit defaults to 20 (max 100). DELETE /api/v1/ai_video?video_id= deletes a task — only your own.
Use the optional status query parameter to filter by one or more comma-separated values: queued, creating, created, or failed. Omitting it keeps the existing unfiltered behavior; an unknown status returns HTTP 400.
Check AI video concurrency before submitting
Query in-flight AI video tasks with status=queued,creating:
visionstory ai-videos --status queued,creating --limit 100
page = client.list_ai_videos(status="queued,creating", limit=100)
print(page)
Follow next_cursor until it is 0 when counting tasks; a single page can undercount. The list shows current usage, not the configured limit, and does not reserve a slot. A concurrency rejection returns HTTP 429 with error.details.limit and error.details.in_flight. Wait for an in-flight task to finish, refresh the list, then retry with the same client_request_id. Other rate-limit errors may not include these concurrency fields.
Error-schema compatibility: the shared error schema currently declares details as a nullable string, while concurrency errors are documented with an object. When reading concurrency metadata, accept an object or parse a JSON-encoded string; do not assume every 429 includes these fields.
Reuse media with the Assets API
An asset is a reusable uploaded material: upload once, reference by asset_id in any number of generation requests — ideal for a recurring character image, brand footage, or a voice sample. Re-uploading identical content returns the existing asset (idempotent):
curl -s -H "X-API-Key: $VISIONSTORY_API_KEY" -H "Content-Type: application/json" -d '{"url": "https://your.site/character.jpg"}' https://openapi.visionstory.ai/api/v1/asset
{
"data": {
"asset_id": "YOUR_ASSET_ID",
"kind": "image",
"mime": "image/jpeg",
"width": 1024,
"height": 1536,
"duration_sec": 0,
"created_at": 1754270000
}
}
inline_data (base64) is also accepted; size and format limits match Media inputs above. GET /api/v1/assets lists your assets (filter by kind, paginate with cursor / limit). DELETE /api/v1/asset?asset_id= deletes an asset — videos already generated from it are not affected.
AI video API errors
| HTTP | error.code | Meaning |
|---|---|---|
| 401 | — | Missing or invalid API key |
| 403 | 30610 | Active subscription required |
| 403 | 30309 | Insufficient paid credits for external models; reward credits cannot be used |
| 403 | 30308 | Insufficient paid plus signup credits for V-Character 5.0 Pro |
| 403 | 37101 | Invalid input — parameter or media constraint violation |
| 403 | 37102 | Prompt too long |
| 403 | 37103 | Too many references |
| 403 | 37104 | Reference duration total exceeded |
| 403 | 37110 / 37111 | Wan/Kling prompt or image moderation rejection; not charged |
| 400 | 400 | Rejected by the gateway (unknown model_id, media too large or unsupported, invalid asset_id) |
| 422 | — | Malformed request body (unknown fields, missing required fields, invalid combinations) |
| 404 | — | Video or asset not found |
| 429 | — | Rate limited |
Asynchronous failures (moderation, provider errors) never use HTTP errors — the task resolves to status=failed with an error object, and credits are refunded automatically.
Successful delivery is reported only after the generated video is stored. Temporary delivery problems retry the same task; exhausted delivery retries fail with 37007 and a full refund. Keep polling the original task instead of creating another.
Rate limits, storage, and idempotency
- Concurrency: the in-flight quota is shared per account across all its API keys, with a default of 3 tasks; the configured limit can differ. Excess requests are rejected, not queued. Read
error.details.limitanderror.details.in_flighton 429. - Rate limit: 180 requests per 60 seconds per account. Use batch query (
video_ids) and poll at 5–10 s intervals. - Storage: download
video_urlpromptly if you need long-term storage. Assets stay available until you delete them. - Idempotency: pass a
client_request_idon submit to make retries safe — resubmitting the same value within 24h returns the original task instead of creating (and charging) a new one. Without it, store the returnedvideo_idbefore retrying, since a network-level retry of a successful submit creates (and charges) a new task. - Webhooks are not available yet; polling is the supported integration pattern.
- The beta surface may gain new optional parameters and models over time; existing fields and semantics will not change incompatibly.
Related VisionStory API guides
- Quick start — the talking-avatar flow with the same key.
- For agents — drive AI video generation from an AI agent.
- API reference — full schemas for every endpoint above.