PopNowAPI
API-Schlüssel holen

P-Video 2 Pro API

von Pruna AI

5 bis 15 Sekunden lange Clips mit Ton, aus Text, Frames oder Referenzclips

pruna-ai/p-video-2-pro/reference-to-video
  • Bis 768p
  • Clips mit 5–15 s
  • Start- und Endbild
  • 7 Seitenverhältnisse
  • Video erstellen
  • Bild zu Video
  • Referenz zu Video

Du rufst es mit dem Modellnamen pruna-ai/p-video-2-pro/reference-to-video über POST /jobs/createTask auf, ab 0,09 $.

Modellnamepruna-ai/p-video-2-pro/reference-to-video
EndpunktPOST 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"

Der input ist aus dem Schema unten gebaut und besteht die Prüfung so, wie er dasteht. Ersetz Prompt und Links durch deine eigenen.

Preis

OptionUSD pro Sekunde
generation_mode costresolution 480p0,018 $
generation_mode speedresolution 480p0,024 $
generation_mode costresolution 768p0,03 $
generation_mode speedresolution 768p0,042 $

Abrechnung in USD · Alle Optionen und Preise: GET /models/pruna-ai/p-video-2-pro/reference-to-video

Limits

Cliplänge
5–15 s
Auflösungen
480p · 768p
Seitenverhältnisse
auto · 16:9 · 9:16 · 4:3 · 3:4 · 3:2 +2
Referenz-Audio
3
Referenzvideos
3

Parameter

Diese Felder stammen aus demselben Schema, gegen das wir jede Anfrage prüfen. Nicht aufgeführte Felder werden abgelehnt.

  • promptstringPflicht

    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.

    Bereich
    1 – … chars
  • image_urlstringOptionalÄndert den Preis

    Das Bild, von dem aus es losgeht.

    Bereich
    image/jpeg, image/png, image/webp, image/gif
  • last_image_urlstringOptionalÄndert den Preis

    Optionales Endbild, damit der Clip genau dort endet, wo du willst.

    Bereich
    image/jpeg, image/png, image/webp, image/gif
  • reference_video_urlsarray<string>OptionalÄndert den Preis

    Clips, deren Bewegung, Kamera oder Stil übernommen werden soll.

    Bereich
    1 – 3 items · video/mp4, video/webm, video/quicktime, video/x-m4v
  • reference_audio_urlsarray<string>OptionalÄndert den Preis

    Ton zum Angleichen: eine Stimme, Musik oder ein Rhythmus.

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

    Die Form des Bildes: breit, quadratisch oder hoch.

    Standardwert
    "auto"
    Erlaubte Werte
    "auto""16:9""9:16""4:3""3:4""3:2""2:3""1:1"
  • resolutionstringOptionalÄndert den Preis

    Ausgabegröße. Größere Formate sind schärfer und kosten mehr.

    Standardwert
    "768p"
    Erlaubte Werte
    "480p""768p"
  • generation_modestringOptionalÄndert den Preis

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

    Standardwert
    "speed"
    Erlaubte Werte
    "cost""speed"
  • keep_reference_audiobooleanOptional

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

    Standardwert
    false
  • duration_secondsintegerOptionalÄndert den Preis

    Wie lang der Clip läuft. Abgerechnet wird pro Sekunde.

    Standardwert
    5
    Bereich
    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.

    Standardwert
    "off"
    Erlaubte Werte
    "off""turbo""max"
  • seedintegerOptional

    Dieselbe Zahl liefert ein wiederholbares Ergebnis.

    Bereich
    0 – 2147483647
Rohes 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"
}

Antworten, Polling und Callbacks

Alle Modelle funktionieren gleich: Task anlegen, dann pollen oder auf den Callback warten.

Erst den Preis prüfen

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
  }
}'

Sende vor dem Start denselben Anfrage-Body an POST /jobs/quote, um die geschätzten und maximalen Kosten in USD zu sehen. Die Preisabfrage führt keine Aufgabe aus und belastet dein Guthaben nicht.

Angenommen

HTTP
HTTP/1.1 202 Accepted

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

HTTP 202 bedeutet angenommen: Der USD-Höchstbetrag bleibt bis zur Abrechnung reserviert. Bei Annahme einer Aufgabe reservieren wir den maximalen Angebotsbetrag aus deinem API-Guthaben. Nach Abschluss rechnen wir den tatsächlichen Verbrauch ab, höchstens den reservierten Betrag, und geben den Rest frei. Schlägt die Aufgabe fehl, wird die Reservierung aufgehoben.

Status abfragen

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

Frag alle paar Sekunden mit wachsendem Abstand ab und hör auf, sobald state succeeded, failed, canceled oder expired ist.

Fertiger 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"
}

Lad über die url vor expiresAt herunter. Später einen frischen Link nötig? Frag POST /common/download-url.

Callback prüfen

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
});

Mit gesetzter callBackUrl schicken wir dir den fertigen Task. Prüf die Signatur am rohen Body, bevor du ihm vertraust.

Lokale Datei schicken

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.

Öffentliche https-Links funktionieren direkt. Lokale Dateien laufen vorher über upload-url und commit.

Über P-Video 2 Pro

