PopNowAPI
Get API key

P-Video 2 Pro API

by Pruna AI

5 to 15 second clips with sound from text, frames or reference clips

pruna-ai/p-video-2-pro/reference-to-video
  • Up to 768p
  • 5–15s clips
  • Start and end frames
  • 7 aspect ratios
  • Create Video
  • Image to Video
  • Reference to Video

Call it with the model name pruna-ai/p-video-2-pro/reference-to-video on POST /jobs/createTask, from $0.09.

Model namepruna-ai/p-video-2-pro/reference-to-video
EndpointPOST https://api.popnow.ai/api/v1/jobs/createTask
# 1. Create the task. Keep the Idempotency-Key if you retry after a network error.
export IDEMPOTENCY_KEY="$(uuidgen)"
curl -X POST https://api.popnow.ai/api/v1/jobs/createTask \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{
  "model": "pruna-ai/p-video-2-pro/reference-to-video",
  "input": {
    "prompt": "A slow aerial shot drifting over a misty pine forest at sunrise",
    "aspect_ratio": "auto",
    "resolution": "768p",
    "generation_mode": "speed",
    "duration_seconds": 5
  }
}'

# 2. Copy data.taskId from the response, then poll until state is succeeded, failed, canceled or expired.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

The input is built from the schema below, so it passes validation as written. Change the prompt and links to your own.

Price

OptionUSD per second
generation_mode costresolution 480p$0.018
generation_mode speedresolution 480p$0.024
generation_mode costresolution 768p$0.03
generation_mode speedresolution 768p$0.042

Billed in USD · Every option and its price: GET /models/pruna-ai/p-video-2-pro/reference-to-video

Limits

Clip length
5–15 s
Resolutions
480p · 768p
Aspect ratios
auto · 16:9 · 9:16 · 4:3 · 3:4 · 3:2 +2
Reference audio
3
Reference videos
3

Parameters

These fields come from the same schema we check every request against. Fields that are not listed are rejected.

  • promptstringRequired

    Say what the shot should take from each reference. Refer to reference videos as video 1, video 2 and to audio clips as audio 1, audio 2, numbered in upload order.

    Range
    1 – … chars
  • image_urlstringOptionalChanges the price

    The picture to start from.

    Range
    image/jpeg, image/png, image/webp, image/gif
  • last_image_urlstringOptionalChanges the price

    Optional final frame, so the clip ends exactly where you want.

    Range
    image/jpeg, image/png, image/webp, image/gif
  • reference_video_urlsarray<string>OptionalChanges the price

    Clips whose motion, camera or style the result should follow.

    Range
    1 – 3 items · video/mp4, video/webm, video/quicktime, video/x-m4v
  • reference_audio_urlsarray<string>OptionalChanges the price

    Audio to match: a voice, music or a rhythm.

    Range
    1 – 3 items · audio/mpeg, audio/wav, audio/mp4, audio/aac +3
  • aspect_ratiostringOptional

    The shape of the frame: wide, square or tall.

    Default
    "auto"
    Allowed values
    "auto""16:9""9:16""4:3""3:4""3:2""2:3""1:1"
  • resolutionstringOptionalChanges the price

    Output size. Bigger sizes look sharper and cost more.

    Default
    "768p"
    Allowed values
    "480p""768p"
  • generation_modestringOptionalChanges the price

    cost is cheaper and slower, speed (the default) is faster at the same quality.

    Default
    "speed"
    Allowed values
    "cost""speed"
  • keep_reference_audiobooleanOptional

    Use the reference audio as the soundtrack instead of generating new sound. Needs exactly one audio clip.

    Default
    false
  • duration_secondsintegerOptionalChanges the price

    How long the clip runs. You pay per second.

    Default
    5
    Range
    5 – 15
  • prompt_optimization_modestringOptional

    Let the service rewrite and expand the prompt first: off follows it word for word, turbo is a quick rewrite, max a fuller one. Does not change the price.

    Default
    "off"
    Allowed values
    "off""turbo""max"
  • seedintegerOptional

    Reuse the same number to get a repeatable result.

    Range
    0 – 2147483647
