API Reference

Build with Thinking Lines. Generate doodle-style explainer videos and SVG vector illustrations programmatically.

Base URL

https://www.thinkingline.com
Line 1.0 Model

Launching Line 1.0

Lightweight state-of-the-art model to create doodle videos from images.

Generate doodlize videos directly from an image, then refine the motion and pacing for crisp, professional explainers.

Videos

Generate hand-drawn doodle explainer videos from any topic. Choose between normal, industrial, and cartoon styles. AI writes the script, generates images, creates doodle animations, and narrates with 50+ voices.

Vectors

Generate SVG vector illustrations from text prompts. Get clean, scalable graphics in colored or monochrome styles. Edit with AI, animate SVGs, and export in SVG or PNG format.

Two ways to integrate

Studio APIs — WebSocket-based endpoints that stream generation progress in real-time. Requires JWT authentication from /token. Used by the Thinking Lines web app.
Public API v1 — Simple REST endpoints authenticated with API keys. Create keys from the Dashboard > API Keys page. Best for server-to-server integrations, scripts, and third-party apps.

Authentication

JWT-based authentication for Studio endpoints. Register an account, get a token, and include it in the Authorization header.

POST /register

Create a new account.

curl -X POST https://www.thinkingline.com/register \
  -H "Content-Type: application/json" \
  -d '{"username":"demo","email":"demo@example.com","password":"pass123"}'

POST /token

Get a JWT token. Use this token in the Authorization header for all Studio endpoints.

curl -X POST https://www.thinkingline.com/token \
  -H "Content-Type: application/json" \
  -d '{"username":"demo","email":"demo@example.com","password":"pass123"}'

# Response:
# { "access_token": "eyJ...", "token_type": "bearer" }

GET /users/me

Get the current user's profile.

curl https://www.thinkingline.com/users/me \
  -H "Authorization: Bearer <jwt>"

API Keys

API keys let you call the Public API v1 endpoints without managing JWT tokens. Each key is tied to your account and deducts from your credit balance.

How to get an API key

  1. Log in to your Dashboard
  2. Click API Keys in the left sidebar
  3. Click Create New Key and give it a name (e.g. "My App")
  4. Copy the key — it starts with tl_ and is only shown once

Using your API key

Include the key in the Authorization header as a Bearer token:

curl https://www.thinkingline.com/v1/credits \
  -H "Authorization: Bearer tl_your_api_key_here"

# Works with all /v1/* endpoints:
# - POST /v1/videos/generate    (generate a doodle video)
# - POST /v1/vectors/generate   (generate an SVG vector)
# - POST /v1/vectors/animate    (animate an existing vector)
# - GET  /v1/credits            (check remaining credits)

Credit costs

EndpointCostDescription
POST /v1/videos/generate5 x max_beatse.g. 8 beats = 40 credits
POST /v1/vectors/generate5 creditsGenerate one SVG illustration
POST /v1/vectors/animate5 creditsAnimate an existing vector
GET /v1/creditsFreeCheck your credit balance

Videos

Generate doodle-style explainer videos from any topic. The AI writes a beat-by-beat script, generates illustrations for each scene, creates hand-drawn doodle animations, and narrates with your chosen voice.

Video types

usual — Classic whiteboard doodle style. Black-and-white hand-drawn look with a pen-drawing animation effect.
industrial — Bold, solid-line industrial illustration style. Clean linework with an engineering/technical feel.
cartoon — Colorful cartoon/comic style with character dialogue, speech bubbles, and multi-character scenes.

WebSocket /ws/generate

Real-time video generation via WebSocket. Streams progress messages as each beat is processed. Used by the Studio web app.

ParameterTypeRequiredDefaultDescription
topicstringRequiredThe topic to explain (e.g. "How black holes work")
stylestringOptional"normal"Visual style of the images
Values: "normal", "solid", "pencil"
voicestringOptional"Rachel"Voice name for narration (available via GET /voices)
languagestringOptional"en"Language code for narration
max_beatsintegerOptional8Number of scenes/beats to generate (1-12)
video_modestringOptional"usual"Video type
Values: "usual", "industrial", "cartoon"
user_idintegerRequiredYour user ID
const ws = new WebSocket("wss://www.thinkingline.com/ws/generate");
ws.onopen = () => ws.send(JSON.stringify({
  topic: "How black holes work",
  style: "normal",
  voice: "Rachel",
  language: "en",
  max_beats: 6,
  video_mode: "usual",
  user_id: 1
}));
ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);
  // msg.type: "progress" | "complete" | "error"
  // msg.data: progress text or final video URL
  console.log(msg);
};

GET /videos

List all your generated videos. Requires JWT auth.

curl https://www.thinkingline.com/videos \
  -H "Authorization: Bearer <jwt>"

# Response: array of { id, title, url, thumbnail_url, created_at }

GET /voices

List all available voice names. No auth required.

curl https://www.thinkingline.com/voices

# Response: { "voices": { "Rachel": "voice_id", "Adam": "voice_id", ... } }

GET /history

Get your generation history. Requires JWT auth.

curl https://www.thinkingline.com/history \
  -H "Authorization: Bearer <jwt>"

Vectors

Generate clean SVG vector illustrations from text prompts. Vectors are scalable, editable, and can be animated. Use them for logos, icons, diagrams, and illustrations.

Capabilities

