Skip to Content
APIVideo GenerationOverview

Video API

A unified video generation API compatible with the OpenRouter Video Generation standard. One schema covers text-to-video, image-to-video, first/last-frame, and reference-guided generation. Submit a task asynchronously, then poll or receive a webhook when it finishes.

FeatureDetail
Base URLhttps://api.ofox.ai
Protocol styleOpenRouter-compatible (async submit → poll / webhook)
Generation modeInferred implicitly: no images = text-to-video · frame_images = image / first-last frame · input_references = reference-guided
Result deliveryPoll GET (rate-limit protected) or a callback_url webhook (HMAC-signed, retried)
Video storageUpstream original URL (temporary) + optional CDN mirror (persistent signed URL)

Authentication

Every request carries your ofox API key (format sk-xxx…) in the HTTP header:

Authorization: Bearer $OFOX_API_KEY

callback_url must be HTTPS. Webhook targets are validated against SSRF — private, loopback, and cloud-metadata addresses are rejected. A non-HTTPS or internal address fails at creation time with 400 invalid_callback_url.

Quickstart

1. Submit a task

Terminal
curl -X POST https://api.ofox.ai/v1/videos \ -H "Authorization: Bearer $OFOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "google/veo-3.1", "prompt": "A golden retriever running on the beach at sunset", "duration": 5, "resolution": "1080p", "aspect_ratio": "16:9", "generate_audio": true }'

The call returns 202 immediately with a polling URL:

{ "id": "9bcf3c60-7db2-4e1a-a1b2-c3d4e5f60718", "status": "pending", "polling_url": "https://api.ofox.ai/v1/videos/9bcf3c60-7db2-4e1a-a1b2-c3d4e5f60718" }

2. Poll until completed

Terminal
curl https://api.ofox.ai/v1/videos/9bcf3c60-7db2-4e1a-a1b2-c3d4e5f60718 \ -H "Authorization: Bearer $OFOX_API_KEY"

Keep requesting until status reaches a terminal state — completed, failed, cancelled, or expired. Poll no faster than once per second, or pass a callback_url when you create the task to receive a webhook instead of polling. See Get video status and Webhooks.

Endpoints

MethodEndpointDescription
POST/v1/videosCreate a video task
GET/v1/videos/{id}Get task status and result
DELETE/v1/videos/{id}Cancel a task

Per-second pricing

Video models are billed by time, not by tokens. The matching entry in pricing.video_pricing.tiers sets the USD rate per second according to resolution, input type, and audio options. pricing.output_video_per_second is only the model’s lowest from price. A simple estimate is tier rate × requested duration; after completion, use usage.video_seconds and usage.video_cost from the task response as the final billed quantity and charge. For video-to-video jobs, billed seconds can include input-video seconds.

Next

Last updated on