Generate a video
const url = 'https://api.aderra.ai/v1/videos/generations';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"prompt":"Waves crash against a lighthouse at dusk, slow push in","mode":"text","duration":5}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.aderra.ai/v1/videos/generations \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "prompt": "Waves crash against a lighthouse at dusk, slow push in", "mode": "text", "duration": 5 }'Make a clip of 5 to 15 seconds in one of four modes: text (the prompt alone), image
(animate your most recent image), reference (recent images and clips as references) or
edit (change an earlier clip). Synchronous and slow: the connection stays open until
the clip is ready, which can take several minutes (Aderra gives up after 9). Set your HTTP
client’s timeout to at least 10 minutes.
The request carries no image, video or URL. Inputs are named by position, newest first,
and come only from your account: images you generated with /v1/images/generations
or sent to /v1/chat/completions as an image_url part, within roughly the last two
hours (the 8 most recent are kept); clips this account made in the last 7 days, and
videos uploaded in the Aderra app.
Priced per second of video, by model and mode: https://aderra.ai/docs/api/models/#video-models.
In GET /v1/usage/prices, a video model’s per_second is its text and image price.
The response gives a URL to the finished clip: download it straight away, Aderra does not
keep a copy. Guide: https://aderra.ai/docs/api/video/
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
What happens in the clip. In image mode, the motion to add; in edit mode, the change to make.
What the clip is made from. Absent: image if you have a recent image, otherwise text.
A video model id (https://aderra.ai/docs/api/models/#video-models). Absent, or a name Aderra does not know: the mode’s model, minimax-h3 (wan-edit for edit). A model that does not make the mode is refused with video_mode_unavailable.
Seconds, 5 to 15. Clamped into the model’s range (min_seconds to max_seconds in GET /v1/usage/prices); the clamped length is what is made and paid for. Absent: 5.
With mode and no model: use the mode’s uncensored model (sd-fast, minimax-h3-spicy or sd-edit). Used only when the prompt asks for nudity or sex; otherwise the standard model makes the clip.
image mode: use your two most recent images, the older as the first frame and the newer as the last.
reference mode: how many recent images to use (default 1; at most 8 are kept). edit mode: 1 to guide the edit with your most recent image (default 0).
reference mode: how many recent clips to use.
edit mode: which clip to edit, counted back from the newest (1 = your most recent clip).
Which clips source_video and reference_video_count count: clips Aderra made, or videos uploaded in the Aderra app. Absent: both.
Examples
From the prompt alone
{ "prompt": "Waves crash against a lighthouse at dusk, slow push in", "mode": "text", "duration": 5}Animate your most recent image
{ "prompt": "She turns and walks out of frame", "mode": "image"}Two recent images and one recent clip as references
{ "prompt": "The same character, now running through rain", "mode": "reference", "image_count": 2, "reference_video_count": 1}Edit the clip before your latest one
{ "prompt": "Make it snow", "mode": "edit", "source_video": 2}Responses
Section titled “Responses”The finished clip.
object
object
The finished clip. Download it promptly.
The mode that ran.
Example
{ "data": [ { "mode": "text" } ]}invalid_json, missing_prompt, invalid_duration, invalid_mode (with modes), invalid_image_count and invalid_reference_video_count (with max), invalid_source_video, invalid_end_frame, invalid_video_origin, invalid_explicit; and, with a message: image_required, end_frame_requires_two_images, reference_required, source_video_required, reference_images_unavailable, video_mode_unavailable.
Media and a few early refusals send error as a plain string, sometimes with a message for a person.
object
Example
{ "error": "missing_prompt"}The key is missing, unknown or revoked: {"error": "unauthorized"}.
Media and a few early refusals send error as a plain string, sometimes with a message for a person.
object
Example
{ "error": "unauthorized"}api_wallet_empty or key_spend_cap_reached in the OpenAI error shape, or a flat
price_limit_exceeded when the image costs more than your maxPriceMicro.
Media and a few early refusals send error as a plain string, sometimes with a message for a person.
object
Example
{ "error": { "type": "billing_error" }}account_suspended: the account behind the key is suspended.
object
Example
{ "error": { "type": "billing_error" }}request_too_large: the body is over the size limit.
object
Example
{ "error": { "type": "billing_error" }}video_content_refused: the video model refused the prompt. Not charged.
Media and a few early refusals send error as a plain string, sometimes with a message for a person.
object
Example
{ "error": "missing_prompt"}rate_limited: the key passed its requests per minute.
too_many_concurrent_requests: the account already has 8 requests in progress.
Wait for Retry-After seconds.
object
Example
{ "error": { "type": "rate_limit_error", "code": "rate_limited", "message": "This API key is limited to 60 requests a minute. Try again in 12 seconds, or raise the key's limit at https://aderra.ai/developers." }}Headers
Section titled “Headers”Example
12Whole seconds to wait before trying again.
video_failed: the video model failed. Not charged.
Media and a few early refusals send error as a plain string, sometimes with a message for a person.
object
Example
{ "error": "missing_prompt"}