Media generation
Veo 4 video generation
Veo is a video-generation model family known for consistency across long shots and physical realism. It supports text-to-video and image-to-video through asynchronous task endpoints. Check the Model Catalog (Models in the console) for current availability and exact model IDs.
Capabilities and use cases
- Model ID: Use an available video-generation model from the Model Catalog (the examples use
your-video-model-idas a placeholder). - Text to video: Generate moving images directly from a text description.
- Image to video: Supply a reference image as the starting point for the generated video.
- Typical uses: Advertising clips, product demonstrations, social content and storyboard previews.
Request workflow
Video generation takes much longer than ordinary requests, so the API uses asynchronous tasks:
- Submit a generation task and receive a task ID immediately.
- Poll its status until it completes or fails.
- When complete, download the video from the returned address.
Submit a generation task
POST https://api.yomiapi.com/v1/video/generations
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | An available video-generation model ID from the Model Catalog |
prompt | string | Yes | Video description |
image | string | No | Reference image, as a URL or base64; supplying it enables image-to-video |
size | string | No | Width x height, determining the resolution tier and orientation |
seconds | string | No | Video duration in seconds; default 8 |
metadata | object | No | Additional parameters, such as resolution, durationSeconds, taking priority over size and seconds |
size maps the longest side to a resolution tier: 1920 or more gives 1080p, 3840 or more gives 4K, and smaller values give 720p. Height greater than width produces 9:16 portrait; otherwise output is 16:9 landscape.
Python example
import requests
resp = requests.post(
"https://api.yomiapi.com/v1/video/generations",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"model": "your-video-model-id",
"prompt": "A drone shot slowly gliding over a coastline at dusk, waves breaking against rocks, a cinematic look",
"size": "1280x720",
"seconds": "8"
}
)
task = resp.json()
print(task["id"], task["status"])
Successful submission immediately returns a task object:
{
"id": "task_xxxxxxxx",
"task_id": "task_xxxxxxxx",
"object": "video",
"model": "your-video-model-id",
"status": "queued",
"progress": 0,
"created_at": 1753600000
}
Query task status
GET https://api.yomiapi.com/v1/video/generations/{task_id}
| Status | Description |
|---|---|
| queued | Queued |
| processing | Generating |
| succeeded | Completed; returns the video address |
| failed | Generation failed; returns error details |
Polling example
import time
import requests
headers = {"Authorization": "Bearer YOUR_API_KEY"}
task_id = "task_xxxxxxxx" # ID returned by the submission endpoint
while True:
r = requests.get(
f"https://api.yomiapi.com/v1/video/generations/{task_id}",
headers=headers
)
data = r.json()["data"]
if data["status"] == "succeeded":
print("Video URL:", data["url"])
break
if data["status"] == "failed":
print("Generation failed:", data.get("error"))
break
time.sleep(10)
Download and save
After completion, url in the query response is the video address. You can also download through the content endpoint with an Authorization header:
GET https://api.yomiapi.com/v1/videos/{task_id}/content
Download and save generated results promptly to avoid losing access when the links expire.
OpenAI-compatible endpoints
The platform also offers equivalent OpenAI Videos-style endpoints for integrations following the OpenAI video API format:
- Submit:
POST /v1/videos, with the same parameters as above. - Query:
GET /v1/videos/{task_id}, returning a video object whose status is queued, processing, succeeded or failed.
Billing and recommendations
- Billing: Video billing methods and per-task charges depend on the Model Catalog and actual charges under Usage.
- Prompts: Describe camera movement (push, pull, pan, track), subject action and scene lighting instead of stacking adjectives. Physical movement quality depends on how specifically you describe the action.
- Polling interval: Generation usually takes several minutes. Query about every 10 seconds to avoid excessive requests.
