PopNowAPI
Odbierz klucz API

od PixVerse

Klipy 1–15 s do 1080p, z referencjami i przejściami

pixverse/v6/text-to-video
  • Do 1080p
  • Klipy 1–15 s
  • Z dźwiękiem
  • Pierwsza i ostatnia klatka
  • Proporcje obrazu: 8
  • Utwórz wideo
  • Obraz w wideo
  • Wideo z referencji
  • Wydłuż wideo

Wywołujesz go nazwą modelu pixverse/v6/text-to-video w POST /jobs/createTask, od 0,111 USD.

Nazwa modelupixverse/v6/text-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": "pixverse/v6/text-to-video",
  "input": {
    "prompt": "A slow aerial shot drifting over a misty pine forest at sunrise",
    "aspect_ratio": "16:9",
    "resolution": "720p",
    "duration_seconds": 5,
    "shot_type": "single"
  }
}'

# 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"

input jest zbudowany ze schematu poniżej, więc przechodzi walidację bez zmian. Zamień prompt i linki na własne.

Cena

OpcjaUSD za sekundę
generate_audio falseresolution 360p0,0222 USD
generate_audio falseresolution 540p0,0311 USD
generate_audio trueresolution 360p0,0311 USD
generate_audio falseresolution 720p0,04 USD
generate_audio trueresolution 540p0,04 USD
generate_audio trueresolution 720p0,0533 USD
generate_audio falseresolution 1080p0,08 USD
generate_audio trueresolution 1080p0,1022 USD

Rozliczenie w USD · Wszystkie opcje i ceny: GET /models/pixverse/v6/text-to-video

Limity

Długość klipu
1–15 s
Rozdzielczości
360p · 540p · 720p · 1080p
Proporcje obrazu
16:9 · 4:3 · 1:1 · 3:4 · 9:16 · 2:3 +2
Długość promptu (znaki)
5,000

Parametry

Te pola pochodzą z tego samego schematu, którym sprawdzamy każde żądanie. Pola spoza listy są odrzucane.

  • promptstringWymagane

    Describe the subject, the action and the camera.

    Zakres
    3 – 5000 chars
  • aspect_ratiostringOpcjonalne

    Kształt kadru: szeroki, kwadratowy albo pionowy.

    Domyślnie
    "16:9"
    Dozwolone wartości
    "16:9""4:3""1:1""3:4""9:16""2:3""3:2""21:9"
  • resolutionstringOpcjonalneZmienia cenę

    Rozmiar wyniku. Większy jest ostrzejszy i droższy.

    Domyślnie
    "720p"
    Dozwolone wartości
    "360p""540p""720p""1080p"
  • duration_secondsintegerOpcjonalneZmienia cenę

    Długość klipu. Płacisz za każdą sekundę.

    Domyślnie
    5
    Zakres
    1 – 15
  • generate_audiobooleanOpcjonalneZmienia cenę

    Dodaje dźwięk pasujący do obrazu: głosy, tło i efekty.

    Domyślnie
    false
  • shot_typestringOpcjonalne

    single keeps one continuous shot; multi lets the model cut the clip into several shots.

    Domyślnie
    "single"
    Dozwolone wartości
    "single""multi"
  • seedintegerOpcjonalne

    Ta sama liczba daje powtarzalny wynik.

    Zakres
    0 – 2147483647
