cURL
Python
JavaScript
Go
Java
PHP
Ruby
Swift
C#
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan2.7-videoedit",
"video_urls": ["https://cdn.example.com/original.mp4"],
"prompt": "Replace the background with a snowy mountain scene",
"resolution": "1080P"
}'
{
"code" : 200 ,
"data" : [
{
"status" : "submitted" ,
"task_id" : "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
Authorization
All API endpoints require Bearer Token authentication Get your API Key: Visit the API Key Management Page to get your API Key Add it to the request header: Authorization: Bearer YOUR_API_KEY
Request Parameters
Video generation model name, fixed as wan2.7-videoedit
Source video URL array for editing Only the 1st video is used
Video constraints:
Format: mp4, mov
Duration: 2–10s
Resolution: width and height in the range [240, 4096] pixels
Aspect ratio: 1:8 – 8:1
File size: up to 100MB
Editing instruction describing the desired changes, up to 5000 characters If omitted, the model performs a default style transfer
Example: "Change the character's outfit to a red gown", "Replace the background with a snowy mountain scene"
Negative prompt describing unwanted content, up to 500 characters
Reference image URL array, up to 4 images Used to specify the target style or appearance (e.g., reference style for style transfer)
Output video resolution Options:
720P - Standard
1080P - High definition (default)
Output video duration (seconds)
0 (default): keep the full original video duration
Integer between 2-10: take the specified duration from the start
When duration=0, billing is based on the actual duration of the output video The specified duration cannot exceed the duration of the original video_urls video
Output aspect ratio Supported formats:
16:9 - Landscape widescreen
9:16 - Portrait
1:1 - Square
4:3 - Landscape
3:4 - Portrait
If omitted, the aspect ratio matches the input video
Whether to enable intelligent prompt rewriting Significantly improves results for short prompts, but increases processing time Default: true
Whether to add “AI Generated” watermark to the generated video
true: add watermark
false: no watermark (default)
Seed integer used to control the randomness of generated content Value range: integer ≥0
For identical requests, the model generates different results when receiving different seed values (e.g., omitting seed)
For identical requests, the model generates similar results when receiving the same seed value, but exact consistency is not guaranteed
Additional parameter object Audio handling mode:
auto (default): AI automatically regenerates matching audio based on the edited video content
origin: force keep the original video audio, suitable for videos with important background sounds/dialogue
Response
Response status code, 200 on success
Response data array Task status, submitted when initially submitted
Use Cases
Case 1: Basic Video Editing (Simplest)
{
"model" : "wan2.7-videoedit" ,
"video_urls" : [ "https://cdn.example.com/original.mp4" ],
"prompt" : "Replace the background with a snowy mountain scene"
}
Case 2: Style Transfer (With Reference Image)
{
"model" : "wan2.7-videoedit" ,
"prompt" : "Transfer the video style to the anime style of the reference image" ,
"video_urls" : [ "https://cdn.example.com/original.mp4" ],
"image_urls" : [
"https://cdn.example.com/anime_style.jpg"
],
"resolution" : "1080P" ,
"watermark" : false
}
Case 3: Keep Original Video Audio
Suitable for videos with important background sound or dialogue:
{
"model" : "wan2.7-videoedit" ,
"video_urls" : [ "https://cdn.example.com/speech.mp4" ],
"prompt" : "Replace the background with a mountain path" ,
"metadata" : { "audio_setting" : "origin" }
}
Case 4: Full Parameters
{
"model" : "wan2.7-videoedit" ,
"prompt" : "Change the character's outfit to a red gown" ,
"negative_prompt" : "blurry, distorted" ,
"video_urls" : [ "https://cdn.example.com/original.mp4" ],
"image_urls" : [ "https://cdn.example.com/reference.jpg" ],
"resolution" : "1080P" ,
"duration" : 0 ,
"size" : "16:9" ,
"prompt_extend" : true ,
"watermark" : false ,
"seed" : 888 ,
"metadata" : {
"audio_setting" : "origin"
}
}
Audio Handling
audio_setting Description Suitable Scenarios auto (default)AI regenerates matching audio based on the edited video content Major visual style changes where you want audio to update accordingly originForce keep the original video audio track Videos with important background music or dialogue
Query Task Results Video generation is an async task that returns a task_id upon submission. Use the Get Task Status endpoint to query generation progress and results.