Viral video remake
Introduction
Capability key: video.edit · API origin: https://api.anycap.io
Viral video remake renders a new video from a source video you own. The platform keeps the source motion, camera work, composition and timing, and applies your editing instruction together with target reference images, reference videos and reference audio: replace a person, a product, an object or a background, or transfer a consistent style. It is an asynchronous task: submit once, then read the durable task state until it completes.
Unified API (recommended)
New integrations call POST /v1/generations with type=video_edit. The /v1/videos/edits endpoints below remain supported for compatibility.
curl -X POST https://api.anycap.io/v1/generations \ -H "Authorization: Bearer $ANYCAP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "type": "video_edit", "model": "<model from GET /v1/generations/models?type=video_edit>", "input": { "video_file_id": "<owned source video id>", "prompt": "replace the product on the table, keep the camera move" }, "parameters": { "resolution": "480P", "ratio": "adaptive" } }'input.video_file_id
POST /v1/video-materials?kind=video first.input.prompt
图1, 参考视频1.input.reference_*_file_ids
parameters
resolution, ratio, duration.1. Setup
- Create a connection key in the console under Agent Access and authorize the editing capability.
- Upload the source video, reference videos, reference audio and reference images to
POST /v1/video-materials?kind=video|audio|imagewith a multipartfilefield. The upload is retained for 72 hours. The source video must be an Anycap-owned upload no longer than 15 seconds; public URLs are not accepted for the source video. Use the returnedidasvideo_file_idor a reference file id. - Every request uses
Authorization: Bearer <ANYCAP_API_KEY>andContent-Type: application/json. Never send Cookie or Origin, and never reuse a browser session. - There is one discovery surface: query
GET /v1/videos/models?capability=video.edit. It returns the editing models with their own prices and limits; create with one of thosemodelvalues. Never invent model names or prices.
curl -X POST "https://api.anycap.io/v1/video-materials?kind=video" \ -H "Authorization: Bearer $ANYCAP_API_KEY" \ -F "[email protected]"2. Endpoints
| Step | Method | Path | Success |
|---|---|---|---|
| Model discovery | GET | /v1/videos/models?capability=video.edit | 200 |
| Upload owned media | POST | /v1/video-materials?kind=video | 201 |
| Create an editing task | POST | /v1/videos/edits | 202 |
| Read a task | GET | /v1/videos/edits/{id} | 200 |
| Read a task and fetch the result URL | GET | /v1/videos/edits/{id}?result=true | 200 |
| Cancel a task not yet submitted upstream | DELETE | /v1/videos/edits/{id} | 200 |
prompt is the editing instruction: describe what to replace, restyle or keep in the source video.
3. Create a task
Example:
curl -X POST https://api.anycap.io/v1/videos/edits \ -H "Authorization: Bearer $ANYCAP_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: remake-7f4c2b1a" \ -d '{ "model": "doubao-seedance-2-0-mini-260615", "video_file_id": "<source video file id>", "prompt": "replace the product on the table with the target product, keep the camera move", "resolution": "720P", "ratio": "original", "reference_image_urls": ["https://cdn.example.com/target-product.png"] }'modelYes
field=model, never a silent substitution.video_file_idYes
POST /v1/video-materials?kind=video; it must be unexpired and no longer than 15 seconds.promptYes
max_prompt_characters; an empty prompt is rejected.resolutionNo
480P, 720P or 1080P. 4K is not offered and returns 400.ratioNo
original and adaptive both keep the source video's ratio.durationNo
min_duration (4 s for Seedance 2.x) and never above its maximum. Omit it to follow the source video's length.reference_image_urlsNo
reference_image_file_idsNo
reference_image_urls, the source's max_reference_images (1–30) is the effective limit.reference_video_file_idsNo
max_reference_videos caps the count, each clip must be at least 2 seconds, and the source plus all reference videos must stay within max_total_video_seconds.reference_audio_file_idsNo
max_reference_audios caps the count, each clip must be between audio_min_seconds and audio_max_seconds, and all audio must stay within max_total_audio_seconds.idempotency_keyNo
Idempotency-Key header takes precedence. A repeated key returns the recorded job and never resubmits.Every model entry publishes input_types plus max_reference_images, max_reference_videos, max_reference_audios, audio_min_seconds, audio_max_seconds, max_total_video_seconds and max_total_audio_seconds; a request outside the chosen model's limits is rejected with 400 before submission.
- The source video is the edit input and counts toward
max_total_video_seconds; additional reference videos are capped separately bymax_reference_videos. - Reference videos must each be at least 2 seconds and are measured with the source video before pricing.
- Each reference audio must be between
audio_min_secondsandaudio_max_seconds; all audio is summed againstmax_total_audio_seconds. - Reference videos and audio must be Anycap-owned uploads from
POST /v1/video-materials?kind=video|audio, unexpired: only their measured seconds can be billed. Owned reference images must be JPG, WebP or BMP (PNG is not accepted); public HTTPS image URLs are also accepted.
4. Task state and result
- The create response is
202and returns the durable job withstateandbilling_status.202does not prove upstream success or settled billing. - Poll
GET /v1/videos/edits/{id}. A task moves throughqueued,submitting,submitted,processingandfinalizingtocompleted,failedorpending. - Send
?result=trueonly when you need the output URL. It re-queries the provider and never recharges or regenerates. The URL is temporary and provider-hosted; download and store it yourself if you need it long-term. DELETEcancels only a task still queued before any billable upstream call and releases its reservation exactly once. The editing operator publishes no cancellation, so a job already in flight returns 409 and keeps its reservation for reconciliation.
5. Errors
| Status | Meaning |
|---|---|
| 400 | Invalid request: missing video_file_id, an empty prompt or an unknown model, 4K, or a reference value, count or duration outside the selected source's limits. Nothing is submitted or charged. |
| 401 | Missing or invalid connection key. |
| 403 | The key is not authorized for this source or capability. |
| 409 | Idempotency or quote conflict, or a task that is no longer cancellable. |
| 503 | No authorized, enabled and priced editing source matched, or the platform is temporarily unavailable. |