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/apiVersion
v1.0Authenticate
Login to get your session cookie for API requests
Make Request
Send POST request with your parameters to the API endpoint
Get Results
Receive your generated video URL in the response
Authentication
All API endpoints require authentication using session cookies
Endpoint
/api/auth/loginParameters
emailstringRequiredUser email address
passwordstringRequiredUser 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
Endpoint
/api/generate-videoAuthentication Required
Include session cookie in request headers
Parameters
promptstringRequiredText description of the video you want to generate
aspectRatiostringRequired'landscape' (16:9) or 'portrait' (9:16)
referenceImagesarrayArray of uploaded image media IDs for reference-based generation
veoBoosterEnabledbooleanEnable booster for higher quality (requires active booster)
startFrameMediaIdstringMedia 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));Endpoint
/api/sora2/generate-videoAuthentication Required
Include session cookie in request headers
Parameters
promptstringRequiredVideo 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)
hdbooleanEnable HD quality for sora-2-pro
imageUrlstringBase64 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));Endpoint
/api/tiktok/generate-videoAuthentication Required
Include session cookie in request headers
Parameters
promptstringRequiredVideo generation prompt
aspectRatiostring'portrait' or 'landscape' (default: portrait)
startImageBase64stringBase64 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
Endpoint
/api/generate-scriptAuthentication Required
Include session cookie in request headers
Parameters
themestringRequiredStory theme or concept
genrestringGenre (adventure, comedy, drama, etc.)
sceneCountnumberNumber of scenes (default: 6)
visualStylestringVisual style preset
lightingStylestringLighting preset
characterCountnumberNumber of characters (default: 2)
dialogueLanguagestringLanguage 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
Endpoint
/api/image-editing/remove-backgroundAuthentication Required
Include session cookie in request headers
Parameters
imageUrlstringRequiredURL 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));Endpoint
/api/image-editing/upscaleAuthentication Required
Include session cookie in request headers
Parameters
imageUrlstringRequiredURL of the image to upscale
scalenumber2 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
Endpoint
/api/check-video-statusAuthentication Required
Include session cookie in request headers
Parameters
videoIdstringRequiredVideo 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));Endpoint
/api/download-videoAuthentication Required
Include session cookie in request headers
Parameters
videoUrlstringRequiredURL of the video to download
filenamestringCustom 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
401Unauthorized
Authentication required. Please login first.
403Forbidden
Feature requires PRO plan or insufficient permissions.
402Insufficient Credits
Not enough credits to complete this action.
429Rate Limited
Too many requests. Please slow down.
500Internal Server Error
Something went wrong on our end. Please try again.
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