Pruna AI P Video 2 Text To Video API Documentation
Playground
Try it on WaveSpeedAI!Pruna P-Video-2 Text-to-Video generates videos from text prompts with explicit controls for duration, resolution, draft mode, and audio output, making it suitable for creative videos, social content, ads, and production workflows. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.
Features
Pruna P-Video-2 Text-to-Video generates videos directly from text prompts. Describe the scene, motion, camera movement, and visual style, then choose duration, resolution, and Draft or Full mode for fast previews or higher-quality output.
Why Choose This?
-
Text-to-video generation
Generate videos directly from natural-language prompts. -
Explicit duration control
Choose a requested duration from1to20seconds. -
Draft and Full modes
Use Draft mode for faster, lower-cost previews, or Full mode for higher-quality output. -
720p and 1080p output
Generate at720pfor lower cost or1080pfor higher-resolution results. -
Prompt upsampling
Useprompt_upsamplingto expand and refine the generation prompt. -
Audio output option
Keepsave_audioenabled when audio should be saved in the generated result.
Parameters
| Parameter | Required | Description |
|---|---|---|
| prompt | Yes | Non-empty generation prompt describing the scene, motion, camera movement, subject action, and visual direction. |
| aspect_ratio | No | Output aspect ratio. Default: 16:9. |
| duration | Yes | Requested video duration in seconds. Range: 1–20. No default is supplied. |
| resolution | No | Output resolution: 720p or 1080p. Default: 720p. |
| draft | No | Enable lower-quality Draft mode for faster, lower-cost previews. Default: false. |
| save_audio | No | Save audio in the generated result when supported. Default: true. |
| prompt_upsampling | No | Expand and optimize the generation prompt. Default: true. |
| seed | No | Optional non-negative integer seed for reproducible results. Omit for random generation. |
How to Use
- Write a prompt — Describe the scene, subject, action, camera movement, lighting, mood, and visual style.
- Choose aspect ratio — Use the default
16:9or select another supported layout. - Set duration — Choose an explicit duration from
1to20seconds. - Choose resolution — Use
720pfor lower-cost generation or1080pfor higher-resolution output. - Choose Draft or Full mode — Enable
draftfor preview generation or leave it disabled for full output. - Configure prompt upsampling optional — Keep
prompt_upsamplingenabled when you want the prompt refined automatically. - Set seed optional — Use a fixed seed for reproducible results, or omit it for random generation.
- Submit — Generate the final text-to-video output.
Pricing
Pricing is based on the explicitly requested duration, selected resolution, and draft mode.
| Resolution | Full / second | Draft / second |
|---|---|---|
| 720p | $0.025 | $0.015 |
| 1080p | $0.05 | $0.03 |
Example Costs
| Duration | 720p Full | 720p Draft | 1080p Full | 1080p Draft |
|---|---|---|---|---|
| 5s | $0.125 | $0.075 | $0.25 | $0.15 |
| 10s | $0.25 | $0.15 | $0.50 | $0.30 |
| 20s | $0.50 | $0.30 | $1.00 | $0.60 |
Billing uses the requested duration, not the measured duration of the generated output. aspect_ratio, save_audio, prompt_upsampling, and seed do not add separate charges.
Best Use Cases
- Text-to-video generation — Create videos directly from written scene descriptions.
- Prompt-based motion testing — Test different actions, camera movements, and visual styles.
- Draft previews — Use Draft mode to compare ideas before running full-quality output.
- Social video content — Generate short clips for ads, posts, reels, and creative previews.
- Creative prototyping — Explore cinematic concepts, character scenes, or product visuals from text.
- Marketing and product videos — Generate short-form promotional clips from text prompts.
Pro Tips
- Write prompts that describe visible motion, not just the image style.
- Include subject, action, camera movement, lighting, mood, and scene progression.
- Use Draft mode for quick iteration before generating the final version.
- Use
720pfor lower-cost tests and1080pfor higher-resolution output. - Set a fixed
seedwhen comparing prompt or parameter changes. - Keep prompts focused on one main scene or action for more stable motion.
- This product does not support automatic duration, audio conditioning, or last-frame guidance.
- Frame rate follows the upstream default.
Notes
promptanddurationare required.durationmust be explicitly set from1to20seconds.- Billing uses the requested duration.
- Automatic duration, audio conditioning, and last-frame guidance are not available in this product.
Related Models
- Pruna P-Video-2 Text-to-Video — Generate videos directly from text prompts.
- Pruna P-Video-2 Image-to-Video — Generate videos from an input image and motion prompt.
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'
{
"prompt": "A cinematic ocean wave at sunrise, highly detailed",
"duration": 5,
"aspect_ratio": "16:9",
"resolution": "720p",
"draft": false,
"save_audio": true,
"prompt_upsampling": 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-2/text-to-video" \
-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 |
|---|---|---|---|---|---|
| prompt | string | Yes | - | The positive prompt for generation. | |
| duration | integer | Yes | 5 | 1 ~ 20 | Requested video duration in seconds. Defaults to 5 seconds; automatic duration is not available. |
| aspect_ratio | string | No | 16:9 | 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 1:1 | Aspect ratio of the generated video. |
| resolution | string | No | 720p | 720p, 1080p | Output video resolution. |
| draft | boolean | No | false | - | Generate a faster, lower-quality preview at half the full-mode per-second rate. |
| save_audio | boolean | No | true | - | Save the video with audio. |
| prompt_upsampling | boolean | No | true | - | Enhance the prompt before video generation. |
| seed | integer | No | - | 0 ~ 2147483647 | Random seed for reproducibility. Omit for 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 |