Raw JSON Schema
{
  "additionalProperties": false,
  "properties": {
    "aspect_ratio": {
      "default": "auto",
      "description": "Output aspect ratio; auto adapts to the references.",
      "enum": [
        "auto",
        "16:9",
        "9:16",
        "4:3",
        "3:4",
        "3:2",
        "2:3",
        "1:1"
      ],
      "type": "string"
    },
    "duration_seconds": {
      "default": 5,
      "description": "Output length in whole seconds, from 5 to 15. Billed per second.",
      "maximum": 15,
      "minimum": 5,
      "type": "integer"
    },
    "generation_mode": {
      "default": "speed",
      "description": "cost is cheaper and slower, speed (the default) is faster at the same quality.",
      "enum": [
        "cost",
        "speed"
      ],
      "type": "string"
    },
    "image_url": {
      "contentMediaType": [
        "image/jpeg",
        "image/png",
        "image/webp",
        "image/gif"
      ],
      "description": "Optional opening frame. Adds a small per-image charge.",
      "format": "uri",
      "type": "string"
    },
    "keep_reference_audio": {
      "default": false,
      "description": "Use the reference audio as the soundtrack instead of generating new sound. Needs exactly one audio clip.",
      "type": "boolean"
    },
    "last_image_url": {
      "contentMediaType": [
        "image/jpeg",
        "image/png",
        "image/webp",
        "image/gif"
      ],
      "description": "Optional closing frame. Adds a small per-image charge.",
      "format": "uri",
      "type": "string"
    },
    "prompt": {
      "description": "Say what the shot should take from each reference. Refer to reference videos as video 1, video 2 and to audio clips as audio 1, audio 2, numbered in upload order.",
      "minLength": 1,
      "type": "string"
    },
    "prompt_optimization_mode": {
      "default": "off",
      "description": "Let the service rewrite and expand the prompt first: off follows it word for word, turbo is a quick rewrite, max a fuller one. Does not change the price.",
      "enum": [
        "off",
        "turbo",
        "max"
      ],
      "type": "string"
    },
    "reference_audio_urls": {
      "items": {
        "contentMediaType": [
          "audio/mpeg",
          "audio/wav",
          "audio/mp4",
          "audio/aac",
          "audio/ogg",
          "audio/opus",
          "audio/flac"
        ],
        "format": "uri",
        "type": "string"
      },
      "maxItems": 3,
      "minItems": 1,
      "type": "array"
    },
    "reference_video_urls": {
      "items": {
        "contentMediaType": [
          "video/mp4",
          "video/webm",
          "video/quicktime",
          "video/x-m4v"
        ],
        "format": "uri",
        "type": "string"
      },
      "maxItems": 3,
      "minItems": 1,
      "type": "array"
    },
    "resolution": {
      "default": "768p",
      "description": "Output resolution. 768p costs more per second than 480p.",
      "enum": [
        "480p",
        "768p"
      ],
      "type": "string"
    },
    "seed": {
      "description": "Random seed for controlled comparisons, not a frame-identical guarantee.",
      "maximum": 2147483647,
      "minimum": 0,
      "type": "integer"
    }
  },
  "required": [
    "prompt"
  ],
  "type": "object"
}

Responses, polling and callbacks

Every model works the same way: create a task, then poll it or wait for a callback.

Price it first

cURL
curl -X POST https://api.popnow.ai/api/v1/jobs/quote \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "pruna-ai/p-video-2-pro/reference-to-video",
  "input": {
    "prompt": "A slow aerial shot drifting over a misty pine forest at sunrise",
    "aspect_ratio": "auto",
    "resolution": "768p",
    "generation_mode": "speed",
    "duration_seconds": 5
  }
}'

Send the same request body to POST /jobs/quote to see the estimated and maximum USD charge before running. A quote does not run the task or charge your balance.

Accepted

HTTP
HTTP/1.1 202 Accepted

{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_01k3m8x9q2z4v7n5p6r8s0t1w3",
    "state": "queued"
  },
  "request_id": "req_example_create"
}

HTTP 202 means accepted: the maximum USD amount is held until settlement. When a task is accepted, we reserve the maximum quoted amount from your API balance. On completion, we charge for actual usage, never more than the hold, and release the remainder. If the task fails, the hold is released.

Check status

cURL
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

Poll every few seconds with backoff and stop once state is succeeded, failed, canceled or expired.

Finished task

JSON
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_01k3m8x9q2z4v7n5p6r8s0t1w3",
    "model": "pruna-ai/p-video-2-pro/reference-to-video",
    "state": "succeeded",
    "output": {
      "assets": [
        {
          "url": "https://cdn.popnow.ai/tasks/task_01k3m8x9q2z4v7n5p6r8s0t1w3/output.mp4?signature=FROM_RESPONSE",
          "expiresAt": "2026-10-17T12:20:00Z",
          "mime": "video/mp4",
          "width": 1280,
          "height": 720,
          "durationSeconds": 5
        }
      ]
    },
    "settled": true
  },
  "request_id": "req_example_record"
}

Download from url before expiresAt. Need a fresh link later? Ask POST /common/download-url.

Verify a callback

Node.js
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
import express from "express";

