Skip to main content
POST
/
v1
/
generation
/
first-last-image-to-video
Submit First-and-Last-Frame-to-Video Task
curl --request POST \
  --url https://api.weryai.com/v1/generation/first-last-image-to-video \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "VEO_3_1",
  "prompt": "The camera slowly moves from the first frame to the last frame with smooth motion.",
  "first_pic_url": "https://example.com/start.jpg",
  "end_pic_url": "https://example.com/end.jpg",
  "video_number": 4,
  "aspect_ratio": "16:9",
  "duration": 5,
  "generate_audio": false
}
'
import requests

url = "https://api.weryai.com/v1/generation/first-last-image-to-video"

payload = {
    "model": "VEO_3_1",
    "prompt": "The camera slowly moves from the first frame to the last frame with smooth motion.",
    "first_pic_url": "https://example.com/start.jpg",
    "end_pic_url": "https://example.com/end.jpg",
    "video_number": 4,
    "aspect_ratio": "16:9",
    "duration": 5,
    "generate_audio": False
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    model: 'VEO_3_1',
    prompt: 'The camera slowly moves from the first frame to the last frame with smooth motion.',
    first_pic_url: 'https://example.com/start.jpg',
    end_pic_url: 'https://example.com/end.jpg',
    video_number: 4,
    aspect_ratio: '16:9',
    duration: 5,
    generate_audio: false
  })
};

fetch('https://api.weryai.com/v1/generation/first-last-image-to-video', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.weryai.com/v1/generation/first-last-image-to-video",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'model' => 'VEO_3_1',
    'prompt' => 'The camera slowly moves from the first frame to the last frame with smooth motion.',
    'first_pic_url' => 'https://example.com/start.jpg',
    'end_pic_url' => 'https://example.com/end.jpg',
    'video_number' => 4,
    'aspect_ratio' => '16:9',
    'duration' => 5,
    'generate_audio' => false
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.weryai.com/v1/generation/first-last-image-to-video"

	payload := strings.NewReader("{\n  \"model\": \"VEO_3_1\",\n  \"prompt\": \"The camera slowly moves from the first frame to the last frame with smooth motion.\",\n  \"first_pic_url\": \"https://example.com/start.jpg\",\n  \"end_pic_url\": \"https://example.com/end.jpg\",\n  \"video_number\": 4,\n  \"aspect_ratio\": \"16:9\",\n  \"duration\": 5,\n  \"generate_audio\": false\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.weryai.com/v1/generation/first-last-image-to-video")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"model\": \"VEO_3_1\",\n  \"prompt\": \"The camera slowly moves from the first frame to the last frame with smooth motion.\",\n  \"first_pic_url\": \"https://example.com/start.jpg\",\n  \"end_pic_url\": \"https://example.com/end.jpg\",\n  \"video_number\": 4,\n  \"aspect_ratio\": \"16:9\",\n  \"duration\": 5,\n  \"generate_audio\": false\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.weryai.com/v1/generation/first-last-image-to-video")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"model\": \"VEO_3_1\",\n  \"prompt\": \"The camera slowly moves from the first frame to the last frame with smooth motion.\",\n  \"first_pic_url\": \"https://example.com/start.jpg\",\n  \"end_pic_url\": \"https://example.com/end.jpg\",\n  \"video_number\": 4,\n  \"aspect_ratio\": \"16:9\",\n  \"duration\": 5,\n  \"generate_audio\": false\n}"

response = http.request(request)
puts response.read_body
{
  "status": 0,
  "desc": "success",
  "message": "success",
  "data": {
    "batch_id": 123456789,
    "task_ids": [
      "task_abc123"
    ]
  }
}
{
  "status": 1001,
  "desc": "Parameter error",
  "message": "Prompt cannot be empty"
}
{
  "status": 1002,
  "desc": "Authentication failed",
  "message": "Invalid API Key"
}

Authorizations

Authorization
string
header
required

Authenticate using Bearer token. Get your API Key from the WeryAI Console.

Example: Authorization: Bearer sk-xxxxxxxxxxxxxxxx

Body

application/json
model
string
required

Model Key. Supported models for first-last-image-to-video:

Model NameModel Key
Veo 3.1VEO_3_1
Veo 3.1 FastCHATBOT_VEO_3_1_FAST
Werydance 2.0WERYDANCE_2_0
Werydance 2.0 FastWERYDANCE_2_0_FAST
Seedance 1.5 ProDOUBAO_1_5_PRO
Kling 3.0 StandardKLING_V3_0_STA
Kling 3.0 ProKLING_V3_0_PRO
Kling 2.5 TurboKLING_V2_5_TURBO
Kling V2.1 ProKLING_V2_1_PRO
Example:

"VEO_3_1"

prompt
string
required

Positive text prompt

Required string length: 1 - 2000
Example:

"The camera slowly moves from the first frame to the last frame with smooth motion."

first_pic_url
string<uri>
required

Start frame image URL (supports jpg, jpeg, png, webp)

Example:

"https://example.com/start.jpg"

end_pic_url
string<uri>
required

End frame image URL (supports jpg, jpeg, png, webp)

Example:

"https://example.com/end.jpg"

aspect_ratio
string
required

Video aspect ratio

Example:

"16:9"

duration
integer
required

Video duration (seconds)

Example:

5

negative_prompt
string

Negative text prompt

Maximum string length: 1000
video_number
enum<integer>
default:1

Number of videos to generate (1~4).

Available options:
1,
2,
3,
4
resolution
string

Video resolution. Supported values: 480p, 720p. For Werydance 2.0 model, 1080p is also supported. Werydance 2.0 Fast does not support 1080p.

generate_audio
string

Whether to generate audio. Enter true or false manually.

Example:

"false"

webhook_url
string<uri>

Callback URL

caller_id
integer<int64>

Caller ID

Response

Task submitted successfully

status
integer

Business status code (0 indicates success)

Example:

0

desc
string

Status description

Example:

"success"

message
string

Multi-language message

Example:

"success"

data
object