LAKAI API

Introduction

The LAKAI API gives programmatic access to the same engines that power lakai.pro and our MCP connector — channel scraping, transcript extraction, viral prediction, scriptwriting, and CTR analysis. Every call is REST-flavored JSON, authenticated with a Bearer key, and billed in the same credit pool as the website.

Base URL

https://lakai.pro/api/v1

Version

1.0.0

Auth

Bearer token

Get going in 60 seconds

Quick Start

  1. Generate a key at /mcp. Keys start with lakai_live_.
  2. Send your first request:
bash
curl https://lakai.pro/api/v1 \
  -H "Authorization: Bearer lakai_live_YOUR_KEY"

You should see a JSON response listing every public tool. Now try a real one:

bash
curl -X POST https://lakai.pro/api/v1/title-generator \
  -H "Authorization: Bearer lakai_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"topic": "How I built a SaaS in 30 days", "count": 5}'

Bearer keys

Authentication

Every request must include an Authorization header with a valid LAKAI API key. Keys are generated per-account and inherit your subscription's credit balance.

http
Authorization: Bearer lakai_live_…

Get a key at lakai.pro/mcp. You can have up to 5 active keys at once. Revoke a key at any time — revocation is immediate.

Treat your key like a password. If a key leaks, revoke it immediately at /mcp and any in-flight calls using it will start returning 401 unauthorized.

Fair-use ceilings

Rate Limits

The API is rate-limited per IP and per API key:

WindowLimitScope
1 minute60 requestsper IP
1 minute120 requestsper API key
1 hour2,000 requestsper API key

When you hit a limit, the API returns 429 rate_limited. Back off and retry with exponential delay. Heavy production usage? Email support@lakai.in for higher ceilings.

What can go wrong

Errors

All errors return a JSON body with a stable error code and a human-readable message:

json
{
  "ok": false,
  "error": "insufficient_credits",
  "message": "Not enough credits. Top up at lakai.pro/pricing."
}
StatusCodeDescription
400invalid_jsonRequest body could not be parsed as JSON.
401unauthorizedMissing or invalid Authorization header.
402insufficient_creditsNot enough credits to run this tool. Top up at /pricing.
403tool_lockedFree plan cannot use this tool. Upgrade to unlock.
404unknown_toolTool slug not recognized. See GET /api/v1.
422tool_errorTool ran but returned an error (bad input, upstream timeout, etc.).
429rate_limitedToo many requests in a short window.
500server_errorUnexpected server error. Try again or contact support.

Reference

Endpoints

Ten public tools. Same engines as the website. All POST, all return JSON.

POST/api/v1/shorts-audit 3 credits

Shorts Audit

Score a YouTube Short on hook strength, title, thumbnail, retention, and CTA. Returns prioritized fixes and rewrites.

Body parameters

FieldTypeDescription
urlstringYouTube Short URL. Provide either url or a manual visualAnalysis.
visualAnalysisobjectManual visual description for chat-attached videos. Mutually exclusive with url.
curl -X POST https://lakai.pro/api/v1/shorts-audit \
  -H "Authorization: Bearer lakai_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://youtube.com/shorts/abc123"}'

Response shape

{
  "ok": true,
  "tool": "shorts-audit",
  "data": {
    "title": "string",
    "channel": "string",
    "overallScore": 0,
    "overallGrade": "S | A | B | C | D",
    "hook": { "score": 0, "strength": "string", "notes": "string", "suggestions": ["..."] },
    "title_analysis": { "score": 0, "reason": "string", "suggestions": ["..."] },
    "thumbnail_analysis": { "score": 0, "reason": "string", "suggestions": ["..."] },
    "retention": { "estimated": 0.0, "factors": ["..."] },
    "cta": { "quality": "string", "suggestion": "string" },
    "strengths": ["..."],
    "weaknesses": ["..."],
    "fixes": [{ "priority": "high|medium|low", "action": "string" }],
    "hookVariations": ["..."]
  },
  "creditsRemaining": 0
}
POST/api/v1/thumbnail-analyze 3 credits

