Generate videos
Veo 3.1, Sora 2, Kling 3.0 — async polling pattern
Video generation is asynchronous: submit returns a jobId immediately,
then poll /v1/jobs/{jobId} until the job completes.
1. Submit
curl https://api.rlay.ai/v1/videos \
-H "Authorization: Bearer $RLAY_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "veo-3.1",
"prompt": "a cat surfing on neon waves",
"duration": 5,
"resolution": "720p"
}'Response:
{ "jobId": "job_a3f7...", "status": "pending" }2. Poll
curl https://api.rlay.ai/v1/jobs/job_a3f7... \
-H "Authorization: Bearer $RLAY_KEY"Response while running:
{ "jobId": "job_a3f7...", "status": "processing" }Response when done:
{
"jobId": "job_a3f7...",
"status": "completed",
"resultUrl": "https://cdn.rlay.ai/...",
"creditsCost": 1.15,
"completedAt": "2026-05-05T12:42:10Z"
}Polling cadence
- First poll after 5 seconds, then exponential backoff capped at 30s.
- Most jobs settle within 20-90s depending on duration and model.
- A 4xx response means the job failed — check
errorMsg.
Available models
| Model | Best for | Price |
|---|---|---|
veo-3.1 | Cinematic, 720p, 5-12s | $0.23/s |
sora-2 | Long-form coherent, 1080p, 20s+ | $0.20/s |
kling-3 | Camera control, realistic, 10s | $0.12/s |
seedance-2 | Image-to-video, fast, 5s | $0.08/s |
Credits and refunds
Credits are only deducted on successful completion. Failed jobs cost nothing.
MkSaaS Docs