Surowy JSON Schema
{
  "type": "object",
  "required": [
    "prompt"
  ],
  "properties": {
    "seed": {
      "type": "integer",
      "maximum": 2147483647,
      "minimum": 0,
      "description": "Random seed for controlled comparisons."
    },
    "prompt": {
      "type": "string",
      "maxLength": 5000,
      "minLength": 3,
      "description": "Describe the subject, the action and the camera."
    },
    "shot_type": {
      "enum": [
        "single",
        "multi"
      ],
      "type": "string",
      "default": "single",
      "description": "single keeps one continuous shot; multi lets the model cut the clip into several shots."
    },
    "resolution": {
      "enum": [
        "360p",
        "540p",
        "720p",
        "1080p"
      ],
      "type": "string",
      "default": "720p",
      "description": "Output resolution. Higher tiers cost more per second."
    },
    "aspect_ratio": {
      "enum": [
        "16:9",
        "4:3",
        "1:1",
        "3:4",
        "9:16",
        "2:3",
        "3:2",
        "21:9"
      ],
      "type": "string",
      "default": "16:9",
      "description": "Output aspect ratio."
    },
    "generate_audio": {
      "type": "boolean",
      "default": false,
      "description": "Generate sound with the picture. Costs more per second when on."
    },
    "duration_seconds": {
      "type": "integer",
      "default": 5,
      "maximum": 15,
      "minimum": 1,
      "description": "Clip length in whole seconds, 1 to 15. Billed per second."
    }
  },
  "additionalProperties": false
}

Prawdziwy wynik z PixVerse V6

PromptA lone lighthouse keeper in a yellow raincoat climbs the spiral stairs of a storm-lashed lighthouse at dusk; the camera rises past him to the lantern room as the great lamp sweeps its beam across towering waves. Cinematic, moody blue light, rain streaks on glass.
To samo żądanie przez API
{
  "model": "pixverse/v6/text-to-video",
  "input": {
    "prompt": "A lone lighthouse keeper in a yellow raincoat climbs the spiral stairs of a storm-lashed lighthouse at dusk; the camera rises past him to the lantern room as the great lamp sweeps its beam across towering waves. Cinematic, moody blue light, rain streaks on glass.",
    "aspect_ratio": "16:9",
    "resolution": "720p",
    "duration_seconds": 5,
    "shot_type": "single",
    "generate_audio": false
  }
}

Odpowiedzi, odpytywanie i callbacki

Wszystkie modele działają tak samo: utwórz zadanie, a potem odpytuj je albo poczekaj na callback.

Najpierw cena

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": "pixverse/v6/text-to-video",
  "input": {
    "prompt": "A slow aerial shot drifting over a misty pine forest at sunrise",
    "aspect_ratio": "16:9",
    "resolution": "720p",
    "duration_seconds": 5,
    "shot_type": "single"
  }
}'

Przed uruchomieniem wyślij tę samą treść żądania do POST /jobs/quote, aby zobaczyć szacowaną i maksymalną opłatę w USD. Wycena nie uruchamia zadania ani nie obciąża salda.

Przyjęte

HTTP
HTTP/1.1 202 Accepted

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

HTTP 202 oznacza przyjęcie zadania: maksymalna kwota w USD pozostaje zarezerwowana do rozliczenia. Po przyjęciu zadania rezerwujemy maksymalną kwotę wyceny na saldzie API. Po zakończeniu naliczamy opłatę za rzeczywiste użycie, nie wyższą niż rezerwacja, i zwalniamy resztę. Jeśli zadanie się nie powiedzie, rezerwacja zostaje zwolniona.

Sprawdź status

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

Odpytuj co kilka sekund, stopniowo wydłużając odstęp, i przestań, gdy state ma wartość succeeded, failed, canceled lub expired.

Gotowe zadanie

JSON
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_01k3m8x9q2z4v7n5p6r8s0t1w3",
    "model": "pixverse/v6/text-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"
}

Pobierz plik z url przed expiresAt. Potrzebujesz później nowego linku? Poproś o niego przez POST /common/download-url.

Weryfikacja callbacku

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

Gdy ustawisz callBackUrl, wyślemy ci gotowe zadanie. Zanim mu zaufasz, sprawdź podpis na surowym ciele żądania.

Wysyłanie pliku lokalnego

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.

Publiczne linki https działają bez zmian. Pliki lokalne przechodzą najpierw przez upload-url i commit.