xBookvideo API

Book-to-Video SaaS API โ€” Upload books, auto-generate episode plans, AI creates short videos.

Base URL: https://xbookvideo.com Version: 1.0.0

Authentication

Method 1: API Key (Recommended for programmatic use)

Pass the API Key in the request header. Two header formats supported:

# Method A: X-API-Key header
curl -H "X-API-Key: xbk_your_api_key_here" \
  https://xbookvideo.com/api/v1/auth/me

# Method B: Authorization Bearer
curl -H "Authorization: Bearer xbk_your_api_key_here" \
  https://xbookvideo.com/api/v1/auth/me

API Key format: xbk_ prefix + 32 random characters.

๐Ÿ”‘ Create and manage API Keys in Settings โ†’ API Keys.

Note: API Key is shown in plain text only once at creation. Save it securely. If lost, create a new one.

Method 2: JWT Token (Web frontend)

curl -H "Authorization: Bearer " \
  https://xbookvideo.com/api/v1/auth/me

JWT Token is valid for 72 hours. Obtain it via /api/v1/auth/login.

Permission Scopes

ScopeDescription
readRead projects/videos/plans
writeCreate/update project content
renderTrigger rendering (plan, demo, full)

Rate Limits

PlanRequests/minHeavy endpoints
Free1010/min
Standard3010/min
Premium / Creator / Pro6010/min
Studio / Enterprise12010/min

Rate limit response includes these headers:

X-RateLimit-Limit: 10
X-RateLimit-Remaining: 7
X-RateLimit-Reset: 1721820000

When exceeded, returns 429 Too Many Requests.

API Endpoints

Authentication & API Keys

MethodPathDescription
POST/api/v1/auth/registerRegister user
POST/api/v1/auth/loginLogin
GET/api/v1/auth/meGet current user info
GET/api/v1/auth/projectsList user projects
POST/api/v1/api-keysCreate API Key
GET/api/v1/api-keysList API Keys
DELETE/api/v1/api-keys/{id}Delete API Key
PATCH/api/v1/api-keys/{id}/toggleEnable/disable API Key

Book Upload & Writing

MethodPathDescription
POST/api/v1/uploadUpload book file (PDF/DOCX/TXT/EPUB)
GET/api/v1/projects/{id}/contentGet text content

Episode Planning & Rendering

MethodPathDescription
POST/api/v1/planGenerate episode plan (async)
GET/api/v1/projects/{id}/planGet episode plan result
POST/api/v1/generate-demoGenerate demo (first episode free)
GET/api/v1/projects/{id}/statusQuery rendering progress
GET/api/v1/queue/statusRendering queue status

Videos & Downloads

MethodPathDescription
GET/api/v1/projects/{id}/videosGet video list
GET/api/v1/projects/{id}/videos/{ep}/streamVideo stream
GET/api/v1/projects/{id}/videos/{ep}/downloadDownload video (paid)

Payment

MethodPathDescription
POST/api/v1/payment/createCreate payment order
POST/api/v1/payment/creem-webhookCreem payment webhook

Sharing & Compression

MethodPathDescription
POST/api/v1/projects/{id}/share/compressCompress video (YouTube/TikTok)
GET/api/v1/projects/{id}/share/textGet share text
GET/api/v1/projects/{id}/share/cardGenerate share card

Knowledge Index & Search

MethodPathDescription
POST/api/v1/projects/{id}/indexVector index
POST/api/v1/projects/{id}/searchIn-project semantic search
POST/api/v1/searchCross-project search

Google Books & Public Domain

MethodPathDescription
GET/api/v1/google-books/searchGoogle Books search
GET/api/v1/public-domain/searchPublic domain book search
GET/api/v1/public-domain/importPublic domain book import

Code Examples

Python

import httpx

API_KEY = "xbk_your_api_key_here"
BASE_URL = "https://xbookvideo.com"

# 1. Upload book
with open("book.pdf", "rb") as f:
    resp = httpx.post(
        f"{BASE_URL}/api/v1/upload",
        headers={"X-API-Key": API_KEY},
        files={"file": ("book.pdf", f, "application/pdf")},
    )
    project_id = resp.json()["project_id"]

# 2. Generate episode plan
httpx.post(
    f"{BASE_URL}/api/v1/plan",
    headers={"X-API-Key": API_KEY, "Content-Type": "application/json"},
    json={"project_id": project_id, "total_episodes": 12},
)

# 3. Poll plan progress
import time
while True:
    status = httpx.get(
        f"{BASE_URL}/api/v1/projects/{project_id}/status",
        headers={"X-API-Key": API_KEY},
    ).json()
    if status["status"] in ("planned", "demo_ready", "completed"):
        break
    time.sleep(5)

# 4. Generate demo
httpx.post(
    f"{BASE_URL}/api/v1/generate-demo",
    headers={"X-API-Key": API_KEY, "Content-Type": "application/json"},
    json={"project_id": project_id, "episode_indices": [0, 1]},
)

# 5. Get video list
videos = httpx.get(
    f"{BASE_URL}/api/v1/projects/{project_id}/videos",
    headers={"X-API-Key": API_KEY},
).json()
for v in videos["videos"]:
    print(f"Episode {v['episode']}: {v['title']} ({v['duration']:.0f}s)")

cURL โ€” Create API Key

# First login with JWT to get token
TOKEN=$(curl -s -X POST https://xbookvideo.com/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"your_username","password":"your_password"}' \
  | python3 -c "import sys,json; print(json.load(sys.stdin)['token'])")

# Create API Key
curl -X POST https://xbookvideo.com/api/v1/api-keys \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"My Production Key","scopes":"read,write,render"}'

# List API Keys
curl https://xbookvideo.com/api/v1/api-keys \
  -H "Authorization: Bearer $TOKEN"

JavaScript (Node.js)

const API_KEY = "xbk_your_api_key_here";
const BASE = "https://xbookvideo.com";

// Upload book
const formData = new FormData();
formData.append("file", fs.createReadStream("book.pdf"));

const uploadRes = await fetch(`${BASE}/api/v1/upload`, {
    method: "POST",
    headers: { "X-API-Key": API_KEY },
    body: formData,
});
const { project_id } = await uploadRes.json();

// Generate episode plan
await fetch(`${BASE}/api/v1/plan`, {
    method: "POST",
    headers: {
        "X-API-Key": API_KEY,
        "Content-Type": "application/json",
    },
    body: JSON.stringify({ project_id, total_episodes: 12 }),
});

// Query progress
const status = await fetch(
    `${BASE}/api/v1/projects/${project_id}/status`,
    { headers: { "X-API-Key": API_KEY } }
).then(r => r.json());
console.log("Status:", status.status, "Progress:", status.progress);

Error Codes

HTTP StatusMeaningCommon Causes
400Bad RequestMissing params / invalid format
401UnauthorizedAPI Key invalid/expired/missing
403ForbiddenInsufficient permissions (e.g. non-Studio accessing white-label)
404Not FoundProject/video/key not found
429Too Many RequestsRate limit exceeded
503Service UnavailableLLM/image/payment service not configured

xBookvideo API ยท โ† Back to App