Sora 2 video generation via micropayments — text-to-video and image-to-video, $0.40–$1.20 per generation.
What it does
This endpoint generates videos using OpenAI's Sora 2 model through StableStudio's pay-per-generation platform. It supports text-to-video generation and optional image-to-video via a reference image URL. Videos can be 4, 8, or 12 seconds long in 720p landscape (1280x720) or portrait (720x1280) orientation. Payment is handled via the MPP protocol (Tempo method, pathUSD) or x402 (USDC on Base), with no API keys or subscriptions required.
The generation flow is asynchronous: POST the request with a signed payment header, receive a jobId, then poll the job status endpoint (authenticated via SIGN-IN-WITH-X wallet signature) until the video is complete. Typical generation time is 1–3 minutes. For image-to-video, upload a reference image first via the /api/upload flow ($0.01), then pass the resulting blob URL in the `input_reference` field. The `autoCrop` option (default true) automatically crops the reference image to match the target aspect ratio.
StableStudio exposes a full OpenAPI 3.1 spec and agents.txt for discovery. The endpoint is part of a broader platform offering multiple image and video models (Nano Banana Pro, GPT Image 1.5, Flux 2 Pro, Grok, Seedance, Wan 2.6, Veo 3.1, and Sora 2 Pro) all accessible via the same payment protocol.
Capabilities
Use cases
- —Generate short video clips from text prompts for social media content
- —Animate a still image into a video using image-to-video mode
- —Create marketing or product demo videos programmatically
- —Agent-driven video generation without subscription commitments
- —Prototype video concepts quickly with pay-per-generation pricing
Fit
Best for
- —AI agents needing on-demand video generation without API keys
- —Developers wanting pay-per-use Sora 2 access via crypto micropayments
- —Short-form video creation (4–12 seconds) in landscape or portrait
Not for
- —Long-form video production (max 12 seconds per generation)
- —Users without a crypto wallet (requires USDC on Base or pathUSD on Tempo)
- —Real-time or streaming video generation (1–3 min async processing)
Quick start
# 1. POST without payment to get 402 challenge
curl -X POST https://stablestudio.dev/api/generate/sora-2/generate \
-H 'Content-Type: application/json' \
-d '{"prompt": "A golden retriever running on a beach at sunset", "seconds": "4", "size": "1280x720"}'
# Returns 402 with PAYMENT-REQUIRED header (base64 JSON)
# 2. Sign USDC payment, re-POST with PAYMENT-SIGNATURE header
# 3. Poll GET /api/jobs/{jobId} with SIGN-IN-WITH-X headerExample
Request
{
"size": "1280x720",
"prompt": "A golden retriever running on a beach at sunset, cinematic lighting",
"seconds": "8",
"autoCrop": true,
"input_reference": "https://example.blob.vercel-storage.com/uploads/abc/dog.png"
}Response
{
"type": "sora-2",
"jobId": "job_abc123def456",
"status": "pending",
"success": true
}Endpoint
Quality
Full OpenAPI 3.1 schema with detailed input/output definitions, clear pricing ($0.40–$1.20), documented payment flow, and agents.txt present. The probe did not capture a live 402 challenge on this specific endpoint (POST-only, probed with HEAD/GET returning 405), but the platform is clearly live (root returns 200, OpenAPI is comprehensive). Minor deduction for lack of direct 402 capture on this route.
Warnings
- —Probe returned 405 on HEAD/GET because this endpoint only accepts POST — not an indication of downtime
- —No dedicated docs page found (404 at /docs) — all documentation is in the OpenAPI spec and agents.txt
Citations
- —Sora 2 generate costs $0.40–$1.20 and takes 1–3 minuteshttps://stablestudio.dev
- —Payment is USDC on Base (6 decimals) or pathUSD on Tempohttps://stablestudio.dev
- —Sora 2 supports seconds 4/8/12 and sizes 1280x720 or 720x1280https://stablestudio.dev
- —agents.txt lists sora-2 model at $0.40-1.20, 1-3minhttps://stablestudio.dev