REST API · Video Generation

Text-to-Video API vs Pika

A developer-first text-to-video API that turns a text prompt into a 1080p MP4 clip in one HTTP call. Generate video from text programmatically — no UI, no subscriptions locked to a web console, no per-seat pricing. $0.09 per 5-second clip on paid plans, with automatic credit refunds for any failed generation. Compare our t2v API vs Pika and see why engineering teams building AI video workflows choose PixelAPI.

$0.09 / 5s clip 720p & 1080p Text-to-video Image-to-video MP4 output Paid plans from $10/mo
Get an API key Quick start See pricing API docs
Video generation is available on Starter ($10/mo), Pro ($50/mo), and Scale ($200/mo) paid plans. Compare plans →

Why a t2v API instead of Pika

Pika is an excellent consumer tool for quickly previewing AI video ideas through its web interface. But when you need to generate video from text at scale inside your own product — triggered by a webhook, a content scheduler, or a CI pipeline — you need a REST API, not a browser tab.

Predictable per-clip billing

Pay $0.09 per 5-second clip. No monthly seat fee for API access, no opaque credit systems that reset at the end of the month. Your cloud cost scales exactly with usage.

Standard REST + JSON

POST a JSON body, get back a generation ID, poll for completion. Fits into any backend stack. No proprietary SDK lock-in required — use cURL, Axios, or any HTTP client.

Async by design

Video renders take 90–150 seconds. The API returns immediately with a job ID. Poll or use webhooks. The Python and Node SDKs handle polling loops automatically.

One API key for everything

The same key that generates video also removes backgrounds, upscales images, generates audio, and runs virtual try-ons. One dashboard, one invoice, one rate limit tier.

Quick start — text-to-video in one call

Sign up, upgrade to a paid plan, and POST your prompt. The endpoint returns a generation ID immediately; poll GET /v1/video/{id} until status=completed, then download the MP4 from output_url.

# Step 1: Submit the text-to-video job
curl -X POST https://api.pixelapi.dev/v1/video/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A cinematic drone shot gliding over a misty mountain valley at dawn",
    "resolution": "1080p",
    "duration": 5
  }'
# Response: {"generation_id": "uuid", "status": "processing", "estimated_seconds": 120, ...}

# Step 2: Poll until completed (every 5 seconds)
curl https://api.pixelapi.dev/v1/video/UUID \
  -H "Authorization: Bearer YOUR_API_KEY"
# Response: {"status": "completed", "output_url": "https://cdn.pixelapi.dev/videos/uuid.mp4"}
pip install pixelapi
---
import time
from pixelapi import PixelAPI

client = PixelAPI(api_key="YOUR_API_KEY")

# Submit
job = client.video.generate(
    prompt="A cinematic drone shot gliding over a misty mountain valley at dawn",
    resolution="1080p",
    duration=5,
)
print(f"Job started: {job.generation_id}")

# Poll until done (SDK handles this automatically)
result = client.video.wait(job.generation_id)  # blocks until complete
result.save("output.mp4")
print(f"Video saved: output.mp4")
npm install pixelapi
---
import { PixelAPI } from "pixelapi";

const client = new PixelAPI({ apiKey: process.env.PIXELAPI_KEY });

// Submit and await completion
const result = await client.video.generate({
  prompt: "A cinematic drone shot gliding over a misty mountain valley at dawn",
  resolution: "1080p",
  duration: 5,
});

await result.save("output.mp4");
console.log("Video saved:", result.outputUrl);
composer require pixelapi/pixelapi
---
<?php
use PixelAPI\Client;

$client = new Client(getenv("PIXELAPI_KEY"));

// Submit job
$job = $client->video()->generate([
    "prompt"     => "A cinematic drone shot gliding over a misty mountain valley at dawn",
    "resolution" => "1080p",
    "duration"   => 5,
]);

// Poll until done
$result = $client->video()->wait($job->generation_id);
file_put_contents("output.mp4", $result->download());
gem install pixelapi
---
require "pixelapi"

client = PixelAPI::Client.new(api_key: ENV["PIXELAPI_KEY"])

job = client.video.generate(
  prompt:     "A cinematic drone shot gliding over a misty mountain valley at dawn",
  resolution: "1080p",
  duration:   5
)

