Pruna AI P Video Edit API Documentation
Playground
Try it on WaveSpeedAI!Pruna P-Video-Edit is an instruction-based video editing model for modifying subjects, objects, attributes, and environments in existing videos, with optional reference-image guidance and Draft or Full quality modes. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.
Features
Pruna AI P-Video Edit edits an existing video using natural-language instructions. Upload a source video, describe the changes you want, and optionally add reference images to guide identity, appearance, style, object edits, or scene transformation.
Why Choose This?
-
Instruction-based video editing
Edit videos with natural-language prompts instead of building a manual editing workflow. -
Flexible visual changes
Modify attributes, transform objects, adjust environments, or restyle a scene while preserving the source video’s motion and structure. -
Reference-guided editing
Add up to 4 reference images to guide identity, appearance, object design, or visual style. -
Draft and Full modes
Use Draft mode for faster, lower-cost previews, or Full mode for higher-quality edits. -
Audio preservation
Preserve the source video’s audio in the edited result withsave_audio.
Parameters
| Parameter | Required | Description |
|---|---|---|
| video | Yes | Source video to edit. Maximum input length: 15 seconds. |
| prompt | Yes | Natural-language instructions describing the requested video changes. |
| images | No | Optional reference images for guided editing. Supports up to 4 JPG, JPEG, PNG, or WebP images. |
| prompt_upsampling | No | Expand and optimize the editing prompt. Default: true. |
| draft | No | Enable faster, lower-cost Draft mode. Default: false. |
| save_audio | No | Preserve the source video’s audio in the result. Default: true. |
| seed | No | Random seed for reproducible results. If omitted, the upstream model chooses a random seed. |
How to Use
- Upload a source video — Provide a clip no longer than
15seconds. - Write the edit prompt — Describe what should change and what should remain consistent.
- Add reference images optional — Provide up to 4 images when identity, style, product, or object appearance matters.
- Choose Draft or Full mode — Use Draft mode for quick previews or Full mode for higher-quality output.
- Choose audio behavior — Keep
save_audioenabled when the source audio should be preserved. - Set seed optional — Use a fixed seed when reproducibility is needed.
- Submit — Generate the edited video and retrieve the output URL.
Pricing
Pricing is based on the source video duration and selected mode.
Billing duration is rounded up to the next whole second, with a minimum billed duration of 1 second and a maximum billed duration of 15 seconds.
| Mode | Price per billed second |
|---|---|
| Full | $0.045 |
| Draft | $0.025 |
Example Costs
| Input Duration | Billed Duration | Full | Draft |
|---|---|---|---|
| 0.5s | 1s | $0.045 | $0.025 |
| 6.13s | 7s | $0.315 | $0.175 |
| 15s | 15s | $0.675 | $0.375 |
images, prompt_upsampling, save_audio, and seed do not add separate charges.
Best Use Cases
- Attribute editing — Change clothing, materials, colors, lighting, or visual traits.
- Object modification — Replace, transform, add, or restyle objects in a scene.
- Environment replacement — Move an existing performance into a different location, season, time of day, or visual atmosphere.
- Reference-guided edits — Use images to guide identity, object appearance, product design, or visual style.
- Creative iteration — Generate Draft previews before producing a Full-quality result.
- Social and marketing video edits — Adapt short clips for ads, product showcases, and creative campaigns.
Pro Tips
- Clearly describe both what should change and what should remain consistent.
- Use reference images when identity, product details, object design, or style consistency matters.
- Use Draft mode for fast iteration before running a Full edit.
- Keep prompts focused on one main edit direction for more stable results.
- Preserve
save_audio=truewhen the original soundtrack, dialogue, or ambience should remain. - Use short, clean source videos with clear subjects and stable motion.
- Set a fixed
seedwhen comparing prompt or reference-image changes.
Notes
videoandpromptare required.- The input video can be up to
15seconds long. imagesis optional and supports up to4reference images.- Defaults:
prompt_upsampling=true,draft=false, andsave_audio=true. - The completed prediction returns the edited video as a URL in
outputs. - This endpoint does not expose output resolution, frame rate, duration, output format, or translation controls.
Related Models
- Pruna AI P-Image Ideogram — Generate images with prompt-based visual and typography control.
- Pruna AI P-Video Replace — Replace or transform video elements with prompt and reference guidance.
- Pruna AI P-Image Edit — Edit images with natural-language instructions and reference inputs.
Authentication
For authentication details, please refer to the Authentication Guide.
API Endpoints
Submit Task & Query Result
set -euo pipefail
export WAVESPEED_API_KEY="your-api-key"
REQUEST_BODY=$(cat <<'JSON'
{
"video": "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4",
"prompt": "A cinematic ocean wave at sunrise, highly detailed",
"prompt_upsampling": true,
"draft": false,
"save_audio": true
}
JSON
)
# 1. Submit the prediction.
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
-X POST "https://api.wavespeed.ai/api/v3/pruna-ai/p-video/edit" \
-H "Authorization: Bearer ${WAVESPEED_API_KEY}" \
-H "Content-Type: application/json" \
-d "${REQUEST_BODY}")
TASK=$(printf '%s' "${SUBMIT_RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
PREDICTION_ID=$(printf '%s' "${TASK}" | jq -r '.id // empty')
if [ -z "${PREDICTION_ID}" ]; then
printf 'Submission response did not contain a prediction id
' >&2
exit 1
fi
RESULT_URL="https://api.wavespeed.ai/api/v3/predictions/${PREDICTION_ID}/result"
# 2. Poll until the prediction finishes.
while true; do
RESPONSE=$(curl --silent --show-error --fail-with-body \
"${RESULT_URL}" \
-H "Authorization: Bearer ${WAVESPEED_API_KEY}")
RESULT=$(printf '%s' "${RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
STATUS=$(printf '%s' "${RESULT}" | jq -r '.status // empty')
case "${STATUS}" in
completed) printf '%s\n' "${RESULT}" | jq '.outputs'; break ;;
failed|cancelled|timeout|deleted) printf '%s\n' "${RESULT}" | jq . >&2; exit 1 ;;
*) sleep 2 ;;
esac
doneParameters
Task Submission Parameters
Request Parameters
| Parameter | Type | Required | Default | Range | Description |
|---|---|---|---|---|---|
| video | string | Yes | - | Source video to edit. The input video can be up to 15 seconds long. | |
| prompt | string | Yes | - | Natural-language instructions describing the changes to apply to the video. | |
| images | array<string> | No | - | 0 ~ 4 items | Optional reference images for guided editing. Supports up to 4 JPG, JPEG, PNG, or WebP images. |
| prompt_upsampling | boolean | No | true | - | Whether the model should expand and optimize the editing prompt. |
| draft | boolean | No | false | - | Enable faster, lower-cost Draft mode. |
| save_audio | boolean | No | true | - | Preserve the source video's audio in the edited output. |
| seed | integer | No | - | - | Random seed for reproducible results. If omitted, the upstream model generates a random seed. |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | integer | HTTP status code (e.g., 200 for success) |
| message | string | Status message (e.g., “success”) |
| data.id | string | Unique identifier for the prediction, Task Id |
| data.model | string | Model ID used for the prediction |
| data.outputs | array | Output values, usually URL strings; some models return text strings or structured result objects (empty when status is not completed) |
| data.urls | object | Object containing related API endpoints |
| data.status | string | Task status. completed is successful; failed, cancelled, timeout, and deleted are failure terminal statuses. |
| data.created_at | string | ISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”) |
| data.error | string | Error message (empty if no error occurred) |
| data.timings | object | Object containing timing details |
| data.timings.inference | integer | Inference time in milliseconds |
Result Request Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| id | string | Yes | - | Task ID |
Result Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | integer | HTTP status code (e.g., 200 for success) |
| message | string | Status message (e.g., “success”) |
| data | object | The prediction data object containing all details |
| data.id | string | Unique identifier for the prediction |
| data.model | string | Model ID used for the prediction |
| data.outputs | array<string | object> | Array of generated outputs (empty when status is not completed). Items are usually URL strings, but may be text strings or structured result objects, depending on the model. |
| data.urls | object | Object containing related API endpoints |
| data.status | string | Status: completed is successful; failed, cancelled, timeout, and deleted are failure terminal statuses |
| data.created_at | string | ISO timestamp of when the request was created |
| data.error | string | Error message (empty if no error occurred) |
| data.timings | object | Object containing timing details |
| data.timings.inference | integer | Inference time in milliseconds |