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:
| Protocol | Submit | Query | Download |
|---|---|---|---|
| OpenAI-compatible | POST /v1/videos (V2V: /v1/videos/edits) | GET /v1/videos/{id} | GET /v1/videos/{id}/content |
| Gemini | POST /v1beta/models/{model}:predictLongRunning | GET /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.
Models and parameters
Section titled “Models and parameters”| Model | Use | Reference images | Duration (s) |
|---|---|---|---|
omni-t2v | Text-to-video | 0 | 4, 6, 8, 10 |
omni-i2v | Image-to-video (first frame) | 1 (first frame) | 4, 6, 8, 10 |
omni-r2v | Reference-to-video | 1–3 | 8 |
omni-v2v | Video editing | Source video + 0–2 images | 1–10 |
omni-40s | Long video | 0–9 | 40 |
| Parameter (OpenAI / Gemini) | Description |
|---|---|
resolution / parameters.resolution | 720p (default, native), 360p (native low-res), 1080p (720p plus a free upscale; also for omni-40s) |
aspect_ratio / parameters.aspectRatio | 16:9 (default) or 9:16 |
duration / parameters.durationSeconds | See 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.
OpenAI protocol
Section titled “OpenAI protocol”JSON (public image URLs)
Section titled “JSON (public image URLs)”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):
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).
Uploading local images (multipart)
Section titled “Uploading local images (multipart)”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.
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.
Query and download
Section titled “Query and download”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.mp4Gemini protocol
Section titled “Gemini protocol”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
imageand the rest, in order, inreferenceImages(each item is the image object itself);omni-i2vtakes onlyimage. - For text-to-video send only
prompt.
# Poll until done=truecurl "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_KEYPython (OpenAI protocol)
Section titled “Python (OpenAI protocol)”import timeimport 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)