result = client.video.wait(job.generation_id)
File.binwrite("output.mp4", result.download)
go get github.com/pixelapi/pixelapi-go
---
import "github.com/pixelapi/pixelapi-go"

client := pixelapi.New("YOUR_API_KEY")

job, err := client.Video.Generate(pixelapi.VideoRequest{
    Prompt:     "A cinematic drone shot gliding over a misty mountain valley at dawn",
    Resolution: "1080p",
    Duration:   5,
})
if err != nil { panic(err) }

result, err := client.Video.Wait(job.GenerationID)
if err != nil { panic(err) }
result.Save("output.mp4")

Image-to-video: animate a reference image

Pass an image alongside your text prompt to animate a specific visual. Useful for product animation, social content, and e-commerce catalog videos. Same pricing: 90 credits per 5-second clip.

# Image-to-video via multipart form
curl -X POST https://api.pixelapi.dev/v1/video/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "prompt=Camera slowly zooms in, warm lighting, cinematic" \
  -F "resolution=1080p" \
  -F "duration=5" \
  -F "[email protected]"

Pricing — t2v API vs Pika, Runway, Kling, Luma

PixelAPI charges per video clip with no monthly seat fee for API access. All other providers listed require subscription plans or enterprise agreements for API usage.

ProviderAPI accessPer 5-sec clipResolutionOutput
PixelAPI Paid plan ($10/mo+) $0.09 720p · 1080p MP4
PikaSubscription (web-first)See pika.art/pricing720p · 1080pMP4
RunwayBuild / Enterprise planSee runwayml.com/pricing720p · 1080pMP4
KlingAPI availableSee klingai.com/pricing720p · 1080pMP4
Luma Dream MachineAPI availableSee lumalabs.ai/pricing540p · 720pMP4

Rival pricing verified from each provider's public pricing page, May 2026. PixelAPI prices are stable and visible without a login — no sales call required to get started.

What you get back

MP4 video file

The completed generation includes an output_url pointing to a CDN-hosted MP4 file. Download it directly or proxy it through your own storage pipeline. Files are retained for 7 days.

Generation metadata

Every response includes generation_id, status, credits_used, processing_ms, and estimated_seconds. Useful for logging, billing reconciliation, and analytics.

720p and 1080p

Choose resolution=720p for faster renders and smaller files, or resolution=1080p for full-HD output ready for social platforms. Both cost the same 90 credits per clip.

Camera control parameter

Pass camera_fixed=true to lock the virtual camera — useful for product shots where you want motion in the scene without camera drift. Default allows natural camera movement.

Common workflows

The text-to-video API fits into these production pipelines. Each links to a setup guide:

Marketing agencies

Auto-generate video ad concepts from brief copy. Output to Slack, Notion, or your asset management system.

Social media content

Turn product descriptions or campaign copy into short-form video clips for Instagram Reels, TikTok, and YouTube Shorts.

Ad creative automation

Batch-generate video ad variants from a prompt template. A/B test hooks before committing to full production.

Agency client previews

Rapid concept visualization for client presentations. Generate and iterate on video concepts in minutes, not days.

E-commerce product video

Animate product imagery for listing pages, carousel ads, and email campaigns at scale.

Compare AI video APIs

Full benchmark: pricing, latency, output quality, and API ergonomics across the major video generation providers.

Integrations & SDKs

Connect the text-to-video API to your existing stack:

Zapier

Trigger video generation from any Zapier-connected app — CMS update, form submission, or scheduled cron.

Make.com

Drag-and-drop video generation in Make scenarios. Route the MP4 output to Google Drive, Slack, or your DAM.

Shopify

Auto-generate product videos from SKU copy on new product creation. Webhook-driven, no manual steps.

Webflow

CMS-triggered video generation for landing page hero clips and CMS-linked product pages.

Next.js

Server-side video generation in Next.js API routes. Stream status updates to the client via SSE.

WooCommerce

Plugin pattern for auto-generating product video from WooCommerce product descriptions.

Comparison vs alternatives

How PixelAPI's video API stacks up against other providers:

vs Replicate

Replicate bills by the second of processing compute — hard to predict costs. PixelAPI charges a flat $0.09 per clip regardless of render time. Simpler budgeting for production workloads.

vs other AI APIs

Most AI video platforms are consumer-first. PixelAPI is API-first: same endpoint design for all 20+ tools, one key, one dashboard, one support channel.

