Skip to main content

Endpoint

POST https://api.omniakey.com/v1/videos/generations
Generate videos from text descriptions. Video generation is an asynchronous process — you submit a task, then poll for the result or receive a webhook notification when it’s ready.

Request Examples

import requests

headers = {
    "Authorization": "Bearer your-omniakey-api-key",
    "Content-Type": "application/json"
}

# Step 1: Submit generation task
response = requests.post(
    "https://api.omniakey.com/v1/videos/generations",
    headers=headers,
    json={
        "model": "sora",
        "prompt": "A golden retriever playing in ocean waves at sunset",
        "duration": 5,
        "resolution": "1080p"
    }
)

task = response.json()
task_id = task["id"]
print(f"Task submitted: {task_id}")

# Step 2: Poll for result
import time
while True:
    status_response = requests.get(
        f"https://api.omniakey.com/v1/videos/generations/{task_id}",
        headers=headers
    )
    result = status_response.json()

    if result["status"] == "completed":
        print(f"Video URL: {result['output']['url']}")
        break
    elif result["status"] == "failed":
        print(f"Error: {result['error']['message']}")
        break

    time.sleep(5)  # Poll every 5 seconds

Response

Task Submission Response

{
  "id": "vtask-abc123",
  "status": "processing",
  "created": 1709251200,
  "model": "sora",
  "estimated_time": 60
}

Task Completion Response

{
  "id": "vtask-abc123",
  "status": "completed",
  "created": 1709251200,
  "model": "sora",
  "output": {
    "url": "https://api.omniakey.com/files/video-abc123.mp4",
    "duration": 5,
    "resolution": "1920x1080",
    "format": "mp4"
  }
}

Task Status Values

StatusDescription
pendingTask is queued and waiting to start
processingVideo is being generated
completedVideo is ready for download
failedGeneration failed (see error field)

Webhook Notifications

Instead of polling, you can provide a webhook URL to receive a notification when the video is ready:
curl https://api.omniakey.com/v1/videos/generations \
  -H "Authorization: Bearer your-omniakey-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sora",
    "prompt": "A golden retriever playing in ocean waves at sunset",
    "duration": 5,
    "webhook_url": "https://your-server.com/webhooks/video-ready"
  }'
The webhook POST payload is the same as the task completion response above.

Request Parameters

model
string
required
The model ID to use. Options: sora, runway-gen3, kling-1.5, pika-1.5.
prompt
string
required
A text description of the desired video. Be descriptive for best results — include subject, action, environment, camera angle, and style.
duration
integer
Video duration in seconds. Range depends on the model (typically 3-15 seconds). Default: 5.
resolution
string
Output resolution. Options: 720p, 1080p. Default: 1080p. Not all models support all resolutions.
aspect_ratio
string
Aspect ratio. Options: 16:9, 9:16, 1:1. Default: 16:9.
webhook_url
string
A URL to receive a POST request when the video generation is complete. Use this instead of polling.

Supported Models

ModelProviderMax DurationResolutionsFeatures
SoraOpenAI15s720p, 1080pPhotorealistic, text-to-video
Runway Gen-3Runway10s720p, 1080pImage-to-video, style control
Kling 1.5Kuaishou10s720p, 1080pFast generation, good motion
Pika 1.5Pika Labs5s720p, 1080pStylized output, lip sync

View All Models

See the complete list