Create video using first and last frames

Table of contents

December 31, 2024

  1. Request Headers
  2. Request Body
  3. Responses
  4. Model
  5. Examples
  6. Try It

This endpoint uses the most recent PixVerse model v3.5.

To upload prompt image use POST /files.

https://api.useapi.net/v2/pixverse/videos/create-frames-v3

Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
# Alternatively you can use multipart/form-data
# Content-Type: multipart/form-data
Request Body
{
    "email": "Optional PixVerse API account email",
    "prompt": "Optional text prompt",
    "first_frame_path": "upload/7d16f-eed2-a8f4-cef8-aa44-72807n313.jpeg",
    "last_frame_path": "upload/e7484a28-6efd-174d-7c02-316ef1a5d.jpeg",
    "duration": 8,
    "quality": "1080p",
    "motion_mode": "normal",
    "aspect_ratio": "9:16",
    "seed": 654321,
    "replyUrl": "Place your call back URL here",
    "replyRef": "Place your reference id here",
    "maxJobs": 3
}
  • email is optional, if not specified API will randomly select account from available accounts.

  • model is optional.
    Supported values: v3.5 (default).

  • prompt is optional, describe your video.
    Maximum length 2048 characters.

  • first_frame_path is required, provide path of uploaded image via POST /files.

  • last_frame_path is required, provide path of uploaded image via POST /files.

  • duration is optional. Video duration in seconds.
    Supported values: 8, 5 (default).

  • quality is optional. Video quality.
    Supported values: 1080p, 720p (default), 540p, 360p.

  • motion_mode is optional.
    Supported values: normal (default), fast.

  • aspect_ratio is optional.
    Supported values: 16:9 (default), 9:16, 1:1, 4:3, 3:4

  • seed is optional.
    Valid range 1…2147483647.

  • remove_watermark is optional.
    Supported values: true (default), false.

  • replyUrl is optional, if not provided value from account will be used.
    Place here your callback URL. API will call the provided replyUrl once PixVerse video completed or failed.
    Maximum length 1024 characters.
    We recommend using sites like webhook.site to test callback URL functionality.

  • replyRef is optional, place here your reference id which will be stored and returned along with this PixVerse video response / result.
    Maximum length 1024 characters.

  • maxJobs is optional, if not specified value from selected accounts/email will be used.
    Valid range: 1…8
    It should not exceed the number of concurrent generations supported by your account subscription plan.

Responses
  • 200 OK

    Use the returned video_id to retrieve video status and results using GET /videos. Locate the video in the response array and check if the field video_status_final is true or video_status_name is COMPLETED. The field url will contain the generated video link.

    If you specify the optional parameter replyUrl, the API will call the provided replyUrl with video progress updates until the video is complete or fails.

    {
        "video_id": "user:<userid>-pixverse:<email>-video:<number>"
    }
    
  • 400 Bad Request

    {
      "error": "<Error message>"
    }
    
  • 401 Unauthorized

    {
      "error": "Unauthorized"
    }
    
  • 412 Insufficient credits

    Insufficient credits. All Credits have been used up. Please upgrade your membership or purchase credits.

    {
      "error": "All Credits have been used up. Please upgrade your membership or purchase credits."
    }
    
  • 422 Unprocessable Content

    Moderated message.

    {
      "error": "Your prompt has triggered our AI moderator, please re-enter your prompt"
    }
    
  • 429 Too Many Requests

    Wait in a loop for at least 10..30 seconds and retry again.

    There are two possible cases for API response 429:

    1. API query is full and can not accept new videos/create-frames-v3 requests. Size of query defined by maxJobs optional parameter.
      {
       "error": 
         "Account <email> is busy executing <maxJobs> tasks."
         "All configured accounts are running at maximum capacity."
      }
      
    2. The API received an HTTP response status 429 from PixVerse. Please refer to your subscription plan for the maximum allowed tasks in the queue.
      {
        "error": "Reached the limit for concurrent generations."
      }
      
  • 596 Pending mod message

    Your PixVerse.ai account has a pending error. Most likely, you changed your account password or your PixVerse.ai account was placed on hold. Once the issue is resolved, update your account to clear the error by executing POST accounts/email before making any new API calls.

    {
      "error": 
        "Your PixVerse account has pending error." 
        "Please address this issue at https://useapi.net/docs/api-pixverse-v2/post-pixverse-accounts-email before making any new API calls."
    }
    
Model
{ // TypeScript, all fields are optional
    video_id: string
    error: string
}
Examples
  • curl -H "Accept: application/json" \
         -H "Content-Type: application/json" \
         -H "Authorization: Bearer …" \
         -X POST "https://api.useapi.net/v2/pixverse/videos/create-frames-v3" \
         -d '{"prompt": "…", "first_frame_path": "…", "last_frame_path": "…"}'
    
  • const prompt = "text prompt";  
    const first_frame_path = "provide path of uploaded first image via POST /files";    
    const last_frame_path = "provide path of uploaded last image via POST /files";    
    const apiUrl = `https://api.useapi.net/v2/pixverse/videos/create-frames-v3`; 
    const token = "API token";
    const data = { 
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${token}`,
        'Content-Type': 'application/json' }
    };
    data.body = JSON.stringify({ 
      prompt, first_frame_path, last_frame_path
    });
    const response = await fetch(apiUrl, data);
    const result = await response.json();
    console.log("response", {response, result});
    
  • import requests
    prompt = "text prompt"      
    first_frame_path = "provide path of uploaded first image via POST /files"    
    last_frame_path = "provide path of uploaded last image via POST /files"
    apiUrl = f"https://api.useapi.net/v2/pixverse/videos/create-frames-v3" 
    token = "API token"
    headers = {
        "Content-Type": "application/json", 
        "Authorization" : f"Bearer {token}"
    }
    body = {
        "prompt": f"{prompt}",
        "first_frame_path": f"{first_frame_path}",
        "last_frame_path": f"{last_frame_path}"
    }
    response = requests.post(apiUrl, headers=headers, json=body)
    print(response, response.json())
    
Try It