Skip to main content
POST
/
videos
/
create
JavaScript
import Weights from '@weights-ai/sdk';

const client = new Weights({
  bearerToken: 'My Bearer Token',
});

const video = await client.videos.create({
  inputImageUrl: 'https://storage.example.com/input/river.jpg',
  prompt: 'A flowing river with leaves floating downstream',
});

console.log(video.id);
{
  "id": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
prompt
string
required

Text description of the video to generate

Required string length: 1 - 1000
Examples:

"A flowing river with leaves floating downstream"

inputImageUrl
string<uri>
required

URL to the input image to animate into a video

Examples:

"https://storage.example.com/input/river.jpg"

Response

Returns the ID of the created video generation job.

id
string
required
I