Generate — Create SVG illustrations from text prompts in colored or monochrome style. Choose aspect ratio (1:1, 16:9, 9:16).
AI Edit — Modify an existing SVG with natural language instructions (e.g. "make the background blue", "add a sun").
Animate — Add CSS/SMIL animations to an SVG. The AI analyzes the SVG structure and adds smooth entrance and motion animations.
Export — Download as SVG (scalable) or PNG (rasterized). Edit the raw SVG code directly in the Studio editor.

WebSocket /ws/generate-vector

Generate a vector illustration via WebSocket. Streams progress as the SVG is created.

ParameterTypeRequiredDefaultDescription
promptstringRequiredWhat to illustrate (e.g. "Minimal mountain logo")
stylestringOptional"colored"Visual style
Values: "colored", "non_colored", "sketch", "pencil", "infographic"
aspect_ratiostringOptional"1:1"Output dimensions
Values: "1:1", "4:3", "16:9", "3:4"
user_idintegerRequiredYour user ID
const ws = new WebSocket("wss://www.thinkingline.com/ws/generate-vector");
ws.onopen = () => ws.send(JSON.stringify({
  prompt: "Minimal mountain landscape logo",
  style: "colored",
  aspect_ratio: "1:1",
  user_id: 1
}));
ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);
  // msg.type: "progress" | "complete" | "error"
  // On complete: msg.svg_url, msg.png_url, msg.svg_code
  console.log(msg);
};

WebSocket /ws/animate-vector

Animate an existing vector. Adds CSS/SMIL animations to the SVG.

const ws = new WebSocket("wss://www.thinkingline.com/ws/animate-vector");
ws.onopen = () => ws.send(JSON.stringify({
  vector_id: 123,
  user_id: 1
}));
// Returns animated SVG code on completion

GET /vectors

List all your generated vectors. Requires JWT auth.

curl https://www.thinkingline.com/vectors \
  -H "Authorization: Bearer <jwt>"

# Response: array of { id, title, style, aspect_ratio, svg_url, png_url, created_at }

PUT /vectors/{id}/code

Update the SVG code for a vector. Use this to save edits.

curl -X PUT https://www.thinkingline.com/vectors/123/code \
  -H "Authorization: Bearer <jwt>" \
  -H "Content-Type: application/json" \
  -d '{"svg_code":"<svg>...</svg>"}'

POST /vectors/ai-edit

Edit a vector with natural language instructions. The AI modifies the SVG based on your prompt.

curl -X POST https://www.thinkingline.com/vectors/ai-edit \
  -H "Content-Type: application/json" \
  -d '{
    "vector_id": 123,
    "prompt": "change the background to dark blue",
    "svg_code": "<svg>...</svg>"
  }'

# Response: { "svg_code": "<svg>...updated...</svg>" }

Public API v1

Simple REST endpoints for programmatic access. Authenticated with API keys (not JWT). Create API keys from the Dashboard > API Keys page.

All /v1/* endpoints require: Authorization: Bearer <api_key>

GET /v1/credits

Check your remaining credit balance and plan.

curl https://www.thinkingline.com/v1/credits \
  -H "Authorization: Bearer tl_your_api_key"

# Response: { "credits": 500, "plan": "pro" }

POST /v1/videos/generate

Generate a doodle explainer video. Costs 5 credits per beat (scene).

ParameterTypeRequiredDefaultDescription
topicstringRequiredTopic to explain
stylestringOptional"normal"Image style
Values: "normal", "dark", "colored"
voicestringOptionalnullVoice name (see GET /voices for available names)
languagestringOptional"en"Language code
max_beatsintegerOptional8Number of scenes (1-12). Cost = 5 x max_beats
video_modestringOptional"usual"Video type
Values: "usual", "industrial", "cartoon"
curl -X POST https://www.thinkingline.com/v1/videos/generate \
  -H "Authorization: Bearer tl_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "topic": "How black holes work",
    "style": "normal",
    "voice": "Rachel",
    "language": "en",
    "max_beats": 6,
    "video_mode": "usual"
  }'

# Response:
# {
#   "id": 42,
#   "video_url": "https://...",
#   "thumbnail_url": "https://...",
#   "credits_remaining": 470
# }

POST /v1/vectors/generate

Generate an SVG vector illustration. Costs 5 credits.

ParameterTypeRequiredDefaultDescription
promptstringRequiredWhat to illustrate
stylestringOptional"colored"Visual style
Values: "colored", "monochrome"
aspect_ratiostringOptional"1:1"Output aspect ratio
Values: "1:1", "16:9", "9:16"
curl -X POST https://www.thinkingline.com/v1/vectors/generate \
  -H "Authorization: Bearer tl_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Minimal mountain landscape logo",
    "style": "colored",
    "aspect_ratio": "1:1"
  }'

# Response:
# {
#   "id": 15,
#   "svg_url": "https://...",
#   "png_url": "https://...",
#   "svg_code": "<svg>...</svg>",
#   "credits_remaining": 495
# }

POST /v1/vectors/animate

Animate an existing vector with CSS/SMIL animations. Costs 5 credits.

ParameterTypeRequiredDefaultDescription
vector_idintegerRequiredID of the vector to animate (must belong to your account)
curl -X POST https://www.thinkingline.com/v1/vectors/animate \
  -H "Authorization: Bearer tl_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"vector_id": 15}'

# Response:
# {
#   "animated_svg": "<svg>...with animations...</svg>",
#   "credits_remaining": 490
# }