Skip to content

Generate a video

POST
/v1/videos/generations
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/

Media typeapplication/json
object
prompt
required

What happens in the clip. In image mode, the motion to add; in edit mode, the change to make.

string
mode

What the clip is made from. Absent: image if you have a recent image, otherwise text.

string
Allowed values: text image reference edit
model

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.

string
duration

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.

integer
>= 1
explicit

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.

boolean
end_frame

image mode: use your two most recent images, the older as the first frame and the newer as the last.

boolean
image_count

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

integer
<= 9
reference_video_count

reference mode: how many recent clips to use.

integer
0 <= 3
source_video

edit mode: which clip to edit, counted back from the newest (1 = your most recent clip).

integer
default: 1 >= 1 <= 20
video_origin

Which clips source_video and reference_video_count count: clips Aderra made, or videos uploaded in the Aderra app. Absent: both.

string
Allowed values: generated upload

Examples

From the prompt alone

{
"prompt": "Waves crash against a lighthouse at dusk, slow push in",
"mode": "text",
"duration": 5
}

The finished clip.

Media typeapplication/json
object
created
integer
data
Array<object>
object
url

The finished clip. Download it promptly.

string format: uri
duration_seconds
integer
mode

The mode that ran.

string
Allowed values: text image reference edit
prompt_rewritten
boolean

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 typeapplication/json

Media and a few early refusals send error as a plain string, sometimes with a message for a person.

object
error
required
string
message
string

Example

{
"error": "missing_prompt"
}

The key is missing, unknown or revoked: {"error": "unauthorized"}.

Media typeapplication/json

Media and a few early refusals send error as a plain string, sometimes with a message for a person.

object
error
required
string
message
string

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 typeapplication/json
One of:
object
error
required
object
type
string
param

The request field at fault, when there is one (speech).

string | null
code

The machine-readable reason. A string, except on upstream_error where it is the upstream HTTP status.

One of:
string
message
string

Example

{
"error": {
"type": "billing_error"
}
}

account_suspended: the account behind the key is suspended.

Media typeapplication/json
object
error
required
object
type
string
param

The request field at fault, when there is one (speech).

string | null
code

The machine-readable reason. A string, except on upstream_error where it is the upstream HTTP status.

One of:
string
message
string

Example

{
"error": {
"type": "billing_error"
}
}

request_too_large: the body is over the size limit.

Media typeapplication/json
object
error
required
object
type
string
param

The request field at fault, when there is one (speech).

string | null
code

The machine-readable reason. A string, except on upstream_error where it is the upstream HTTP status.

One of:
string
message
string

Example

{
"error": {
"type": "billing_error"
}
}

video_content_refused: the video model refused the prompt. Not charged.

Media typeapplication/json

Media and a few early refusals send error as a plain string, sometimes with a message for a person.

object
error
required
string
message
string

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.

Media typeapplication/json
object
error
required
object
type
string
param

The request field at fault, when there is one (speech).

string | null
code

The machine-readable reason. A string, except on upstream_error where it is the upstream HTTP status.

One of:
string
message
string

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."
}
}
Retry-After
integer
Example
12

Whole seconds to wait before trying again.

video_failed: the video model failed. Not charged.

Media typeapplication/json

Media and a few early refusals send error as a plain string, sometimes with a message for a person.

object
error
required
string
message
string

Example

{
"error": "missing_prompt"
}