API Documentation

Nexabot API Reference

Integrate AI-powered video generation into your applications. Create stunning videos programmatically with our simple REST API.

Base URL

https://nexabot.vercel.app/api

Version

v1.0
Quick Start
Get started with Nexabot API in minutes
1

Authenticate

Login to get your session cookie for API requests

2

Make Request

Send POST request with your parameters to the API endpoint

3

Get Results

Receive your generated video URL in the response

Authentication

All API endpoints require authentication using session cookies

Login
Authenticate and receive a session cookie
POST

Endpoint

/api/auth/login

Parameters

emailstringRequired

User email address

passwordstringRequired

User password

// Login Request
fetch('https://nexabot.vercel.app/api/auth/login', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    email: 'your-email@example.com',
    password: 'your-password'
  }),
  credentials: 'include' // Important: Include credentials
})
.then(response => response.json())
.then(data => console.log(data));

Video Generation

Create AI-generated videos from text prompts or images

Generate Video (Veo 3)
Generate high-quality AI videos using Google's Veo 3 model
POST20 credits

Endpoint

/api/generate-video

Authentication Required

Include session cookie in request headers

Parameters

promptstringRequired

Text description of the video you want to generate

aspectRatiostringRequired

'landscape' (16:9) or 'portrait' (9:16)

referenceImagesarray

Array of uploaded image media IDs for reference-based generation

veoBoosterEnabledboolean

Enable booster for higher quality (requires active booster)

startFrameMediaIdstring

Media ID for image-to-video generation (requires booster)

// Text-to-Video Request
fetch('https://nexabot.vercel.app/api/generate-video', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  credentials: 'include', // Include session cookie
  body: JSON.stringify({
    prompt: "A serene mountain landscape at sunset with birds flying",
    aspectRatio: "landscape", // or "portrait"
    referenceImages: [], // Optional: array of media IDs
    veoBoosterEnabled: false, // Pro feature
    startFrameMediaId: null // For image-to-video
  })
})
.then(response => response.json())
.then(data => console.log(data));
Generate Video (Sora 2)
Generate videos using OpenAI's Sora 2 model
POST50 credits

Endpoint

/api/sora2/generate-video

Authentication Required

Include session cookie in request headers

Parameters

promptstringRequired

Video description prompt

modelstring

'sora-2' or 'sora-2-pro' (default: sora-2)

aspectRatiostringRequired

'horizontal' (16:9) or 'vertical' (9:16)

durationstring

'10', '15', or '25' seconds (default: 15)

hdboolean

Enable HD quality for sora-2-pro

imageUrlstring

Base64 or URL for image-to-video

// Sora 2 Request
fetch('https://nexabot.vercel.app/api/sora2/generate-video', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  credentials: 'include',
  body: JSON.stringify({
    prompt: "A cat walking through a busy Tokyo street at night",
    model: "sora-2-pro", // or "sora-2"
    aspectRatio: "horizontal", // or "vertical"
    duration: "15", // "10", "15", or "25" (25 only for pro)
    hd: true, // HD quality (pro only)
    imageUrl: null // Optional: for image-to-video
  })
})
.then(response => response.json())
.then(data => console.log(data));
Generate TikTok Video
Generate videos optimized for TikTok using their creative API
POST15 credits

Endpoint

/api/tiktok/generate-video

Authentication Required

Include session cookie in request headers

Parameters

promptstringRequired

Video generation prompt

aspectRatiostring

'portrait' or 'landscape' (default: portrait)

startImageBase64string

Base64 encoded start frame for I2V

// TikTok Video Request
fetch('https://nexabot.vercel.app/api/tiktok/generate-video', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  credentials: 'include',
  body: JSON.stringify({
    prompt: "Product showcase video for a smartwatch",
    aspectRatio: "portrait", // TikTok optimized
    startImageBase64: null // Optional: for image-to-video
  })
})
.then(response => response.json())
.then(data => console.log(data));

Script Generation

Generate cinematic video scripts with AI

Generate Script
Create detailed video scripts with scene breakdowns and dialogue
POST2 credits

