Create video task
Submit a video generation task. The request returns 202 Accepted immediately with a task id and a polling URL; generation runs asynchronously. Poll the task or receive a webhook, then read the result with Get task status.
If the upstream is under unusually heavy load and has not accepted the task within 45 seconds, the task switches to asynchronous submission: the request still returns
202with the taskid(statusispending), and you get the result by polling or via webhook as usual.
POST https://api.ofox.io/v1/videosRequest parameters
frame_images[] element
Each element anchors one frame of the output; frame_type is first_frame or last_frame.
{
"type": "image_url",
"image_url": { "url": "https://example.com/first.jpg" },
"frame_type": "first_frame"
}input_references[] element
Pass image / audio / video references by type (guiding subject / style / consistency, not precise frame anchors):
{ "type": "image_url", "image_url": { "url": "https://example.com/subject.jpg" } }
{ "type": "audio_url", "audio_url": { "url": "https://example.com/voice.mp3" } }
{ "type": "video_url", "video_url": { "url": "https://example.com/ref.mp4" } }Exceeding any limit returns 400 too_many_references (see Error codes).
frame_images and input_references are mutually exclusive: a request can use only one of them, not both. Sending both returns 400 references_conflict.
real_person: Real-person reference images
For the workflow and adjustments to make when an image is rejected, see Real-person reference images.
When a reference image contains an identifiable real person, set the top-level real_person to true. Before submitting the generation task, Ofox automatically applies privacy-preserving preprocessing to every image in input_references. The default is false, so existing request behavior is unchanged.
{
"model": "bytedance/seedance-2.0",
"prompt": "The person in the frame walks through a cinematic night market",
"real_person": true,
"input_references": [
{
"type": "image_url",
"image_url": { "url": "https://example.com/person.jpg" }
}
]
}real_person only works with images in input_references, and the request must contain at least one image. The following cases return 400 invalid_request:
frame_imagesis also sent (first-frame or first/last-frame requests). The preprocessed image carries visible markings and would appear in the output video when used as a first or last frame, so move the images toinput_references;input_referencescontains no image.
Preprocessing can reduce false rejections by upstream anti-deepfake review, but it does not bypass content policy and does not guarantee acceptance. The upstream may still reject the task; rejected tasks are not charged, and you can correct the input or retry. For image input problems, see real_person preprocessing errors.
Mode detection (implicit)
There is no gen_mode field. The mode is inferred implicitly from the input fields you send:
Response
202 Accepted: the task is accepted and returns status: "pending" and polling_url:
{
"id": "9bcf3c60-7db2-4e1a-a1b2-c3d4e5f60718",
"status": "pending",
"polling_url": "https://api.ofox.io/v1/videos/9bcf3c60-7db2-4e1a-a1b2-c3d4e5f60718"
}Poll polling_url (or wait for the webhook) until the task reaches a terminal state; see Get task status.
Request structure by mode
The snippets below show the field structure for each generation mode; model is a placeholder. First confirm in Video models that the target model supports the mode; runnable examples for each model are on the family pages under Models (Seedance, Wan & HappyHorse, Hailuo).
Text to video
Send neither frame_images nor input_references.
{
"model": "<model ID>",
"prompt": "A golden retriever running on the beach at sunset",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}For how to send the request and query the result, see Video API · Quickstart.
Stackable options
The fields below are orthogonal to the generation mode and can be added to any of the request bodies above.
Webhook (callback_url)
Sends one POST to your address when the task reaches a terminal state, replacing polling.
{
"model": "<model ID>",
"prompt": "...",
"callback_url": "https://your-app.example/webhooks/ofox-video"
}callback_url must be a public HTTPS address. For the payload and signature, see Webhooks.