Skip to Content
API referenceVideo GenerationCreate Video

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 202 with the task id (status is pending), and you get the result by polling or via webhook as usual.

POST https://api.ofox.io/v1/videos

Request parameters

ParameterTypeRequiredDescription
modelstring✅Model ID, e.g. bytedance/seedance-2.5, alibaba/wan-3.0, minimax/hailuo-3. See Video models for the values each model supports
promptstring✅Text description of the video
durationinteger—Video length in seconds
resolutionstring—480p / 720p / 1080p / 1K / 2K / 4K
aspect_ratiostring—16:9 / 9:16 / 1:1 / 4:3 / 3:4 / 3:2 / 2:3 / 21:9 / 9:21
sizestring—Exact pixels WIDTHxHEIGHT (e.g. 1280x720), in place of resolution + aspect_ratio
frame_imagesarray—Frame control (image-to-video / first and last frame). If present, the request is treated as image-to-video; see below
input_referencesarray—Guides subject / style (reference-to-video), not precise frame anchors; see below
real_personboolean—Defaults to false. Set to true for real-person reference images and the server preprocesses them automatically before generation; requires at least one image in input_references and does not support frame_images
generate_audioboolean—Defaults to true on models that support audio output
seedinteger—Seed for deterministic generation (not guaranteed to be supported by every provider)
callback_urlstring—Webhook URL notified on the terminal state; must be HTTPS (see Webhooks)
providerobject—type pins the serving provider; options passes provider-specific parameters through. See Provider routing

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" } }
MediatypeMax countOther constraints
Imageimage_url≤ 9—
Audioaudio_url≤ 3≤ 15 seconds per clip
Videovideo_url≤ 1—

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_images is 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 to input_references;
  • input_references contains 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:

ModeCondition
text2videoNeither frame_images nor input_references is sent
img2videoframe_images contains one first_frame
img2video_endframe_images contains first_frame + last_frame
imgref2videoinput_references contains images only
mixref2videoinput_references mixes image / audio / video

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).

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.

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.

Last updated on