API Docs
Authentication
Unified media base URL: https://api.vivareel.com/api/developer/v1. OpenAI SDK base URL: https://api.vivareel.com/api/developer/openai/v1. Model calls use an API Key; wallet, billing, key and webhook management use a login JWT.
Response & billing
Developer calls reserve and settle USD, never platform points. GET /models lists USD pricing; text rates are per million input, output and cache-read tokens. Unified endpoints use code/message/data; OpenAI Chat (including SSE) and registered native routes use protocol responses. Send Idempotency-Key on submissions and query GET /tasks/task_id for media. Media is archived without adding a platform watermark.
Models and prices shown here are illustrative, not live offers. Check GET /models and the configured upstream mapping; canvas model rules do not apply. Keep API keys on your server. Use a new idempotency key for each new call and preserve the original key and body for retries. For timeouts or reconciling, check the original request and contact an administrator; never blindly resubmit with a new key. The SSE example displays raw chunks, not complete events; production clients must parse SSE. The platform adds no watermark and does not remove upstream watermarks.
Currency, status and reconciliation
- Separate wallets
- New developer calls use USD; platform creation uses points. No conversion, merging or fallback to points occurs when USD is insufficient. Use billing_currency / currency, not task ID prefixes. HTTP logs return UNKNOWN when evidence is missing; this means neither points nor free usage.
- HTTP success is not task success
- HTTP 200 / code=200 on unified asynchronous submission means accepted. A successful task lookup can still return status=failed. Check status and billing_status separately: reserved is a hold, consumed a charge, released a released hold, refunded a returned charge, and reconciling an uncertain outcome. Confirmed submission rejection releases the hold; timeouts or disconnects may retain it. Do not resubmit with a new idempotency key.
- Platform and upstream IDs
- Use the platform task_id in /api/developer/v1/tasks/task_id. upstream_id is the vendor task ID for reconciliation and may be null before acceptance, when absent from the response, or for synchronous APIs. upstream_http_status is the latest recorded upstream HTTP status, not the lookup status. HTTP log request_id identifies an individual HTTP request.
Successful lookup of a failed task with its hold released (excerpt)
{
"code": 200,
"message": "ok",
"data": {
"task_id": "dr_0123456789abcdef0123456789abcdef",
"upstream_id": null,
"upstream_http_status": 404,
"status": "failed",
"billing_currency": "USD",
"reserved_amount": "2.1000000000",
"amount_cost": "0.0000000000",
"billing_status": "released",
"error_message": "上游确认拒绝或失败(HTTP 404)"
}
}Official models and v2 billing
These are protocol templates and examples, not proof of authorization or availability. Check GET /models first. Administrators configure public-to-upstream mappings and selling prices. kimi-k3.1 remains disabled and is not automatically mapped.
v2 fixes the price version, period, discount and candidate bands at acceptance; queueing, retries and crossing periods do not reprice the request. IANA time zones and manual date overrides select the period; weekly windows include the start and exclude the end. Total actual input tokens select one band for the entire call, not progressive tiers; Qwen can use 0–256000 and 256001–1000000. The hold uses the highest total cost among reachable bands, not the final charge.
Request JSON is limited to 1 MiB and upstream JSON to 16 MiB, including Base64 overhead. Use public URLs for large media. Responses, Anthropic, Batch, speech, provider file uploads and separately billed search are not added. SSE needs reliable final usage and [DONE] for automatic settlement; disconnecting does not imply a refund. Historical snapshots retain their original calculation.
deepseek-v4-pro-0813 / deepseek-v4.1-flash
DeepSeek uses max_tokens and supports normal Chat, SSE, caching and thinking. Public version names map to the current official model or rolling alias, not a permanently pinned version. Peak templates use UTC weekdays 01:00–04:00 and 06:00–10:00; administrators maintain prices and holidays.
Public model → official upstream model
deepseek-v4-pro-0813 → deepseek-v4-prodeepseek-v4.1-flash → deepseek-flash
Request examples (keep API keys server-side)
POST /api/developer/openai/v1/chat/completionsIdempotency-Key: your-stable-request-id{
"model": "deepseek-v4-pro-0813",
"messages": [
{
"role": "user",
"content": "请简要解释光合作用。"
}
],
"max_tokens": 4096,
"thinking": {
"type": "enabled"
}
}glm-5.3 / glm-5.3-flash
GLM 5.3 is text-only; Flash supports official multimodal messages. Thinking is always enabled, reasoning_effort is low/high/max, and max_tokens limits output. Tool calls and reasoning_content are preserved.
Public model → official upstream model
glm-5.3 → glm-5.3glm-5.3-flash → glm-5.3-flash
Request examples (keep API keys server-side)
POST /api/developer/openai/v1/chat/completionsIdempotency-Key: your-stable-request-id{
"model": "glm-5.3",
"messages": [
{
"role": "user",
"content": "请简要解释光合作用。"
}
],
"max_tokens": 4096,
"thinking": {
"type": "enabled"
},
"reasoning_effort": "high"
}kimi-k3 / kimi-k3.1-pro / kimi-k3.1-prime
Kimi uses max_completion_tokens. Sampling is fixed at temperature=1, top_p=0.95, presence_penalty=0 and frequency_penalty=0. Automatic 5m cache writes are the default and require a configured write price; 1h requests are rejected without their price. Cache reads, writes and uncached input are disjoint; there is no invented cache-disable switch.
Public model → official upstream model
kimi-k3 → kimi-k3kimi-k3.1-pro → kimi-k3.1-prokimi-k3.1-prime → kimi-k3.1-pro-highspeed
Request examples (keep API keys server-side)
POST /api/developer/openai/v1/chat/completionsIdempotency-Key: your-stable-request-id{
"model": "kimi-k3.1-prime",
"messages": [
{
"role": "user",
"content": "请简要解释光合作用。"
}
],
"max_completion_tokens": 4096,
"reasoning_effort": "high",
"temperature": 1,
"top_p": 0.95,
"presence_penalty": 0,
"frequency_penalty": 0,
"prompt_cache_options": {
"mode": "implicit",
"ttl": "5m"
}
}qwen3.7-plus / qwen3.8-flash
New Qwen profiles require max_completion_tokens for reasoning plus answer tokens. The old max_tokens only limits the answer and returns a migration error. enable_thinking / thinking_budget are supported; actual total input selects the context band. Existing legacy profiles are unchanged.
Public model → official upstream model
qwen3.7-plus → qwen3.7-plusqwen3.8-flash → qwen3.8-flash
Request examples (keep API keys server-side)
POST /api/developer/openai/v1/chat/completionsIdempotency-Key: your-stable-request-id{
"model": "qwen3.7-plus",
"messages": [
{
"role": "user",
"content": "请简要解释光合作用。"
}
],
"max_completion_tokens": 4096,
"enable_thinking": true,
"thinking_budget": 2048
}qwen-image-3.0-pro
Qwen Pro supports synchronous OpenAI Images generation/editing and unified asynchronous submission, up to 3 input and 6 output images. size is WxH or auto. Output area 2250000 pixels separates 1K/2K bands; input image pricing follows the output size. v2 bills official actual input and output counts separately; auto reserves the highest total across possible sizes. Historical requests receive no added input charge.
Public model → official upstream model
qwen-image-3.0-pro → qwen-image-3.0-pro
Request examples (keep API keys server-side)
POST /api/developer/openai/v1/images/editsIdempotency-Key: your-stable-request-id{
"model": "qwen-image-3.0-pro",
"prompt": "保留主体,改为水彩画风格",
"image": [
"https://example.com/reference.png"
],
"n": 2,
"size": "auto",
"response_format": "url"
}wan2.7-image-pro
Wan2.7 unified submission returns task_id asynchronously; the native DashScope multimodal endpoint is synchronous and retains its response, not OpenAI Images. Up to 9 inputs; normal n=1–4 or n=1–12 with enable_sequential=true. 4K requires no inputs and non-sequential mode. bbox_list and color_palette are supported; thinking_mode requires no inputs and non-sequential mode. prompt_extend is rejected. Successful images are cross-checked against usage.image_count; response text tokens are not billed.
Public model → official upstream model
wan2.7-image-pro → wan2.7-image-pro
Request examples (keep API keys server-side)
POST /api/developer/v1/images/generationsIdempotency-Key: your-stable-request-id{
"model": "wan2.7-image-pro",
"prompt": "生成同一角色的连续故事组图",
"reference_urls": [
"https://example.com/reference.png"
],
"size": "2K",
"n": 6,
"enable_sequential": true
}happyhorse-1.1-t2v / happyhorse-1.1-i2v / happyhorse-1.1-r2v / happyhorse-1.0-video-edit
HappyHorse uses the video operation: T2V takes text; I2V exactly one first frame and no ratio; R2V 1–9 reference images and a prompt; editing exactly one video_url, 0–5 images and a prompt, with audio_setting=auto/origin and no output duration or ratio. Generation supports 3–15 seconds and 480P/720P/1080P; editing supports 720P/1080P. Administrators explicitly choose provider billable or output duration and exact or ceiling rounding. Client-reported input duration is not trusted. The X-DashScope-DataInspection allowlist is retained.
Public model → official upstream model
happyhorse-1.1-t2v → happyhorse-1.1-t2vhappyhorse-1.1-i2v → happyhorse-1.1-i2vhappyhorse-1.1-r2v → happyhorse-1.1-r2vhappyhorse-1.0-video-edit → happyhorse-1.0-video-edit
Request examples (keep API keys server-side)
POST /api/developer/v1/videos/generationsIdempotency-Key: your-stable-request-id{
"model": "happyhorse-1.1-t2v",
"motion_instruction": "日出时海浪拍打沙滩",
"resolution": "720P",
"duration_seconds": 6,
"aspect_ratio": "16:9"
}POST /api/developer/v1/videos/generationsIdempotency-Key: your-stable-request-id{
"model": "happyhorse-1.1-i2v",
"motion_instruction": "镜头缓慢推进",
"image_url": "https://example.com/first-frame.png",
"resolution": "720P",
"duration_seconds": 6
}POST /api/developer/v1/videos/generationsIdempotency-Key: your-stable-request-id{
"model": "happyhorse-1.1-r2v",
"motion_instruction": "参考角色走进花园",
"reference_urls": [
"https://example.com/character.png"
],
"resolution": "1080P",
"duration_seconds": 6,
"aspect_ratio": "4:5"
}POST /api/developer/v1/videos/generationsIdempotency-Key: your-stable-request-id{
"model": "happyhorse-1.0-video-edit",
"motion_instruction": "将视频改为水彩风格,保留动作",
"video_url": "https://example.com/source.mp4",
"reference_urls": [],
"resolution": "720P",
"audio_setting": "origin"
}Seedance 2.0 / 2.5 · GET /models · seedance_2_0 / seedance_2_5
Seedance 2.0 / 2.5 retain unified or controlled native asynchronous APIs, reference media and smart duration. Settlement uses actual usage.completion_tokens with video_token rates, never seconds or estimated tokens. Replace the example model name with an authorized GET /models name. 2.5 edit/extend remains unavailable.
Public model → official upstream model
Seedance 2.0 / 2.5 · GET /models · seedance_2_0 / seedance_2_5
Request examples (keep API keys server-side)
POST /api/developer/v1/videos/generationsIdempotency-Key: your-stable-request-id{
"model": "configured-seedance-example",
"motion_instruction": "跟随参考视频的镜头运动",
"reference_video_urls": [
"https://example.com/reference.mp4"
],
"resolution": "720p",
"smart_duration": true,
"audio": true
}wan3.0-video / wan3.0-video-prime
Wan3.0 and Prime retain multimodal references. New requests always use the selected model's acceptance price, not served_model repricing. Prime uses the Singapore official channel. Historical snapshots keep their original calculation; old second rates round usage.duration up. A new duration basis applies only after explicit administrator configuration.
Public model → official upstream model
wan3.0-video → wan3.0-videowan3.0-video-prime → wan3.0-video-prime
Request examples (keep API keys server-side)
POST /api/developer/v1/videos/generationsIdempotency-Key: your-stable-request-id{
"model": "wan3.0-video-prime",
"motion_instruction": "Image 1 中的人物走过花园",
"reference_urls": [
"https://example.com/character.png"
],
"capability": "image_reference",
"resolution": "720P",
"duration_seconds": 6,
"aspect_ratio": "16:9",
"audio": true
}Estimate hints (no future price lock)
POST /api/developer/v1/usage/estimate uses an API key, not a console login JWT. input_tokens, input_image_count and timezone-aware as_of are estimate hints only; they cannot control actual acceptance time or final usage. period, selection_basis and reserved_amount describe that estimate. input_tokens does not reduce the conservative hold.
{
"feature_key": "chat",
"model": "qwen3.7-plus",
"max_completion_tokens": 2048,
"input_tokens": 256001,
"as_of": "2026-11-24T12:00:00Z"
}{
"feature_key": "generate_shot_image",
"model": "qwen-image-3.0-pro",
"size": "auto",
"n": 2,
"input_image_count": 3
}Chat (OpenAI compatible)
/api/developer/openai/v1/chat/completionsChoose from text_models. Prices are USD per million tokens; Kimi also charges cache writes. v2 selects the band using the acceptance period and actual total input. Returns native JSON; X-Vivareel-Request-Id identifies the dr_ request.
Parameters
| name | in | type | required | desc |
|---|---|---|---|---|
| model | body | string | ✓ | — |
| messages | body | object[] | ✓ | — |
| max_tokens | body | integer | — | Output limit for official GLM/DeepSeek profiles; mutually exclusive with max_completion_tokens. New Kimi/Qwen profiles reject this field |
| max_completion_tokens | body | integer | — | Total output limit including reasoning and answer; used by Kimi/Qwen within model and route limits |
| thinking | body | object | — | DeepSeek supports enabled/disabled; GLM always uses enabled |
| reasoning_effort | body | string | — | GLM/Kimi support low/high/max; other models follow their official profile |
| enable_thinking | body | boolean | — | Thinking switch for new Qwen text profiles |
| thinking_budget | body | integer | — | Qwen reasoning budget; cannot exceed total output or be set while thinking is disabled |
| prompt_cache_options | body | object | — | Kimi only: implicit mode, default 5m; 1h requires its cache-write price. There is no cache-disable switch |
| stream | body | boolean | — | — |
Code Sample
curl -X POST "https://test-vivareel-backend.casgv.cn/api/developer/openai/v1/chat/completions" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Idempotency-Key: your-stable-request-id" \
-H "Content-Type: application/json" \
-d '{
"model": "cloud-text-example",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 128,
"stream": false
}'Request Body Example
{
"model": "cloud-text-example",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 128,
"stream": false
}Response Example
{
"id": "chatcmpl-example",
"object": "chat.completion",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 8,
"completion_tokens": 4,
"total_tokens": 12,
"prompt_tokens_details": {
"cached_tokens": 0
}
}
}Streaming chat (SSE)
/api/developer/openai/v1/chat/completionsstream=true returns SSE, not a single JSON response. Complete usage and [DONE] are required for settlement; missing data keeps funds reserved for reconciliation. Disconnecting does not cancel the upstream request or make it free.
Parameters
| name | in | type | required | desc |
|---|---|---|---|---|
| stream | body | boolean | ✓ | — |
Code Sample
curl -N -X POST "https://test-vivareel-backend.casgv.cn/api/developer/openai/v1/chat/completions" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Idempotency-Key: your-stable-request-id" \
-H "Content-Type: application/json" \
-d '{
"model": "cloud-text-example",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 128,
"stream": true,
"stream_options": {
"include_usage": true
}
}'Request Body Example
{
"model": "cloud-text-example",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 128,
"stream": true,
"stream_options": {
"include_usage": true
}
}Response Example
data: {"choices":[{"delta":{"content":"你好!"},"index":0}]}
data: {"choices":[],"usage":{"prompt_tokens":8,"completion_tokens":4,"total_tokens":12}}
data: [DONE]
Registered native submission
/api/developer/v1/providers/{channel_key}/{registered_submit_path}Only registered channels and submit paths are allowed; arbitrary URLs and query parameters are rejected. X-Vivareel-Model is the public model; body.model is the configured upstream model. Returns native JSON/SSE without code/data. Query the dr_ request for archived media URLs.
Parameters
| name | in | type | required | desc |
|---|---|---|---|---|
| channel_key | path | string | ✓ | — |
| registered_submit_path | path | string | ✓ | — |
| X-Vivareel-Model | header | string | ✓ | — |
| model | body | string | ✓ | — |
Code Sample
curl -X POST "https://test-vivareel-backend.casgv.cn/api/developer/v1/providers/{channel_key}/{registered_submit_path}" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Idempotency-Key: your-stable-request-id" \
-H "X-Vivareel-Model: cloud-text-example" \
-H "Content-Type: application/json" \
-d '{
"model": "configured-upstream-model",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 128
}'Request Body Example
{
"model": "configured-upstream-model",
"messages": [
{
"role": "user",
"content": "你好"
}
],
"max_tokens": 128
}Response Example
{
"choices": [
{
"message": {
"role": "assistant",
"content": "你好!"
}
}
],
"usage": {
"prompt_tokens": 8,
"completion_tokens": 4,
"total_tokens": 12
}
}Native task snapshot
/api/developer/v1/providers/{channel_key}/{registered_poll_path}Replace the registered poll path placeholder with the upstream task ID. Returns the worker's saved response for the current user, not a live upstream proxy. Extra query parameters are rejected. Response shape depends on the provider.
Parameters
| name | in | type | required | desc |
|---|---|---|---|---|
| channel_key | path | string | ✓ | — |
| registered_poll_path | path | string | ✓ | — |
Code Sample
curl -X GET "https://test-vivareel-backend.casgv.cn/api/developer/v1/providers/{channel_key}/{registered_poll_path}" \
-H "Authorization: Bearer sk_live_xxx"Response Example
{
"output": {
"task_id": "upstream-task-id",
"task_status": "RUNNING"
}
}Synchronous images (OpenAI Images)
/api/developer/openai/v1/images/generationsSupports SDK images.generate(), returning created/data/usage without a platform envelope. Enabled Qwen 3.0/2.1 and Seedream 5.0 Pro profiles validate capabilities: Qwen n=1–6, Seedream n=1 only. Legacy profiles reserve the requested count and charge successful outputs. Qwen 3.0 Pro v2 also charges input images from official usage; zero outputs do not mean a free request. Qwen size: WxH or auto; Seedream: 1K/1.5K/2K or WxH. Qwen 2.1 supports URL only; 3.0 and Seedream also support b64_json. No image streaming, mask or multipart. Limits: 1 MiB request, 16 MiB upstream JSON, including Base64 overhead; prefer URLs. Set client timeout to configured timeout plus 120 seconds. Replaying stored Base64 returns 409 and X-Vivareel-Request-Id; query that task for archived URLs.
Parameters
| name | in | type | required | desc |
|---|---|---|---|---|
| model | body | string | ✓ | Image model advertising the openai protocol in GET /models |
| prompt | body | string | ✓ | Non-empty image description |
| image | body | string | string[] | — | HTTP(S) or image Data URL, string or array; Qwen 3.0: up to 3; Qwen 2.1 and Seedream: up to 10. Cannot combine with reference_urls |
| n | body | integer | — | Strict integer; Qwen 1–6 within the route limit; Seedream 1 only |
| size | body | string | — | Model-supported size; mutually exclusive with image_resolution/aspect_ratio. Final size selects the price |
| response_format | body | url | b64_json | — | url or supported b64_json; prefer url |
Code Sample
curl -X POST "https://test-vivareel-backend.casgv.cn/api/developer/openai/v1/images/generations" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Idempotency-Key: your-stable-request-id" \
-H "Content-Type: application/json" \
-d '{
"model": "cloud-image-example",
"prompt": "一只可爱的猫咪",
"n": 1,
"size": "1024x1024",
"response_format": "url"
}'Request Body Example
{
"model": "cloud-image-example",
"prompt": "一只可爱的猫咪",
"n": 1,
"size": "1024x1024",
"response_format": "url"
}Response Example
{
"created": 1730000000,
"data": [
{
"url": "https://provider.example/image.png"
}
],
"usage": {
"output_image_count": 1
}
}Seedance video-token example
/api/developer/v1/videos/generationsDedicated asynchronous protocol, not OpenAI Videos. Supports 2.0/Fast/Mini/2.5. audio maps to generate_audio; defaults to 720p/adaptive. Duration: 2.0 4–15 seconds (default 5), 2.5 4–30 (default -1); smart_duration=true excludes explicit duration. Frame and reference modes cannot mix; a last frame requires a first frame. 2.5 frame mode requires adaptive; reference videos use reference, without edit/extend or seed. New profiles charge usage.completion_tokens / 1000000 × price × discount, with no extra total_tokens or minimum. Resolution and video input select pricing automatically. Reservation is a risk allowance, not an upstream hard cap. Missing usage or insufficient top-up balance enters reconciling.
Parameters
| name | in | type | required | desc |
|---|---|---|---|---|
| model | body | string | ✓ | — |
| motion_instruction | body | string | — | — |
| reference_video_urls | body | string[] | — | — |
| smart_duration | body | boolean | — | — |
| resolution | body | string | — | — |
| audio | body | boolean | — | — |
Code Sample
curl -X POST "https://test-vivareel-backend.casgv.cn/api/developer/v1/videos/generations" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Idempotency-Key: your-stable-request-id" \
-H "Content-Type: application/json" \
-d '{
"model": "configured-seedance-example",
"motion_instruction": "跟随参考视频的镜头运动",
"reference_video_urls": [
"https://example.com/reference.mp4"
],
"resolution": "720p",
"smart_duration": true,
"audio": true
}'Request Body Example
{
"model": "configured-seedance-example",
"motion_instruction": "跟随参考视频的镜头运动",
"reference_video_urls": [
"https://example.com/reference.mp4"
],
"resolution": "720p",
"smart_duration": true,
"audio": true
}Response Example
{
"code": 200,
"message": "ok",
"data": {
"task_id": "dr_0123456789abcdef0123456789abcdef"
}
}Asynchronous image generation
/api/developer/v1/images/generationsSubmit a cloud image request billed in USD. Returns a dr_ task_id. Supported parameters depend on the configured route; query GET /api/developer/v1/tasks/task_id for execution, billing and archive status.
Parameters
| name | in | type | required | desc |
|---|---|---|---|---|
| model | body | string | ✓ | Image model name; list available models via GET /models |
| prompt | body | string | ✓ | Text description of the image to generate |
| aspect_ratio | body | string | — | Legacy ratio alias converted to pixels with image_resolution; cannot combine with size |
| image_resolution | body | string | — | New Qwen/Seedream profiles accept legacy 1K/2K only, not 4K; generic profiles need explicit mapping |
| size | body | string | — | Images uses model sizes such as WxH/auto. Wan2.7 uses 1K/2K/4K or W*H; 4K requires no input images and non-sequential mode |
| n | body | integer | — | Within route limits: Qwen up to 6, Seedream 1; Wan2.7 regular 1–4, sequential 1–12 |
| response_format | body | url | b64_json | — | Images profiles only; prefer url. Not supported by Wan2.7 |
| reference_urls | body | string[] | — | Images maps this to image and forbids both together; Qwen Pro up to 3 inputs, Wan2.7 up to 9 |
| enable_sequential | body | boolean | — | Wan2.7 only: true enables sequential images; 4K is unavailable in this mode |
| thinking_mode | body | boolean | — | Wan2.7 only, without input images and without sequential mode |
| bbox_list | body | integer[][][] | — | Wan2.7 only: one entry per input image, at most two absolute pixel boxes [x1,y1,x2,y2] each |
| color_palette | body | object[] | — | Wan2.7 non-sequential mode only: 3–10 HEX colors; ratio is a two-decimal percentage, totaling 100.00% |
Code Sample
curl -X POST "https://test-vivareel-backend.casgv.cn/api/developer/v1/images/generations" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Idempotency-Key: your-stable-request-id" \
-H "Content-Type: application/json" \
-d '{
"model": "cloud-image-example",
"prompt": "一只可爱的猫咪在草地上奔跑",
"aspect_ratio": "16:9",
"image_resolution": "2K",
"reference_urls": [
"https://example.com/ref1.jpg"
]
}'Request Body Example
{
"model": "cloud-image-example",
"prompt": "一只可爱的猫咪在草地上奔跑",
"aspect_ratio": "16:9",
"image_resolution": "2K",
"reference_urls": [
"https://example.com/ref1.jpg"
]
}Response Example
{
"code": 200,
"message": "ok",
"data": {
"task_id": "dr_0123456789abcdef0123456789abcdef"
}
}Generate video
/api/developer/v1/videos/generationsSubmit a cloud video request billed in USD. Returns a dr_ task_id. These are unified input fields; actual modes and optional parameters depend on the configured upstream mapping, not every model supports them.
Parameters
| name | in | type | required | desc |
|---|---|---|---|---|
| model | body | string | ✓ | Cloud model name from GET /models with operation=video |
| motion_instruction | body | string | null | — | [Common / conditionally required] Prompt / motion instruction. Required for text-to-video, all-modal reference, editing, and extension. You can mention Image 1 / Video 1 / Audio 1 |
| aspect_ratio | body | 16:9 | 9:16 | 4:3 | 3:4 | 1:1 | 4:5 | 5:4 | 9:21 | 21:9 | null | — | Model-specific. HappyHorse T2V/R2V also supports 1:1, 4:5, 5:4, 9:21 and 21:9; I2V and editing reject this field |
| duration_seconds | body | integer | null | — | HappyHorse generation: 3–15 seconds; editing rejects duration. Seedance 2.0: 4–15, 2.5: 4–30, -1 for smart duration. Billing uses the accepted snapshot and official usage |
| capability | body | first_frame | flf2v | image_reference | null | — | first_frame, flf2v or image_reference. Explicitly supply the capability when pricing depends on it; price bands are not inferred. |
| image_url | body | string | null | — | [Common / mode-specific] First-frame image URL for first_frame / flf2v. Do not send with reference_* fields |
| last_frame_url | body | string | null | — | [Common / mode-specific] Last-frame image URL for flf2v. Must be used with image_url and must not be the same image. Not supported by HappyHorse |
| reference_urls | body | string[] | — | Reference image URLs: HappyHorse R2V requires 1–9, editing permits 0–5; cannot mix with first-frame mode |
| reference_video_urls | body | string[] | — | [Multi-model] Seedance / Wan3 semantics / Wan2.7 R2V / VivaReel2.0. Reference video URLs |
| reference_audio_urls | body | string[] | — | [Multi-model] Seedance / Wan3 semantics / Wan2.7 R2V / minimax-H3. Reference audio URLs |
| resolution | body | 480P | 720P | 1080P | null | — | [Wan3 semantics] Output resolution: 480P, 720P, or 1080P |
| audio | body | boolean | null | — | [Wan3 semantics] Whether to generate audio |
| seed | body | integer | null | — | [Wan3 semantics] Random seed for reproducible results |
| watermark | body | boolean | null | — | [dashscope-wan3.0-video only] Whether to add a watermark |
| prompt_extend | body | boolean | null | — | [Wan3 semantics] Whether to expand the prompt |
| smart_duration | body | boolean | — | [Wan3 semantics] Smart duration; default false |
| document_url | body | string | null | — | [dashscope-wan3.0-video only] Document reference URL |
| web_url | body | string | null | — | [dashscope-wan3.0-video only] Web page reference URL |
| video_url | body | string | null | — | Exactly one source video URL for HappyHorse editing, using operation=video, not character replacement. Client-reported duration is not billing evidence |
| audio_setting | body | auto | origin | null | — | HappyHorse editing only: auto or origin, default auto |
Code Sample
curl -X POST "https://test-vivareel-backend.casgv.cn/api/developer/v1/videos/generations" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Idempotency-Key: your-stable-request-id" \
-H "Content-Type: application/json" \
-d '{
"model": "cloud-video-example",
"motion_instruction": "Video 1 sits on the chair in Image 2 and sings. Image 1 walks over, places Image 3 on the table, and says: the sunshine is so nice today.",
"aspect_ratio": "9:16",
"duration_seconds": 8,
"capability": "image_reference",
"reference_urls": [
"https://example.com/character.jpg",
"https://example.com/chair.jpg",
"https://example.com/prop.jpg"
],
"reference_video_urls": [
"https://example.com/performance.mp4"
],
"resolution": "720P",
"audio": true,
"prompt_extend": true,
"smart_duration": false
}'Request Body Example
{
"model": "cloud-video-example",
"motion_instruction": "Video 1 sits on the chair in Image 2 and sings. Image 1 walks over, places Image 3 on the table, and says: the sunshine is so nice today.",
"aspect_ratio": "9:16",
"duration_seconds": 8,
"capability": "image_reference",
"reference_urls": [
"https://example.com/character.jpg",
"https://example.com/chair.jpg",
"https://example.com/prop.jpg"
],
"reference_video_urls": [
"https://example.com/performance.mp4"
],
"resolution": "720P",
"audio": true,
"prompt_extend": true,
"smart_duration": false
}Response Example
{
"code": 200,
"message": "ok",
"data": {
"task_id": "dr_0123456789abcdef0123456789abcdef"
}
}Replace character in video
/api/developer/v1/videos/replace-characterSubmit a character-replacement task with 1–3 source videos and 1–9 reference images. Returns task_id; poll GET /api/developer/v1/tasks/task_id for result_url.
Parameters
| name | in | type | required | desc |
|---|---|---|---|---|
| video_urls | body | string[] | ✓ | Source video URLs (1–3), must be http(s) links |
| reference_urls | body | string[] | ✓ | Reference image URLs (1–9), must be http(s) links |
| prompt | body | string | ✓ | Replacement prompt describing the desired swap |
| resolution | body | string | — | Output resolution; default 720P |
| aspect_ratio | body | string | — | Aspect ratio; default 9:16 |
| model | body | string | ✓ | Required: a model with operation=replace from GET /models. No default fallback. |
| duration_seconds | body | number | — | Requested duration in seconds, not auto-detected. Funds are conservatively reserved using the route maximum. |
| seed | body | integer | — | Random seed for reproducible results |
| watermark | body | boolean | — | Upstream watermark option; the platform adds none and does not remove upstream watermarks |
Code Sample
curl -X POST "https://test-vivareel-backend.casgv.cn/api/developer/v1/videos/replace-character" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Idempotency-Key: your-stable-request-id" \
-H "Content-Type: application/json" \
-d '{
"video_urls": [
"https://example.com/video1.mp4"
],
"reference_urls": [
"https://example.com/face1.jpg",
"https://example.com/face2.jpg"
],
"prompt": "将视频中的人物替换为参考图中的人物,保持表情和动作自然",
"resolution": "720P",
"aspect_ratio": "9:16",
"model": "cloud-replace-example",
"duration_seconds": 10.5,
"seed": 12345,
"watermark": false
}'Request Body Example
{
"video_urls": [
"https://example.com/video1.mp4"
],
"reference_urls": [
"https://example.com/face1.jpg",
"https://example.com/face2.jpg"
],
"prompt": "将视频中的人物替换为参考图中的人物,保持表情和动作自然",
"resolution": "720P",
"aspect_ratio": "9:16",
"model": "cloud-replace-example",
"duration_seconds": 10.5,
"seed": 12345,
"watermark": false
}Response Example
{
"code": 200,
"message": "ok",
"data": {
"task_id": "dr_0123456789abcdef0123456789abcdef"
}
}Get task status
/api/developer/v1/tasks/{task_id}Use an API Key and poll the platform task_id every 3–5 seconds. HTTP 200 only confirms the lookup succeeded. Check status, billing_status and archive_status separately. upstream_id is the nullable vendor task ID; upstream_http_status is the latest recorded upstream HTTP status. On reconciling, stop automatic resubmission and contact an administrator. completed does not guarantee archiving is complete.
Parameters
| name | in | type | required | desc |
|---|---|---|---|---|
| task_id | path | string | ✓ | Platform task ID returned on submission; never substitute upstream_id |
Code Sample
curl -X GET "https://test-vivareel-backend.casgv.cn/api/developer/v1/tasks/{task_id}" \
-H "Authorization: Bearer sk_live_xxx"Response Example
{
"code": 200,
"message": "ok",
"data": {
"task_id": "dr_0123456789abcdef0123456789abcdef",
"upstream_id": null,
"upstream_http_status": 200,
"task_type": "image",
"model": "qwen-image-3.0-pro",
"status": "completed",
"progress": 1,
"points_cost": null,
"billing_currency": "USD",
"reserved_amount": "0.0500000000",
"amount_cost": "0.0400000000",
"billing_status": "consumed",
"archive_status": "completed",
"usage": {
"quantity": 1,
"input_image_count": 1,
"resolution": "1k"
},
"billing_details": {
"schema_version": 2,
"price_version": 2,
"accepted_at": "2026-11-24T12:00:00Z",
"period": "base",
"unit": "image",
"resolution": "1k",
"discount": "1",
"amount": "0.0400000000",
"quantities": {
"quantity": 1,
"input_image_count": 1
},
"components": [
{
"name": "output_images",
"quantity": "1",
"unit_price": "0.0300000000",
"per_units": 1,
"amount_before_discount": "0.0300000000"
},
{
"name": "input_images",
"quantity": "1",
"unit_price": "0.0100000000",
"per_units": 1,
"amount_before_discount": "0.0100000000"
}
]
},
"results": [
{
"url": "https://storage.vivareel.com/output/xxx.png"
}
],
"result_url": "https://storage.vivareel.com/output/xxx.png",
"error_message": null
}
}Upload file
/api/developer/v1/filesUpload a file to storage and receive a referenceable URL. Use for first-frame images, reference images, reference videos, or reference audio (Content-Type: multipart/form-data).
Parameters
| name | in | type | required | desc |
|---|---|---|---|---|
| file | formData | file | ✓ | File to upload (image, video, audio, etc.) |
Code Sample
curl -X POST "https://test-vivareel-backend.casgv.cn/api/developer/v1/files" \
-H "Authorization: Bearer sk_live_xxx" \
-F "file=@/path/to/file.png"Response Example
{
"code": 200,
"message": "ok",
"data": {
"url": "https://storage.vivareel.com/uploads/xxx.jpg",
"storage_key": "uploads/2024/01/xxx.jpg",
"original_filename": "my_image.jpg",
"size_bytes": 204800,
"content_type": "image/jpeg"
}
}List models
/api/developer/v1/modelsLists only authorized, enabled, valid routes; templates do not mean availability. pricing preserves version, schedule and bands; amounts are strings and examples are not live quotes. profile/upstream_model describe the protocol mapping; billing_dimensions lists effective price fields. limits gives protocol limits, still subject to configured price bands. max_duration_seconds is a reservation bound, not an allowed output duration.
Parameters
None
Code Sample
curl -X GET "https://test-vivareel-backend.casgv.cn/api/developer/v1/models" \
-H "Authorization: Bearer sk_live_xxx"Response Example
{
"code": 200,
"message": "ok",
"data": {
"image_models": [
{
"name": "qwen-image-3.0-pro",
"operation": "image",
"billing_currency": "USD",
"pricing": {
"schema_version": 2,
"schedule": null,
"bands": [
{
"unit": "image",
"resolution": "1k",
"price": "0.0300000000",
"input_image_price": "0.0100000000"
},
{
"unit": "image",
"resolution": "2k",
"price": "0.0400000000",
"input_image_price": "0.0100000000"
}
]
},
"discount_rate": "1",
"protocols": [
"unified",
"native",
"openai"
],
"profile": "qwen_image_3_0_pro",
"upstream_model": "qwen-image-3.0-pro",
"billing_dimensions": [
"input_image_price",
"price",
"resolution",
"unit"
],
"limits": {
"timeout_seconds": 600,
"max_images": 6,
"max_input_images": 3
},
"request_max_bytes": 1048576
}
],
"video_models": [
{
"name": "configured-seedance-example",
"operation": "video",
"billing_currency": "USD",
"pricing": {
"bands": [
{
"unit": "video_token",
"price": "2.0000000000",
"resolution": "720p",
"video_input": null
}
]
},
"discount_rate": "1",
"protocols": [
"unified",
"native"
]
}
],
"text_models": [
{
"name": "qwen3.7-plus",
"operation": "chat",
"billing_currency": "USD",
"pricing": {
"schema_version": 2,
"schedule": null,
"bands": [
{
"unit": "token",
"period": "base",
"input_tokens_min": 0,
"input_tokens_max": 256000,
"input_price": "1.0000000000",
"output_price": "2.0000000000",
"cached_price": "0.2000000000"
},
{
"unit": "token",
"period": "base",
"input_tokens_min": 256001,
"input_tokens_max": 1000000,
"input_price": "2.0000000000",
"output_price": "4.0000000000",
"cached_price": "0.4000000000"
}
]
},
"discount_rate": "1",
"protocols": [
"openai",
"native"
],
"profile": "qwen3_7_plus",
"upstream_model": "qwen3.7-plus",
"billing_dimensions": [
"cached_price",
"input_price",
"input_tokens_max",
"input_tokens_min",
"output_price",
"unit"
],
"limits": {
"timeout_seconds": 120,
"context_window": 1000000,
"max_output_tokens": 131072,
"default_output_tokens": 1024,
"output_limit_parameter": "max_completion_tokens"
},
"request_max_bytes": 1048576
}
]
}
}Virtual portrait library
Add a public https portrait to the virtual portrait library for the current channel, then pass that same https URL when generating video. Do not send asset://.
Before you call
- Authenticate with an API Key. Do not send X-Team-Id or channel. The channel comes only from the backend portrait_channel setting: byteplus is the official library, baidu is the Baidu library.
- The image must be a public https URL. When generating video, pass that same https URL. Do not pass asset://.
- Call order: upload the file to get a URL, sync it into the library, check status when needed, generate video with the same URL, then remove it when you no longer need it.
- message follows Accept-Language. The examples below are in Chinese.
Errors
| code | When |
|---|---|
| 400 | image_url is not a public https URL, or the image is not in the current channel's library. |
| 403 | The user behind the API Key is not VIP or SVIP. |
| 404 | The image was not found when removing it. |
| 502 | The official or Baidu create or remove call failed. message includes the upstream text. |
| 503 | Credentials for the current channel are not configured. |
| 504 | Sync timed out. |
Channel switch
After the backend switches the channel from Baidu to official, or back from official to Baidu, call sync again for the same image.
Sync a portrait
/api/developer/v1/virtual-assets/syncAdd an image to the current channel's virtual portrait library. The call waits until sync succeeds or fails. An image that is already Active on the current channel is not uploaded again. data.outcome is created for a new upload, already_active when it is already in the library, or reused when the same image is already linked and was not uploaded again. On success, in_virtual_asset_library is true.
Parameters
| name | in | type | required | desc |
|---|---|---|---|---|
| image_url | body | string | ✓ | Public https image URL |
| name | body | string | — | Display name. Optional. |
Code Sample
curl -X POST "https://test-vivareel-backend.casgv.cn/api/developer/v1/virtual-assets/sync" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"image_url": "https://cdn.example/a.png",
"name": "角色甲"
}'Request Body Example
{
"image_url": "https://cdn.example/a.png",
"name": "角色甲"
}Response Example
{
"code": 200,
"message": "已加入 Seedance 虚拟资产库",
"data": {
"asset_id": 321,
"image_url": "https://cdn.example/a.png",
"in_virtual_asset_library": true,
"outcome": "created"
},
"pagination": null
}Check portrait status
/api/developer/v1/virtual-assets/statusCheck whether image URLs are Active in the current channel's virtual portrait library. Active on the official library does not make the result true under the Baidu channel. asset_id is null when a URL does not match.
Parameters
| name | in | type | required | desc |
|---|---|---|---|---|
| urls | body | string[] | ✓ | Image URLs, from 1 to 200 |
Code Sample
curl -X POST "https://test-vivareel-backend.casgv.cn/api/developer/v1/virtual-assets/status" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"urls": [
"https://cdn.example/a.png"
]
}'Request Body Example
{
"urls": [
"https://cdn.example/a.png"
]
}Response Example
{
"code": 200,
"message": "获取资产 URL 状态成功",
"data": [
{
"url": "https://cdn.example/a.png",
"in_virtual_asset_library": true,
"asset_id": 321
}
],
"pagination": null
}Remove a portrait
/api/developer/v1/virtual-assets/removeRemove the record for the current channel only. The official channel clears official asset fields. The Baidu channel deletes only the Baidu binding and leaves official fields unchanged. The local image record stays, so you can sync it again after switching back. in_virtual_asset_library is false after removal.
Parameters
| name | in | type | required | desc |
|---|---|---|---|---|
| image_url | body | string | ✓ | Public https image URL to remove |
Code Sample
curl -X POST "https://test-vivareel-backend.casgv.cn/api/developer/v1/virtual-assets/remove" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"image_url": "https://cdn.example/a.png"
}'Request Body Example
{
"image_url": "https://cdn.example/a.png"
}Response Example
{
"code": 200,
"message": "已移出 Seedance 虚拟资产库",
"data": {
"asset_id": 321,
"image_url": "https://cdn.example/a.png",
"in_virtual_asset_library": false
},
"pagination": null
}