Skip to content

Omni / Veo Video (OpenAI and Gemini protocols)

Omni / Veo Video (OpenAI and Gemini protocols)

Section titled “Omni / Veo Video (OpenAI and Gemini protocols)”

Omni (omni-t2v, omni-i2v, omni-r2v, omni-v2v, omni-40s) and Veo (veo_3_1_*) models can be called with either protocol; pricing and capabilities are the same, so pick whichever fits your SDK:

ProtocolSubmitQueryDownload
OpenAI-compatiblePOST /v1/videos (V2V: /v1/videos/edits)GET /v1/videos/{id}GET /v1/videos/{id}/content
GeminiPOST /v1beta/models/{model}:predictLongRunningGET /v1beta/operations/{name}video.uri in the result

The OpenAI protocol uses Authorization: Bearer YOUR_API_KEY; the Gemini protocol accepts x-goog-api-key: YOUR_API_KEY or ?key=YOUR_API_KEY.

ModelUseReference imagesDuration (s)
omni-t2vText-to-video04, 6, 8, 10
omni-i2vImage-to-video (first frame)1 (first frame)4, 6, 8, 10
omni-r2vReference-to-video1–38
omni-v2vVideo editingSource video + 0–2 images1–10
omni-40sLong video0–940
Parameter (OpenAI / Gemini)Description
resolution / parameters.resolution720p (default, native), 360p (native low-res), 1080p (720p plus a free upscale; also for omni-40s)
aspect_ratio / parameters.aspectRatio16:9 (default) or 9:16
duration / parameters.durationSecondsSee the table above

Veo model names already encode version, orientation and resolution (e.g. veo_3_1_t2v_fast_portrait, veo_3_1_t2v_1080p); parameters and submission are the same as for Omni.

Terminal window
curl https://api.4allapi.com/v1/videos \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "omni-r2v",
"prompt": "参考图中的人物在雨夜霓虹街头行走,电影感",
"duration": 8,
"aspect_ratio": "16:9",
"resolution": "720p",
"images": [
"https://cdn.example.com/reference-1.png",
"https://cdn.example.com/reference-2.png"
]
}'

omni-i2v uses exactly one image as the first frame (send a single URL in image; extra images are ignored and there is no last frame):

Terminal window
curl https://api.4allapi.com/v1/videos \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "omni-i2v",
"prompt": "The person slowly turns to face the camera, slow push-in",
"duration": 8,
"aspect_ratio": "16:9",
"resolution": "720p",
"image": "https://cdn.example.com/first-frame.png"
}'

Image fields: one image goes in image (string), several go in images (array, in order); both take public URLs. omni-r2v (1–3) and omni-40s (0–9) use images; omni-t2v takes no images.

For omni-40s, send duration: 40; images is optional (0–9).

Repeat the input_reference file field once per image; the order is kept (omni-i2v takes only one). The V2V source video goes in the video field.

Terminal window
curl https://api.4allapi.com/v1/videos \
-H "Authorization: Bearer $API_KEY" \
-F "model=omni-i2v" \
-F "prompt=The person slowly turns to face the camera" \
-F "duration=8" \
-F "aspect_ratio=9:16" \
-F "resolution=1080p" \
-F "input_reference=@first.png;type=image/png"

For video editing see Omni V2V video editing.

Terminal window
curl https://api.4allapi.com/v1/videos/<VIDEO_ID> -H "Authorization: Bearer $API_KEY"
curl -L https://api.4allapi.com/v1/videos/<VIDEO_ID>/content \
-H "Authorization: Bearer $API_KEY" -o output.mp4
Terminal window
curl "https://api.4allapi.com/v1beta/models/omni-r2v:predictLongRunning?key=$API_KEY" \
-H "Content-Type: application/json" \
-d '{
"instances": [{
"prompt": "参考图中的人物在雨夜霓虹街头行走,电影感",
"image": {"gcsUri": "https://cdn.example.com/reference-1.png", "mimeType": "image/png"},
"referenceImages": [
{"gcsUri": "https://cdn.example.com/reference-2.png", "mimeType": "image/png"}
]
}],
"parameters": {"durationSeconds": 8, "aspectRatio": "16:9", "resolution": "720p"}
}'
# → {"name": "operations/<OP_ID>"}
  • Images can be public URLs (gcsUri) or Base64 ({"bytesBase64Encoded": "...", "mimeType": "image/png"}).
  • Put the first image in image and the rest, in order, in referenceImages (each item is the image object itself); omni-i2v takes only image.
  • For text-to-video send only prompt.
Terminal window
# Poll until done=true
curl "https://api.4allapi.com/v1beta/operations/<OP_ID>?key=$API_KEY"
# When done, response.generateVideoResponse.generatedSamples[0].video.uri is the video URL;
# download it with Authorization: Bearer $API_KEY
import time
import requests
BASE_URL = "https://api.4allapi.com"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}
body = {
"model": "omni-t2v",
"prompt": "A koi carp gliding through a sunlit pond, cinematic slow motion.",
"duration": 8,
"aspect_ratio": "16:9",
"resolution": "1080p",
}
task = requests.post(f"{BASE_URL}/v1/videos", headers=HEADERS, json=body).json()
task_id = task["id"]
while task.get("status") not in ("completed", "failed"):
time.sleep(5)
task = requests.get(f"{BASE_URL}/v1/videos/{task_id}", headers=HEADERS).json()
video = requests.get(f"{BASE_URL}/v1/videos/{task_id}/content", headers=HEADERS)
open("output.mp4", "wb").write(video.content)