curl --request POST \
--url https://api.budgetpixel.com/v1/videos/p-video-2-pro \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"aspect_ratio": "16:9",
"end_image": "<string>",
"image": "<string>",
"length_seconds": 5,
"mode": "speed",
"resolution": "768p",
"seed": 123
}
'import requests
url = "https://api.budgetpixel.com/v1/videos/p-video-2-pro"
payload = {
"prompt": "<string>",
"aspect_ratio": "16:9",
"end_image": "<string>",
"image": "<string>",
"length_seconds": 5,
"mode": "speed",
"resolution": "768p",
"seed": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: '<string>',
aspect_ratio: '16:9',
end_image: '<string>',
image: '<string>',
length_seconds: 5,
mode: 'speed',
resolution: '768p',
seed: 123
})
};
fetch('https://api.budgetpixel.com/v1/videos/p-video-2-pro', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.budgetpixel.com/v1/videos/p-video-2-pro",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => '<string>',
'aspect_ratio' => '16:9',
'end_image' => '<string>',
'image' => '<string>',
'length_seconds' => 5,
'mode' => 'speed',
'resolution' => '768p',
'seed' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.budgetpixel.com/v1/videos/p-video-2-pro"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"aspect_ratio\": \"16:9\",\n \"end_image\": \"<string>\",\n \"image\": \"<string>\",\n \"length_seconds\": 5,\n \"mode\": \"speed\",\n \"resolution\": \"768p\",\n \"seed\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.budgetpixel.com/v1/videos/p-video-2-pro")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"aspect_ratio\": \"16:9\",\n \"end_image\": \"<string>\",\n \"image\": \"<string>\",\n \"length_seconds\": 5,\n \"mode\": \"speed\",\n \"resolution\": \"768p\",\n \"seed\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.budgetpixel.com/v1/videos/p-video-2-pro")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"aspect_ratio\": \"16:9\",\n \"end_image\": \"<string>\",\n \"image\": \"<string>\",\n \"length_seconds\": 5,\n \"mode\": \"speed\",\n \"resolution\": \"768p\",\n \"seed\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"message": "<string>",
"model": "<string>",
"status": "pending"
}{
"error": {
"code": "model_not_available",
"message": "<string>",
"type": "invalid_request_error"
}
}{
"error": {
"code": "model_not_available",
"message": "<string>",
"type": "invalid_request_error"
}
}{
"error": {
"code": "model_not_available",
"message": "<string>",
"type": "invalid_request_error"
}
}{
"error": {
"code": "model_not_available",
"message": "<string>",
"type": "invalid_request_error"
}
}Generate video with P-Video 2 Pro
Pruna AI P-Video 2 Pro — text-to-video, and image-to-video from a first frame, a last frame, or both. 480p or 768p, any length from 5 to 15 seconds, 24 fps, with generated audio. Three generation modes set the price with the resolution: cost (cheapest, and the fastest), speed (the default) and quality (the most detailed and the slowest). Billed per second of output; see mode_pricing in GET /v1/models or POST /v1/cost.
Asynchronous. Returns a job id (the video is not in this response). Poll GET /v1/videos/{id} until status is succeeded — the video URL is in that response’s video_url.
Examples, sample output and pricing: P-Video 2 Pro
curl --request POST \
--url https://api.budgetpixel.com/v1/videos/p-video-2-pro \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"aspect_ratio": "16:9",
"end_image": "<string>",
"image": "<string>",
"length_seconds": 5,
"mode": "speed",
"resolution": "768p",
"seed": 123
}
'import requests
url = "https://api.budgetpixel.com/v1/videos/p-video-2-pro"
payload = {
"prompt": "<string>",
"aspect_ratio": "16:9",
"end_image": "<string>",
"image": "<string>",
"length_seconds": 5,
"mode": "speed",
"resolution": "768p",
"seed": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: '<string>',
aspect_ratio: '16:9',
end_image: '<string>',
image: '<string>',
length_seconds: 5,
mode: 'speed',
resolution: '768p',
seed: 123
})
};
fetch('https://api.budgetpixel.com/v1/videos/p-video-2-pro', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.budgetpixel.com/v1/videos/p-video-2-pro",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => '<string>',
'aspect_ratio' => '16:9',
'end_image' => '<string>',
'image' => '<string>',
'length_seconds' => 5,
'mode' => 'speed',
'resolution' => '768p',
'seed' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.budgetpixel.com/v1/videos/p-video-2-pro"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"aspect_ratio\": \"16:9\",\n \"end_image\": \"<string>\",\n \"image\": \"<string>\",\n \"length_seconds\": 5,\n \"mode\": \"speed\",\n \"resolution\": \"768p\",\n \"seed\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.budgetpixel.com/v1/videos/p-video-2-pro")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"aspect_ratio\": \"16:9\",\n \"end_image\": \"<string>\",\n \"image\": \"<string>\",\n \"length_seconds\": 5,\n \"mode\": \"speed\",\n \"resolution\": \"768p\",\n \"seed\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.budgetpixel.com/v1/videos/p-video-2-pro")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"aspect_ratio\": \"16:9\",\n \"end_image\": \"<string>\",\n \"image\": \"<string>\",\n \"length_seconds\": 5,\n \"mode\": \"speed\",\n \"resolution\": \"768p\",\n \"seed\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"message": "<string>",
"model": "<string>",
"status": "pending"
}{
"error": {
"code": "model_not_available",
"message": "<string>",
"type": "invalid_request_error"
}
}{
"error": {
"code": "model_not_available",
"message": "<string>",
"type": "invalid_request_error"
}
}{
"error": {
"code": "model_not_available",
"message": "<string>",
"type": "invalid_request_error"
}
}{
"error": {
"code": "model_not_available",
"message": "<string>",
"type": "invalid_request_error"
}
}Authorizations
API key as a bearer token: Authorization: Bearer bpx_live_xxx
Body
Text description of the video, including any sound you want to hear.
Aspect ratio for text-to-video. With a frame image the image sets the shape and this is ignored.
16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 1:1 Optional last frame. With image the video moves between the two frames; on its own the video ends on it. Same input forms as image.
Optional first frame for image-to-video; the video starts from it and follows its framing. Provide a public image URL, a data URI, raw base64, or an uploaded-file URL from POST /v1/uploads.
Video length in seconds, any whole number from 5 to 15.
5 <= x <= 15Generation mode, which sets the price together with resolution: cost is the cheapest and also the fastest (about 20 s for 5 s of video), speed is the default (about 70 s), quality is the most detailed and the slowest (about 85 s). Credits per second: see mode_pricing in GET /v1/models.
cost, speed, quality Output resolution: 480p (832x480 at 16:9) or 768p (1344x768 at 16:9). Sets the price together with mode.
480p, 768p Seed for reproducible generation. Omit for random.