# P-Video 2 Pro Reference API Documentation > LLM-optimized documentation for P-Video 2 Pro Reference. Copy into your AI assistant for integration help. ## Overview **Model ID:** `p-video-2-pro-reference` **Type:** Video Generation **Credit Cost:** 1.25 credits per second Pruna P-Video 2 Pro Reference: reference-to-video built on MiniMax H3. Up to 9 images, 3 video and 3 audio references, plus optional start and end frames, 480p or 768p, 5 to 15 seconds with native audio. keep_audio lip-syncs to your own song or line. ## Endpoint ``` POST https://pixeldojo.ai/api/v1/models/p-video-2-pro-reference/run ``` ## Authentication All requests require an API key in the Authorization header: ``` Authorization: Bearer YOUR_API_KEY ``` Get your API key: https://pixeldojo.ai/api-platform/api-keys ## Input Parameters | Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | `prompt` | string | Yes | - | Describe the video. Refer to references by what they show. | | `reference_images` | array | No | - | Up to 9 image URLs (identity, product, style), start/end frames included in that count. The first 5 are included, each one past that adds 0.25 credits. | | `reference_videos` | array | No | - | Up to 3 video URLs (2-15s each, 15s combined, max 1080p) for motion and camera. Each clip bills 1.5 credits per second up to the output length + 0.5s, 15s total. | | `reference_audios` | array | No | - | Up to 3 audio URLs (15s combined) for voice and sound. | | `keep_audio` | boolean | No | false | Use the single reference audio as the soundtrack, as is (lip sync to a song or line). Requires exactly one reference audio. | | `image_url` | url | No | - | Optional opening frame. Counts as an image and can be combined with references. | | `end_image_url` | url | No | - | Optional closing frame. Counts as an image. | | `duration` | integer | No | 5 | Seconds (5-15). 1.25 credits per second. (min: 5, max: 15) | | `resolution` | enum | No | 768p | Output resolution. (Options: 480p, 768p) | | `mode` | enum | No | speed | speed (default) or cost (slower queue). Same price. (Options: speed, cost) | | `aspect_ratio` | enum | No | 16:9 | Output aspect ratio. adaptive follows the references. (Options: adaptive, 16:9, 9:16, 4:3, 3:4...) | | `prompt_upsampler` | enum | No | turbo | How much the model expands your prompt. A start or end frame forces turbo. (Options: off, turbo, max) | | `seed` | integer | No | - | Optional integer seed. | ## Supported Aspect Ratios - `adaptive` - `16:9` - `9:16` - `4:3` - `3:4` - `3:2` - `2:3` - `1:1` ## Capabilities - Image to Video - Audio Generation ## Quick Start ### 1. Submit a Job ```bash curl -X POST "https://pixeldojo.ai/api/v1/models/p-video-2-pro-reference/run" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "The person in the reference walks through a sunlit market", "reference_images": [ "https://example.com/person.jpg" ], "duration": 5, "resolution": "768p", "aspect_ratio": "adaptive" }' ``` **Response:** ```json { "jobId": "job_abc123...", "status": "pending", "statusUrl": "https://pixeldojo.ai/api/v1/jobs/job_abc123", "creditCost": 5, "creditsRemaining": 95 } ``` ### 2. Poll for Results ```bash curl "https://pixeldojo.ai/api/v1/jobs/job_abc123" \ -H "Authorization: Bearer YOUR_API_KEY" ``` **Completed Response:** ```json { "jobId": "job_abc123...", "status": "completed", "output": { "video": "https://temp.pixeldojo.ai/..." }, "creditCost": 5 } ``` ## Python Example ```python import requests import time API_KEY = "YOUR_API_KEY" # Submit job response = requests.post( "https://pixeldojo.ai/api/v1/models/p-video-2-pro-reference/run", headers={ "Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json" }, json={ "prompt": "The person in the reference walks through a sunlit market", "reference_images": ["https://example.com/person.jpg"], "duration": 5, "resolution": "768p", "aspect_ratio": "adaptive" } ) job = response.json() job_id = job["jobId"] # Poll for completion while True: status_response = requests.get( f"https://pixeldojo.ai/api/v1/jobs/{'{job_id}'}", headers={"Authorization": f"Bearer {API_KEY}"} ) status = status_response.json() if status["status"] == "completed": print("Output:", status["output"]) break elif status["status"] == "failed": print("Error:", status.get("error")) break time.sleep(2) ``` ## JavaScript Example ```javascript const API_KEY = 'YOUR_API_KEY'; // Submit job const submitResponse = await fetch('https://pixeldojo.ai/api/v1/models/p-video-2-pro-reference/run', { method: 'POST', headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ "prompt": "The person in the reference walks through a sunlit market", "reference_images": [ "https://example.com/person.jpg" ], "duration": 5, "resolution": "768p", "aspect_ratio": "adaptive" }) }); const job = await submitResponse.json(); // Poll for completion const pollForResult = async (jobId) => { while (true) { const statusResponse = await fetch(`https://pixeldojo.ai/api/v1/jobs/${jobId}`, { headers: { 'Authorization': `Bearer ${API_KEY}` } }); const status = await statusResponse.json(); if (status.status === 'completed') return status.output; if (status.status === 'failed') throw new Error(status.error); await new Promise(r => setTimeout(r, 2000)); } }; const output = await pollForResult(job.jobId); console.log('Output:', output); ``` ## Use Saved Characters (@Name) Write `@Name` in the prompt to use a character, product, outfit, location, prop or style saved in the account's Character Studio, for example `"@Mara on a beach at sunset"`. Its photos are added to `reference_images` automatically, after any images you send yourself, so your own image numbering is unchanged. List saved names with `GET /api/v1/characters` and save new ones with `POST /api/v1/characters`. An `@word` that names nothing saved stays plain text. ## Error Codes | Code | Status | Description | |------|--------|-------------| | `unauthorized` | 401 | Invalid or missing API key | | `insufficient_credits` | 402 | Not enough credits | | `invalid_request` | 400 | Invalid parameters | | `model_not_found` | 404 | Model ID not found | | `internal_error` | 500 | Server error | ## Links - **Full Documentation:** https://pixeldojo.ai/api-platform/p-video-2-pro-reference - **API Keys:** https://pixeldojo.ai/api-platform/api-keys - **Buy Credits:** https://pixeldojo.ai/api-platform/buy-credits - **All Models:** https://pixeldojo.ai/api/v1/models - **OpenAPI Spec:** https://pixeldojo.ai/api/openapi