POST /v1/videos doesn’t wait for it. NagaAI answers 202 at once with a job id, you poll GET /v1/videos/{id} until status is completed or failed, and then you download the file from GET /v1/videos/{id}/content. The request and job fields follow the OpenRouter Videos API.
Generate a clip
The loop below submits a job, polls every ten seconds and saves the MP4. Choose a model whoseoperations include video_generation in GET /v1/models.
id, or poll the polling_url as the Python and Node.js examples do:
completed_at, urls with the download link, and usage with the charge:
Choose the clip settings
NagaAI checks every value against theparameters of the model’s video_generation operation in GET /v1/models before the job starts. A value the model does not support fails with 400 and a message that lists the supported ones.
NagaAI checks the prompt with its own moderation before it starts the job. A blocked prompt fails with
403 inappropriate_content.
Fall back to another model
When the model you asked for can’t take the job, NagaAI can send the same request to another model. List up to three fallbacks inmodels, in the order to try them, as on images and chat.
duration outside its enum. NagaAI skips such a model before it moderates the prompt. Once a provider accepts the job, the job stays with that model, and you pay that model’s price. If your balance doesn’t cover the model you asked for, the request fails with 402, as without fallbacks. NagaAI skips a fallback that your balance doesn’t cover. Routing explains fallbacks in detail.
Edit or extend a clip
A model whoseinput_references parameter allows video_url can start from a clip you already have. Send the clip as a video_url reference and say in the prompt what to do with it. There is no separate mode field: the prompt decides whether the model edits the clip or continues it.
Extend the clip: the boat reaches the shore. duration is the length of the new clip. Wan 3.0 takes up to five MP4 or MOV clips of 15 seconds in total. The input clips plus the new one must stay within 30 seconds. The output keeps the shape of the input clip, so aspect_ratio doesn’t apply. A reference clip can’t go together with frame_images in one request.
Models that only edit a clip
Some models, such as FLUX Video Edit, only change a clip you give them. Theirinput_references parameter has {"video_url": {"minimum": 1}}, so a request without the clip fails with 400 before it reaches a provider. Length, size and shape of the result all come from the input clip. That’s why duration, resolution and aspect_ratio carry "x-support": "none" on such a model, and a request that sends any of them fails with 400. Send only model, prompt and the clip in input_references.
The maximum of duration is the longest input clip the model takes, 15 seconds for FLUX Video Edit. The model’s one price row has "resolution": "auto" in conditions. Billing explains what such a job holds and charges.
Models that upscale a clip
FLUX Video Upscale makes a clip you give it sharper and larger. It takes the clip the way an editing model does, as onevideo_url in input_references, and keeps its length, shape and sound. Two fields set the result. upscale_factor is how much each side grows, from 1.5 to 3. creativity is 0 to stay faithful to the source or 1 to let the model add detail. The model’s parameters in GET /v1/models give both ranges and defaults.
max_output_megapixels in the operation’s limits gives that cap. Such a model is priced per megapixel-second of output, with one price per creativity value. Billing shows how NagaAI counts the charge.
Animate a portrait to speech
A talking-avatar model, such as HeyGen Avatar IV, animates one portrait so that it speaks a recording you give it. Send the portrait as animage_url reference and the speech as an audio_url reference. The audio is a public https URL or a data:audio/...;base64, URI, for example an MP3 or a WAV file.
duration carries "x-support": "none" on such a model, and its maximum is the longest audio the model takes. A request that sends duration fails with 400. resolution and aspect_ratio work as on any model. The model’s input_references parameter has {"image_url": {"minimum": 1}, "audio_url": {"minimum": 1}}, so a request without the portrait or the audio fails with 400 before it reaches a provider. Billing explains what such a job holds and charges.
Read the job status
GET /v1/videos/{id}/content answers 302 with the file’s address, or 409 while the job is not completed. NagaAI keeps the file for seven days after the job completes, so download it if you need it longer. A job of another account, or an unknown id, answers 404.
Billing
The price is per second of video and depends on the resolution and on sound.pricing in GET /v1/models has one output_video_second row for each pair the model sells, with the pair in conditions: {"resolution": "720p", "generate_audio": false}.
- When the job starts, NagaAI holds its full price on the balance. When a fallback takes the job, the hold moves to the fallback’s price. If the balance minus the holds of your running jobs does not cover it, the request fails with
402. On a key with a credit limit, the rest of the limit has to cover it too, or the request fails with403 credit_limit_exceeded. - NagaAI charges once, when the clip is ready, for the seconds you asked for. For a clip more than half a second shorter, NagaAI charges its real length, rounded up to whole seconds.
- A model that only edits a clip holds the price of its longest input clip, the
maximumofduration. It charges the real length of the result, rounded up to whole seconds, which is the length of your clip. - A talking-avatar model holds the price of your audio’s length, rounded up to whole seconds. One more second covers a clip that runs slightly past the audio. NagaAI reads that length from the file before the job starts, so a short clip needs only a small balance. Some files can’t be read: a link NagaAI can’t fetch, a file over 25 MB, or a format without a stated duration. For them, the hold is the longest audio the model takes, the
maximumofduration. Audio longer than thatmaximumfails with400oninput_referencesbefore the job starts. NagaAI charges the real length of the clip, rounded up to whole seconds, which is the length of your audio. - An upscaling model is priced per megapixel-second of output: one
output_video_megapixel_secondrow percreativityvalue, withcreativityinconditions. A megapixel is 1,048,576 pixels, so a 4096 × 2048 frame is 8 megapixels. Eight seconds of it at 0.025 credits cost 1.60. The hold is the largest frame,max_output_megapixels, for the longest input clip. NagaAI charges the frame size of the delivered file for its real length, and never more than the hold. - Some models cost at least a fixed amount per clip, however short. Their price row carries it as
minimum:{"price": "0.14", "minimum": "0.28"}makes a 1-second clip cost 0.28 credits and a 10-second clip 1.40. The hold is never less thanminimumeither. - NagaAI does not charge a job that ends
failed.
Troubleshooting
400 listing supported values
The message names the values the model accepts for the field you sent. Read theenum of that parameter in the model’s video_generation operation in GET /v1/models and send one of them.
400 “No provider of the model accepts the value sent”
The model lists each value you sent, but none of its providers can make this clip. For example, no provider takes a last frame. NagaAI calls no provider and charges nothing. Change or drop the named field, or choose another model.400 “frame_images and input_references together are not supported by this model”
The model takes either frames to start or end on, or references, not both in one job. Send the frames alone or the references alone.402 or 403 credit_limit_exceeded when you start
NagaAI holds the full price of the clip before it starts the job. Top up the balance, or raise the key’s credit limit. Running jobs hold their price too, so wait for them to finish if the balance is just short.
403 inappropriate_content
NagaAI’s moderation blocked the prompt. Rewrite it and send the request again.
409 on the content URL
The job is notcompleted yet. Keep polling GET /v1/videos/{id} and download the file after the status changes.
Status failed
The job has no clip and costs nothing. error.type says why. moderation means the provider’s filter rejected the prompt or a frame image. timeout means the clip took longer than limits.max_wait_seconds of the model’s video_generation operation in GET /v1/models. invalid_request means the provider refused an input of the request, often a frame or reference link it could not download. error.message gives the provider’s reason after Upstream returned an error:. Link a file that any server can download without signing in, then submit the job again. upstream_error means the provider could not produce it, so submit the job again or try another model.
404 on a job
Theid is unknown, or the job belongs to another account.