Rate limits & error handling

Video generation is compute-intensive. PixelAPI limits concurrent video jobs to prevent queue starvation:

Recommended retry strategy: exponential backoff starting at 5 seconds, doubling on each 429 up to 60 seconds. The Python and Node SDKs implement this automatically.

# Python SDK auto-retries 429 with backoff
from pixelapi import PixelAPI

client = PixelAPI(api_key="...", max_retries=4, retry_delay=5.0)

# If the video queue is full, the SDK retries automatically
result = client.video.generate(
    prompt="Aerial view of a coastal city at sunset, cinematic grade",
    resolution="1080p",
    duration=5,
)
result.save("output.mp4")

For batch workflows generating hundreds of clips, consider a queue-per-worker pattern: maintain a pool of 5 in-flight jobs, submit new ones as completions arrive. The estimated_seconds field in each response helps you schedule submission timing.

Frequently asked questions

What is a text-to-video API and how does it compare to Pika?

A text-to-video (t2v) API generates an MP4 video from a text prompt via an HTTP call — no browser interface needed. Pika is primarily a web-first consumer product with limited API access. PixelAPI is built API-first: predictable per-clip pricing ($0.09 per 5-second clip), standard REST/JSON interface, SDKs for 6 languages, and webhook support for async workflows.

How do I generate a video from text via the API?

POST a JSON body to https://api.pixelapi.dev/v1/video/generate with your Authorization: Bearer header, a prompt string, and optional resolution and duration parameters. The response contains a generation_id; poll GET /v1/video/{id} until status=completed, then download the MP4 from output_url. See the Quick Start section above for code in 6 languages.

How much does the text-to-video API cost?

$0.09 per 5-second clip (90 credits). Credits are purchased in blocks: Starter plan is $10/month for 10,000 credits (~111 video clips per month). Pro is $50/month for 60,000 credits (~666 clips). Scale is $200/month for 300,000 credits (~3,333 clips). All plans auto-refund credits for failed generations.

What resolution and duration are supported?

720p and 1080p output. Duration is 5 seconds per clip. To produce longer videos, generate multiple clips and concatenate them in your pipeline using FFmpeg or any video processing library. The API is stateless — each clip is independent.

Can the API animate a reference image (image-to-video)?

Yes. Submit a multipart/form-data request with your text prompt and an image file. The AI will use the image as the visual anchor and animate it according to your prompt. Useful for product animation, portrait animation, and e-commerce video at scale. Same 90-credit price per clip.

Is there a free trial for the t2v API?

Video generation requires a paid plan. New paid subscribers get immediate access. If you want to evaluate the image APIs first (background removal, upscaling, image generation), those are available on the free tier with 500 bonus credits on signup, no credit card required. Video is unlocked when you upgrade.

How long does video generation take?

Typical render time is 90–150 seconds for a 5-second clip at 1080p. The initial API response includes an estimated_seconds field. Poll the status endpoint every 5 seconds; the Python and Node SDKs handle the polling loop automatically with configurable timeout.

What format does the video API return?

MP4 video file, hosted on PixelAPI's CDN and accessible via a signed URL in output_url. Files are retained for 7 days. For permanent storage, download the file to your own object storage (AWS S3, Google Cloud Storage, Cloudflare R2) as part of your pipeline.

Why choose PixelAPI's t2v API instead of Pika?

PixelAPI is designed for engineering teams: predictable per-clip pricing, standard REST JSON API, official SDKs for Python, Node.js, PHP, Ruby, and Go, webhook support, automatic retry on 429, and auto-refund on failed generations. Pika is excellent for creative exploration but not designed for programmatic, production-scale video generation in a backend service.

What rate limits apply?

Default: 5 concurrent video jobs per account. Exceeding this returns HTTP 429 with a Retry-After header. For higher concurrency limits (burst capacity or dedicated queues), contact [email protected] with your expected volume.

Does the API support camera movement?

Yes. Pass camera_fixed=true in your request to lock the virtual camera position. This is useful for product videos and portrait animations where you want subject motion without camera drift. The default allows natural camera movement driven by the prompt.

What happens if video generation fails?

Credits are automatically refunded if a generation fails, times out, or is blocked by the content safety filter. The status endpoint returns status=failed with an error_message. You are never charged for a generation that did not produce a valid output.

Get an API key Read full API docs Compare all plans