Endpoint

/api/generate-script

Authentication Required

Include session cookie in request headers

Parameters

themestringRequired

Story theme or concept

genrestring

Genre (adventure, comedy, drama, etc.)

sceneCountnumber

Number of scenes (default: 6)

visualStylestring

Visual style preset

lightingStylestring

Lighting preset

characterCountnumber

Number of characters (default: 2)

dialogueLanguagestring

Language code (id-ID, en-US, etc.)

// Script Generation Request
fetch('https://nexabot.vercel.app/api/generate-script', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  credentials: 'include',
  body: JSON.stringify({
    theme: "A hero's journey to save their village",
    genre: "adventure",
    sceneCount: 6,
    visualStyle: "3D Cartoon Animation",
    lightingStyle: "Golden Hour",
    characterCount: 2,
    dialogueLanguage: "id-ID",
    targetAudience: "All ages",
    includeTransitions: true,
    narrativeMode: "story"
  })
})
.then(response => response.json())
.then(data => console.log(data));

Image Tools

AI-powered image generation and editing

Remove Background
Remove background from images using AI
POST1 credits

Endpoint

/api/image-editing/remove-background

Authentication Required

Include session cookie in request headers

Parameters

imageUrlstringRequired

URL of the image to process

modestring

'fg' or 'fg-alpha' (default: fg)

// Remove Background Request
fetch('https://nexabot.vercel.app/api/image-editing/remove-background', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  credentials: 'include',
  body: JSON.stringify({
    imageUrl: "https://example.com/image.jpg",
    mode: "fg"  // "fg" (foreground only) or "fg-alpha" (with transparency)
  })
})
.then(response => response.json())
.then(data => console.log(data));
Upscale Image
Enhance and upscale images using AI
POST2 credits

Endpoint

/api/image-editing/upscale

Authentication Required

Include session cookie in request headers

Parameters

imageUrlstringRequired

URL of the image to upscale

scalenumber

2 or 4 (default: 2)

// Upscale Image Request
fetch('https://nexabot.vercel.app/api/image-editing/upscale', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  credentials: 'include',
  body: JSON.stringify({
    imageUrl: "https://example.com/low-res.jpg",
    scale: 2  // 2x or 4x upscaling
  })
})
.then(response => response.json())
.then(data => console.log(data));

Status & Utilities

Check generation status and manage content

Check Video Status
Check the generation status of a video
GET

Endpoint

/api/check-video-status

Authentication Required

Include session cookie in request headers

Parameters

videoIdstringRequired

Video ID returned from generation request

// Check Video Status
fetch('https://nexabot.vercel.app/api/check-video-status?videoId=video_abc123', {
  method: 'GET',
  credentials: 'include'
})
.then(response => response.json())
.then(data => console.log(data));
Download Video
Download a generated video
POST

Endpoint

/api/download-video

Authentication Required

Include session cookie in request headers

Parameters

videoUrlstringRequired

URL of the video to download

filenamestring

Custom filename for download

// Download Video
fetch('https://nexabot.vercel.app/api/download-video', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  credentials: 'include',
  body: JSON.stringify({
    videoUrl: "https://cdn.example.com/video.mp4",
    filename: "my-generated-video.mp4"
  })
})
.then(response => response.blob())
.then(blob => {
  // Create download link
  const url = window.URL.createObjectURL(blob);
  const a = document.createElement('a');
  a.href = url;
  a.download = 'video.mp4';
  a.click();
});

Error Codes

Common error responses and their meanings

401

Unauthorized

Authentication required. Please login first.

403

Forbidden

Feature requires PRO plan or insufficient permissions.

402

Insufficient Credits

Not enough credits to complete this action.

429

Rate Limited

Too many requests. Please slow down.

500

Internal Server Error

Something went wrong on our end. Please try again.

Rate Limits & Credits
Understand API limits and credit consumption

Free Plan

  • 50 credits per month
  • Limited to basic features
  • 10 requests per hour

PRO Plan

  • Unlimited credits
  • Access to all models
  • 100 requests per hour
  • Priority support