Thumbnail Analyzer

Score a YouTube thumbnail for click-through rate. Returns per-metric diagnostics, dominant palette, mobile-feed test, and ranked fixes.

Body parameters

FieldTypeDescription
youtubeUrlstringAny YouTube URL — server auto-fetches the thumbnail.
imageUrlstringPublic https URL of a thumbnail image.
visualAnalysisobjectManual description for chat-attached images.
aspectRatioHint"16:9" | "9:16" | "1:1" | "auto"Optional aspect ratio hint, defaults to auto.
curl -X POST https://lakai.pro/api/v1/thumbnail-analyze \
  -H "Authorization: Bearer lakai_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"youtubeUrl":"https://youtube.com/watch?v=dQw4w9WgXcQ"}'

Response shape

{
  "ok": true,
  "tool": "thumbnail-analyze",
  "data": {
    "resolution": { "width": 0, "height": 0 },
    "aspectRatio": "string",
    "overallScore": 0,
    "ctr": { "score": 0, "rating": "excellent|good|average|poor", "percentile": 0, "factors": ["..."] },
    "contrast": 0, "saturation": 0, "sharpness": 0, "brightness": 0,
    "dominantColors": [{ "hex": "#000000", "percentage": 0 }],
    "composition": { "ruleOfThirds": 0, "negativeSpace": 0, "focalPointStrength": 0, "clutter": 0 },
    "strengths": ["..."], "weaknesses": ["..."],
    "recommendations": [{ "priority": "high|medium|low", "category": "string", "action": "string" }]
  }
}
POST/api/v1/channel-videos 5 credits

Channel Videos

Scrape a YouTube channel's recent uploads. Returns titles, views, durations, top performer, and outlier statistics — same engine as the /extractor page.

Body parameters

FieldTypeDescription
channelUrlrequiredstringChannel URL in any format: @handle, /channel/UC…, /c/…, /user/…
maxVideosnumberCap the number of videos returned (default 50, max 200).
curl -X POST https://lakai.pro/api/v1/channel-videos \
  -H "Authorization: Bearer lakai_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"channelUrl":"https://youtube.com/@mrbeast","maxVideos":25}'

Response shape

{
  "ok": true,
  "data": {
    "channel": { "name": "string", "handle": "string", "subscribers": 0 },
    "videos": [{ "title": "string", "views": 0, "likes": 0, "duration": "string", "publishedAt": "ISO date", "url": "string" }],
    "stats": { "avgViews": 0, "medianViews": 0, "topPerformer": {...}, "recentOutlier": {...} }
  }
}
POST/api/v1/read-transcript 3 credits

Read Transcript

Pull the full caption transcript for any YouTube video.

Body parameters

FieldTypeDescription
urlrequiredstringYouTube video or Short URL.
curl -X POST https://lakai.pro/api/v1/read-transcript \
  -H "Authorization: Bearer lakai_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://youtube.com/watch?v=dQw4w9WgXcQ"}'

Response shape

{
  "ok": true,
  "data": {
    "title": "string",
    "duration": 0,
    "language": "string",
    "segments": [{ "start": 0.0, "duration": 0.0, "text": "string" }],
    "fullText": "string"
  }
}
POST/api/v1/title-generator 0 credits

Title Generator

Generate CTR-scored title variations for a topic. Free — costs 0 credits.

Body parameters

FieldTypeDescription
topicrequiredstringWhat the video is about.
nichestringOptional niche for tailored phrasing.
style"curiosity" | "numbered" | "personal" | "contrarian" | "mixed"Optional style preference.
countnumberHow many to generate (default 8, max 20).
curl -X POST https://lakai.pro/api/v1/title-generator \
  -H "Authorization: Bearer lakai_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"topic":"How I built a SaaS in 30 days","style":"curiosity","count":10}'

