Sora 2, Veo 3.1, Kling 3.0: AI Video Generation Through a Single API
AI video generation moved from demo to production in 2026: Sora 2, Veo 3.1, and Kling 3.0 now sit inside real advertising, product-marketing, social, and game-prototyping pipelines. The hard part is rarely the model — it is operational: each one lives behind a different provider with its own account, its own API contract, its own billing.
Onysoft AI Gateway puts all three families — plus Runway Aleph and more — behind one OpenAI-compatible API: the same base_url (https://api.onysoft.com/v1), the same sk-ony- key, one balance, pay-as-you-go with no subscription. Whether you build from Turkey or anywhere else, you integrate once and switch models with a single parameter. In this guide we compare the three video families, walk through the asynchronous generation flow with curl and Python, and share prompt patterns that consistently produce better clips.
Three Video Families: Veo 3.1, Sora 2, Kling 3.0 (and Runway Aleph)
All three families generate video from text (text-to-video) and from a still image (image-to-video); the difference is in the character of the output and where each fits in a pipeline:
- Veo 3.1 (Google): Cinematic visual language with native audio — dialogue, ambience, and effects are generated together with the footage. The first pick for ads and product videos that need to feel broadcast-ready. Google's text models live on our Gemini page.
- Sora 2 (OpenAI): Creative scene composition and physical consistency. Strong for unusual camera angles, imaginative concepts, and character-driven storytelling.
- Kling 3.0: Speed and duration. A practical choice for longer clips and pipelines that need fast iteration — a favorite for high-volume social content.
- Runway Aleph: An editing model more than a from-scratch generator — object replacement, scene transformation, and style transfer on existing footage.
The right model depends on the job, and most teams mix several. Browse every option — video, image, and music included — in the model catalog.
The Async Flow: task_id and Polling
Video generation takes minutes, not milliseconds, so the endpoint is asynchronous. The flow has three steps:
- You call
POST /v1/video/generatewithmodel,prompt, and parameters such as duration in the body. The response returns immediately with atask_id— no long-lived HTTP connection to babysit. - You poll
GET /v1/video/status/{task_id}. The job is queued, processed, and either completes or fails with an error. - When generation completes, the status response includes the video URL; downloading the file and moving it to your own storage (S3, CDN, etc.) is good practice.
A polling interval of 5-15 seconds is a sensible balance: polling more often does not make the render finish sooner, it just multiplies requests. If you are building a pipeline, persist the task_id in your database so your worker can resume tracking after a restart. The full parameter list and error codes are in the API documentation.
Your First Video with curl and Python
Start a generation with curl — API keys begin with sk-ony-:
curl https://api.onysoft.com/v1/video/generate \
-H "Authorization: Bearer sk-ony-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google-veo-3.1-text-to-video-fast-720p",
"prompt": "Aerial drone shot over the Bosphorus at golden hour, cinematic, slow push-in, ambient city sound",
"duration": 8
}'
The response returns a task_id. Here is the end-to-end flow in Python, polling included:
import requests, time
BASE = "https://api.onysoft.com/v1"
HEADERS = {"Authorization": "Bearer sk-ony-YOUR_KEY"}
r = requests.post(BASE + "/video/generate", headers=HEADERS, json={
"model": "kling/v2-1-pro-5s",
"prompt": "Macro shot of coffee pouring into a glass cup, slow motion, soft window light",
"duration": 10,
})
task_id = r.json()["task_id"]
while True:
status = requests.get(BASE + "/video/status/" + task_id, headers=HEADERS).json()
if status["status"] in ("completed", "failed"):
break
time.sleep(10)
print(status)
Switching models is a one-line change — set model to google-veo-3.1-text-to-video-quality-1080p and rerun. To experiment without writing code, the Playground runs the same endpoint from your browser.
Prompt Tips: Camera, Light, Duration
With video models, the prompt works like a director's note: the more concrete your cinematography language, the more predictable the result. Patterns that work:
- Camera: Terms like "aerial drone shot", "slow dolly-in", "handheld", and "macro lens" pin down the shot. Ask for one camera move per clip — requesting two usually breaks both.
- Light: Descriptors such as "golden hour", "soft window light", "neon reflections", and "overcast" are the strongest lever over the look of the frame.
- Duration and pacing: Tell one event per short clip — do not cram three scenes into 8 seconds. For longer narratives, generate clips separately and cut them together; repeat the same character and lighting description in every prompt for consistency.
- Audio (Veo 3.1): Write ambience and dialogue into the prompt — "waves crashing, distant seagulls".
- Exclusions: Add explicit negatives like "no text overlays, no watermark".
Treat prompts as versioned assets: keep the ones that work in your repo next to the code, and iterate on them the way you iterate on tests.
Images and Music from the Same Endpoint
The video endpoint is really a general-purpose generation endpoint: the same POST /v1/video/generate + task_id + polling pattern applies to image and music models too. The only thing that changes is the model parameter:
- Images:
flux-2,imagen4, and Seedream 4.5 — storyboard frames, thumbnails, and starting frames for image-to-video. - Music and voice:
suno-v4for songs and background scores, ElevenLabs for voiceover.
That uniformity pays off in infrastructure: one auth scheme, one error model, one worker queue, one accounting path. A typical pipeline generates the storyboard with flux-2, the clip with veo3, and the score with suno-v4 — all from the same code. Text works on the same key as well: POST /v1/chat/completions (streaming supported) gives you Claude, GPT, Gemini, DeepSeek, and 708+ models in total, so scriptwriting and prompt generation live in the same API as the media it drives.
Cost Logic: Pay per Generation
Text models bill per token; video, image, and music follow a different logic: you pay per generation. The amount depends on the model and the output you request (duration for video, for example) — current prices are always listed on the /models page.
A practical budgeting approach: lock in your prompt with short, low-cost test renders first, then switch to longer, higher-quality generations as you approach the final cut. You can model your monthly scenario — clips, images, tracks — in the cost calculator.
On the billing side there is no subscription: you top up a balance and spend as you go, which makes per-client cost reporting straightforward for agencies and SaaS teams. For teams in Turkey there are extra conveniences — local-currency balance, corporate e-invoicing, KVKK-compliant data handling, and 24/7 support — but the core value holds from anywhere: one OpenAI-compatible API, one balance, every major video, image, and music model behind it.
Frequently Asked Questions
How do I access the Sora 2 API?
Through Onysoft AI Gateway with a single account: create a key in the sk-ony- format and call POST /v1/video/generate. The same key also works for Veo 3.1, Kling 3.0, and Runway Aleph — no separate provider accounts needed, from Turkey or anywhere else.
How long does video generation take, and how do I get the result?
Generation is asynchronous and typically takes minutes. POST /v1/video/generate returns a task_id immediately; you poll GET /v1/video/status/{task_id} every 5-15 seconds. When the job completes, the status response contains the video URL.
How do I choose between Veo 3.1, Sora 2, and Kling 3.0?
Rule of thumb: Veo 3.1 for broadcast-leaning, cinematic work with native audio; Sora 2 for creative scene composition and unusual concepts; Kling 3.0 for speed and longer clips; Runway Aleph for editing existing footage. Since it is one API, you can A/B the same prompt across all of them by changing the model parameter.
How does video API pricing work?
Video, image, and music generation is billed per generation rather than per token; the amount depends on the model and output settings. Current prices are published on the /models page. There is no subscription — you top up a balance and pay as you go.
Can I also generate images and music from the same API?
Yes. The same POST /v1/video/generate + task_id + polling pattern covers images (flux-2, imagen4, Seedream 4.5) and music/voice (suno-v4, ElevenLabs). Text models such as Claude, GPT, and Gemini run on the same key via /v1/chat/completions.
Related pages
Ready to build?
Access 708+ AI models through a single API. Pay as you go — no subscription.