const app = express();
// express.raw keeps the exact bytes that were signed; express.json would not match.
app.post("/hooks/popnow", express.raw({ type: "application/json" }), (req, res) => {
  const timestamp = req.header("X-Webhook-Timestamp");
  const signature = req.header("X-Webhook-Signature") ?? "";
  const body = JSON.parse(req.body.toString("utf8"));
  const taskId = body.data?.taskId ?? body.task_id;
  const digest = createHash("sha256").update(req.body).digest("hex");
  const expected = createHmac("sha256", process.env.POPNOW_WEBHOOK_SECRET)
    .update(`${taskId}.${timestamp}.${digest}`)
    .digest("base64");
  const ok = expected.length === signature.length && timingSafeEqual(Buffer.from(expected), Buffer.from(signature));
  // Check the signature first, then reject anything older than five minutes.
  if (!ok || Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return res.status(401).end();
  res.status(200).end(); // answer fast, then fetch the task and store its files
});

With callBackUrl set, we post the finished task to you. Check the signature against the raw body before you trust it.

Send a local file

cURL
curl -X POST https://api.popnow.ai/api/v1/common/upload-url \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contentType": "image/png", "bytes": 482113}'

# PUT the file bytes to data.uploadUrl with every header in data.headers, then commit it:
curl -X POST https://api.popnow.ai/api/v1/files/$FILE_ID/commit \
  -H "Authorization: Bearer $POPNOW_API_KEY"
# The commit returns a popnow://f/... reference. Put it in any image, video or
# audio field of the task input instead of a public https URL.

Public https links work as they are. Local files go through upload-url and commit first.

About P-Video 2 Pro

5 to 15 second clips with sound from text, frames or reference clips.

Call it with the model name pruna-ai/p-video-2-pro/reference-to-video on POST /jobs/createTask, from $0.09.

Request parameters

ParameterRequiredDescription
aspect_ratioNoThe shape of the frame: wide, square or tall. auto · 16:9 · 9:16 · 4:3 · 3:4 · 3:2 · 2:3 · 1:1 · Default: auto
duration_secondsNoHow long the clip runs. You pay per second. ≥ 5 · ≤ 15 · Default: 5
generation_modeNocost is cheaper and slower, speed (the default) is faster at the same quality. cost · speed · Default: speed
image_urlNoThe picture to start from.
keep_reference_audioNoUse the reference audio as the soundtrack instead of generating new sound. Needs exactly one audio clip. Default: false
last_image_urlNoOptional final frame, so the clip ends exactly where you want.
promptYesSay what the shot should take from each reference. Refer to reference videos as video 1, video 2 and to audio clips as audio 1, audio 2, numbered in upload order.
prompt_optimization_modeNoLet the service rewrite and expand the prompt first: off follows it word for word, turbo is a quick rewrite, max a fuller one. Does not change the price. off · turbo · max · Default: off
reference_audio_urlsNoAudio to match: a voice, music or a rhythm.
reference_video_urlsNoClips whose motion, camera or style the result should follow.
resolutionNoOutput size. Bigger sizes look sharper and cost more. 480p · 768p · Default: 768p
seedNoReuse the same number to get a repeatable result. ≥ 0 · ≤ 2147483647

Pricing

Prices are in USD. The API uses a separate USD balance. Website credits cannot be used or transferred to it, and API funds cannot be transferred to website credits. When a task is accepted, we reserve the maximum quoted amount from your API balance. On completion, we charge for actual usage, never more than the hold, and release the remainder. If the task fails, the hold is released.

OptionUSD per second
generation_mode cost · resolution 480p$0.018
generation_mode speed · resolution 480p$0.024
generation_mode cost · resolution 768p$0.03
generation_mode speed · resolution 768p$0.042

Send the same request body to POST /jobs/quote to see the estimated and maximum USD charge before running. A quote does not run the task or charge your balance.

API quick start

Call the P-Video 2 Pro API in three steps

  1. Create an API key. Sign in to PopNow and create a key in the API console. Keys start with sk-popnow-. API calls use your separate USD balance.
  2. Send the request. POST /jobs/createTask with model pruna-ai/p-video-2-pro/reference-to-video and an input object that follows the parameter table. The response returns a task ID straight away.
  3. Get the result. Poll GET /jobs/recordInfo with the task ID, or pass a callBackUrl and we post the result to it. Download the output links when the task succeeds.
# 1. Create the task. Keep the Idempotency-Key if you retry after a network error.
export IDEMPOTENCY_KEY="$(uuidgen)"
curl -X POST https://api.popnow.ai/api/v1/jobs/createTask \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{
  "model": "pruna-ai/p-video-2-pro/reference-to-video",
  "input": {
    "prompt": "A slow aerial shot drifting over a misty pine forest at sunrise",
    "aspect_ratio": "auto",
    "resolution": "768p",
    "generation_mode": "speed",
    "duration_seconds": 5
  }
}'

# 2. Copy data.taskId from the response, then poll until state is succeeded, failed, canceled or expired.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

Replace the prompt and any links with your own. The API tab has the response, polling and callback reference.

P-Video 2 Pro API questions

How much does the P-Video 2 Pro API cost?

P-Video 2 Pro starts at $0.09 for a 5-second clip with Reference to Video, its cheapest task. Prices by option: cost · 480p $0.018 per second, speed · 480p $0.024 per second, cost · 768p $0.03 per second, speed · 768p $0.042 per second. The API uses a separate USD balance. Website credits cannot be used or transferred to it, and API funds cannot be transferred to website credits. When a task is accepted, we reserve the maximum quoted amount from your API balance. On completion, we charge for actual usage, never more than the hold, and release the remainder. If the task fails, the hold is released.

What are the limits of the P-Video 2 Pro · Reference to Video API?

Clip length: 5–15 s; Resolutions: 480p · 768p; Aspect ratios: auto · 16:9 · 9:16 · 4:3 · 3:4 · 3:2 +2; Reference audio: 3; Reference videos: 3. Requests outside these limits are rejected before anything is charged.

More about P-Video 2 Pro