Response shape

{
  "ok": true,
  "data": { "titles": [{ "title": "string", "ctrScore": 0, "rationale": "string" }] }
}
POST/api/v1/script-timer 0 credits

Script Timer

Estimate spoken duration + pacing for a script. Free — costs 0 credits.

Body parameters

FieldTypeDescription
scriptrequiredstringRaw script text.
pace"slow" | "normal" | "fast" | "energetic"Speaking pace.
curl -X POST https://lakai.pro/api/v1/script-timer \
  -H "Authorization: Bearer lakai_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"script":"This skeleton made more money than you...","pace":"energetic"}'

Response shape

{
  "ok": true,
  "data": {
    "estimatedSeconds": 0,
    "wordCount": 0,
    "wpm": 0,
    "pacingBreakdown": [{ "section": "string", "seconds": 0 }]
  }
}
POST/api/v1/scriptwriter 5 credits

Scriptwriter

Generate complete short- or long-form scripts with hooks, pattern interrupts, and CTAs.

Body parameters

FieldTypeDescription
topicstringVideo topic.
youtubeUrlstringReference video URL — server fetches the transcript.
draftScriptstringExisting draft to enhance.
format"commentary" | "storytelling" | "explainer" | "listicle" | "streamer"Format archetype.
tone"casual" | "professional" | "dramatic" | "hype" | "educational"Tone of voice.
contentLength"short" | "long"Short-form (Shorts/Reels) or long-form (5–15 min).
curl -X POST https://lakai.pro/api/v1/scriptwriter \
  -H "Authorization: Bearer lakai_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"topic":"Why creators burn out in year two","format":"commentary","tone":"dramatic","contentLength":"short"}'

Response shape

{
  "ok": true,
  "data": { "script": "string", "hook": "string", "cta": "string", "estimatedDuration": 0, "wordCount": 0 }
}
POST/api/v1/ai-chat 8 credits

AI Chat

Algorithm-aware growth tutor. References the user's channel context when provided.

Body parameters

FieldTypeDescription
messagesrequiredArray<{role, content}>Conversation history.
channelContextobjectOptional channel data (name, recent videos, stats) for personalized advice.
curl -X POST https://lakai.pro/api/v1/ai-chat \
  -H "Authorization: Bearer lakai_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"messages":[{"role":"user","content":"My retention drops at 30 seconds — what should I test?"}]}'

Response shape

{
  "ok": true,
  "data": { "reply": "string", "citations": ["..."], "suggestedActions": ["..."] }
}
POST/api/v1/viral-engine 8 credits

Viral Engine

Five-layer viral forecast: prediction, failure points, hook rewrites, action plan.

Body parameters

FieldTypeDescription
titlestringWorking video title.
rawScriptstringFull script text for analysis.
platform"youtube" | "instagram" | "tiktok"Target platform (defaults to youtube).
thumbnailAnalysisobjectOptional pre-computed thumbnail audit.
channelDataobjectOptional channel stats for context.
curl -X POST https://lakai.pro/api/v1/viral-engine \
  -H "Authorization: Bearer lakai_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"How I got 1M views in 7 days","rawScript":"...","platform":"youtube"}'

Response shape

{
  "ok": true,
  "data": {
    "viralPrediction": { "score": 0, "rating": "string", "reasoning": "string" },
    "failurePoints": [{ "where": "string", "why": "string", "fix": "string" }],
    "hookRewrites": ["..."],
    "actionPlan": [{ "step": 1, "action": "string", "impact": "string" }]
  }
}

Version history

Changelog

1.0.0Initial Release2026-04-25
  • Public REST API with 10 endpoints covering audit, research, generation, and analysis tools.
  • Bearer-token auth via existing LAKAI API keys.
  • Discovery endpoint at GET /api/v1.
  • Same credit pricing as the web app and MCP connector.