Skip to main content
POST
/
v1
/
videos
/
generations
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"
    }
  ]
}
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

Authorization
string
required
All API endpoints require Bearer Token authenticationGet your API Key:Visit the API Key Management Page to get your API KeyAdd it to the request header:
Authorization: Bearer YOUR_API_KEY

Request Parameters

model
string
required
Video generation model name, fixed as wan2.7-videoedit
video_urls
array<string>
required
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
prompt
string
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
string
Negative prompt describing unwanted content, up to 500 characters
image_urls
array<string>
Reference image URL array, up to 4 imagesUsed to specify the target style or appearance (e.g., reference style for style transfer)
resolution
string
default:"1080P"
Output video resolutionOptions:
  • 720P - Standard
  • 1080P - High definition (default)
duration
integer
default:"0"
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 videoThe specified duration cannot exceed the duration of the original video_urls video
size
string
Output aspect ratioSupported 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
prompt_extend
boolean
default:"true"
Whether to enable intelligent prompt rewritingSignificantly improves results for short prompts, but increases processing timeDefault: true
watermark
boolean
default:"false"
Whether to add “AI Generated” watermark to the generated video
  • true: add watermark
  • false: no watermark (default)
seed
integer
Seed integer used to control the randomness of generated contentValue 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
metadata
object
Additional parameter object

Response

code
integer
Response status code, 200 on success
data
array
Response data array

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_settingDescriptionSuitable Scenarios
auto (default)AI regenerates matching audio based on the edited video contentMajor visual style changes where you want audio to update accordingly
originForce keep the original video audio trackVideos with important background music or dialogue
Query Task ResultsVideo generation is an async task that returns a task_id upon submission. Use the Get Task Status endpoint to query generation progress and results.