5 bis 15 Sekunden lange Clips mit Ton, aus Text, Frames oder Referenzclips.

Du rufst es mit dem Modellnamen pruna-ai/p-video-2-pro/reference-to-video über POST /jobs/createTask auf, ab 0,09 $.

Anfrageparameter

ParameterPflichtBeschreibung
aspect_ratioNeinDie Form des Bildes: breit, quadratisch oder hoch. auto · 16:9 · 9:16 · 4:3 · 3:4 · 3:2 · 2:3 · 1:1 · Standardwert: auto
duration_secondsNeinWie lang der Clip läuft. Abgerechnet wird pro Sekunde. ≥ 5 · ≤ 15 · Standardwert: 5
generation_modeNeincost is cheaper and slower, speed (the default) is faster at the same quality. cost · speed · Standardwert: speed
image_urlNeinDas Bild, von dem aus es losgeht.
keep_reference_audioNeinUse the reference audio as the soundtrack instead of generating new sound. Needs exactly one audio clip. Standardwert: false
last_image_urlNeinOptionales Endbild, damit der Clip genau dort endet, wo du willst.
promptJaSay 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_modeNeinLet 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 · Standardwert: off
reference_audio_urlsNeinTon zum Angleichen: eine Stimme, Musik oder ein Rhythmus.
reference_video_urlsNeinClips, deren Bewegung, Kamera oder Stil übernommen werden soll.
resolutionNeinAusgabegröße. Größere Formate sind schärfer und kosten mehr. 480p · 768p · Standardwert: 768p
seedNeinDieselbe Zahl liefert ein wiederholbares Ergebnis. ≥ 0 · ≤ 2147483647

Preise

Die Preise sind in USD angegeben. Die API nutzt ein separates Guthaben in US-Dollar. Website-Credits lassen sich dafür weder verwenden noch in API-Guthaben umwandeln. Auch die umgekehrte Übertragung ist nicht möglich. Bei Annahme einer Aufgabe reservieren wir den maximalen Angebotsbetrag aus deinem API-Guthaben. Nach Abschluss rechnen wir den tatsächlichen Verbrauch ab, höchstens den reservierten Betrag, und geben den Rest frei. Schlägt die Aufgabe fehl, wird die Reservierung aufgehoben.

OptionUSD pro Sekunde
generation_mode cost · resolution 480p0,018 $
generation_mode speed · resolution 480p0,024 $
generation_mode cost · resolution 768p0,03 $
generation_mode speed · resolution 768p0,042 $

Sende vor dem Start denselben Anfrage-Body an POST /jobs/quote, um die geschätzten und maximalen Kosten in USD zu sehen. Die Preisabfrage führt keine Aufgabe aus und belastet dein Guthaben nicht.

API-Schnellstart

Die P-Video 2 Pro API in drei Schritten aufrufen

  1. API-Schlüssel erstellen. Melde dich bei PopNow an und erstelle in der API-Konsole einen Schlüssel. Schlüssel beginnen mit sk-popnow-. API-Aufrufe nutzen dein separates Guthaben in US-Dollar.
  2. Anfrage senden. Sende POST /jobs/createTask mit model pruna-ai/p-video-2-pro/reference-to-video und einem input-Objekt nach der Parametertabelle. Die Antwort enthält sofort eine Task-ID.
  3. Ergebnis abholen. Frage GET /jobs/recordInfo mit der Task-ID ab oder gib eine callBackUrl mit, dann schicken wir das Ergebnis dorthin. Lade die Ausgabelinks herunter, sobald die Aufgabe erfolgreich ist.
# 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"

Ersetze den Prompt und alle Links durch deine eigenen. Im Tab „API“ findest du die Referenz zu Antwort, Polling und Callback.

Fragen zur P-Video 2 Pro API

Was kostet die P-Video 2 Pro API?

P-Video 2 Pro gibt es ab 0,09 $ für einen 5-Sekunden-Clip – mit Referenz zu Video, der günstigsten Aufgabe. Preise nach Option: cost · 480p 0,018 $ pro Sekunde, speed · 480p 0,024 $ pro Sekunde, cost · 768p 0,03 $ pro Sekunde, speed · 768p 0,042 $ pro Sekunde. Die API nutzt ein separates Guthaben in US-Dollar. Website-Credits lassen sich dafür weder verwenden noch in API-Guthaben umwandeln. Auch die umgekehrte Übertragung ist nicht möglich. Bei Annahme einer Aufgabe reservieren wir den maximalen Angebotsbetrag aus deinem API-Guthaben. Nach Abschluss rechnen wir den tatsächlichen Verbrauch ab, höchstens den reservierten Betrag, und geben den Rest frei. Schlägt die Aufgabe fehl, wird die Reservierung aufgehoben.

Welche Limits hat die P-Video 2 Pro · Referenz zu Video API?

Cliplänge: 5–15 s; Auflösungen: 480p · 768p; Seitenverhältnisse: auto · 16:9 · 9:16 · 4:3 · 3:4 · 3:2 +2; Referenz-Audio: 3; Referenzvideos: 3. Anfragen außerhalb dieser Grenzen werden abgelehnt, bevor etwas abgebucht wird.

Mehr zu P-Video 2 Pro