Pixnovia API
The Pixnovia API lets you generate AI videos programmatically using the Minimax H3 model. Integrate video generation directly into your products with a simple REST API.
Pricing
Video generation is billed per second of output at the chosen resolution. Your account balance is only deducted after the task completes successfully — failed tasks are not charged.
| Resolution | Rate | Example — 6 sec | Example — 15 sec |
|---|---|---|---|
| 480p | $0.04 / sec | $0.24 | $0.60 |
| 768p | $0.06 / sec | $0.36 | $0.90 |
| 1080p | $0.08 / sec | $0.48 | $1.20 |
| 1440p | $0.10 / sec | $0.60 | $1.50 |
The minimum top-up amount is $1.00. Top up from Dashboard → Top Up.
Authentication
All API endpoints require an API key passed as a Bearer token in the Authorization header. API keys start with sk_ and can be created from your dashboard.
Authorization: Bearer sk_your_api_key_here
Create Video Task
Create a video generation task. The task runs asynchronously — this endpoint returns immediately with a task_id Poll Get Task Status to check progress and retrieve the result URL.
Request Body
| Parameter | Type | Description | |
|---|---|---|---|
| prompt | string | required | Text description of the video to generate. |
| resolution | string | required | 480p 768p 1080p 1440p |
| aspect_ratio | string | required | landscape portrait |
| duration | integer | required | Duration in seconds. Range: 3–15 |
| ref_files | object | optional | Reference files as base64 data URLs. Keys: ref_image_0 ref_audio_0 |
Example Request — text only
import requests headers = { "Authorization": "Bearer sk_your_api_key", "Content-Type": "application/json", } payload = { "prompt": "A cinematic drone shot over snow-capped mountains at golden hour", "resolution": "1080p", "aspect_ratio": "landscape", "duration": 6, } res = requests.post( "https://pixnovia.com/api/video/generate", json=payload, headers=headers ) data = res.json() print("task_id:", data["task_id"])
curl -X POST https://pixnovia.com/api/video/generate \ -H "Authorization: Bearer sk_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "prompt": "A cinematic drone shot over snow-capped mountains", "resolution": "1080p", "aspect_ratio": "landscape", "duration": 6 }'
Example Request — with reference files
You can pass a reference image and/or audio to guide the visual style and rhythm of the generated video. Files must be encoded as base64 data URLs and included in the ref_files object.
• Reference filea are optional.
• Reference images, maximum 6, use key: ref_image_0 to ref_image_5 — supported formats: image/jpeg, image/png, image/webp
• Reference audios, maximum 3, use key: ref_audio_0 to ref_audio_2 — supported format: audio/wav
• Value must be a full data URL: data:<mime>;base64,<data>
• Keep images and audio under 10 MB
import requests, base64 def to_data_url(path, mime): with open(path, "rb") as f: b64 = base64.b64encode(f.read()).decode() return f"data:{mime};base64,{b64}" headers = { "Authorization": "Bearer sk_your_api_key", "Content-Type": "application/json", } payload = { "prompt": "Ocean waves at sunset with a gentle rhythm", "resolution": "1080p", "aspect_ratio": "landscape", "duration": 10, "ref_files": { "ref_image_0": to_data_url("scene.jpg", "image/jpeg"), "ref_image_1": to_data_url("scene-1.jpg", "image/jpeg"), "ref_image_2": to_data_url("scene-2.jpg", "image/jpeg"), "ref_audio_0": to_data_url("rhythm.wav", "audio/wav"), "ref_audio_1": to_data_url("rhythm-1.wav", "audio/wav"), "ref_audio_2": to_data_url("rhythm-2.wav", "audio/wav"), } } res = requests.post( "https://pixnovia.com/api/video/generate", json=payload, headers=headers ) data = res.json() print("task_id:", data["task_id"])
Response
{
"task_id": 42,
"status": "success",
"est_cost_cents": 48,
"error_message": null
}
{
"task_id": null,
"status": "failed",
"est_cost_cents": 48,
"error_message": "Insufficient balance. Required: $0.48, Current: $0.20"
}
{
"task_id": null,
"status": "failed",
"est_cost_cents": 0,
"error_message": "Invalid resolution: 2160p"
}
Get Task Results
Poll this endpoint to check task progress. When status is success, the video_url field contains the generated video download URL. Your account balance is deducted at this point.
| Parameter | Type | Description | |
|---|---|---|---|
| task_id | integer | path | Task ID returned by the Generate Video endpoint. |
Status Values
| status | Meaning |
|---|---|
| pending | Task is queued, not yet picked up. |
| processing | Task is actively being generated. |
| success | Generation complete. video_url is available. Balance deducted. |
| failed | Generation failed. No charge. error_message has details. |
Polling Example
import time task_id = data["task_id"] # from generate response while True: r = requests.get( f"https://pixnovia.com/api/video/task/{task_id}", headers=headers ).json() status = r["status"] if status == "success": print("Video URL:", r["video_url"]) break elif status == "failed": print("Failed:", r["error_message"]) break time.sleep(5) # poll every 5 seconds
Response — success
{
"task_id": 42,
"status": "success",
"video_url": "/api/video/download/42",
"error_message": null,
"cost_cents": 48,
"transaction_id": 187,
"new_balance_cents": 952,
"created_at": "2026-11-10T08:23:11Z",
"completed_at": "2026-11-10T08:25:44Z"
}
Save Video
Once the task status is success, use the video_url to download the generated video. The URL is a relative path — prepend your base URL (https://pixnovia.com) to form the complete download link.
import requests # After polling returns status="success" video_url = task_response["video_url"] # e.g., "/api/video/download/42" full_url = f"https://pixnovia.com{video_url}" # Download the video response = requests.get(full_url, headers=headers) if response.status_code == 200: with open("output.mp4", "wb") as f: f.write(response.content) print("Video saved to output.mp4") else: print(f"Download failed: {response.status_code}")
curl -X GET "https://pixnovia.com/api/video/download/42" \ -H "Authorization: Bearer sk_your_api_key" \ -o output.mp4
const fs = require('fs'); const https = require('https'); const videoUrl = taskResponse.video_url; const fullUrl = `https://pixnovia.com${videoUrl}`; const file = fs.createWriteStream('output.mp4'); https.get(fullUrl, { headers: { 'Authorization': 'Bearer sk_your_api_key' } }, (response) => { response.pipe(file); file.on('finish', () => { file.close(); console.log('Video saved to output.mp4'); }); });
Optimize Prompt
Submit a rough prompt and receive an AI-enhanced version optimized for video generation quality. This is the same enhancement applied when you click "Optimize" in the Studio UI.
| Parameter | Type | Description | |
|---|---|---|---|
| prompt | string | required | The raw prompt to enhance. |
{
"optimized_prompt": "Cinematic aerial drone footage sweeping over..."
}
Errors
All error responses use standard HTTP status codes and return a JSON body with a detail field.
| Status | Meaning |
|---|---|
| 400 | Bad request — missing or invalid parameter. |
| 401 | Unauthorized — API key missing, invalid, or revoked. |
| 402 | Insufficient balance — top up your account to continue. |
| 403 | Forbidden — you don't own this resource. |
| 404 | Not found — task or key does not exist. |
| 500 | Server error — contact [email protected] if it persists. |
{
"detail": "Human-readable error message"
}