API Reference
Build with Thinking Lines. Generate doodle-style explainer videos and SVG vector illustrations programmatically.
Base URL
https://www.thinkingline.com
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
/token. Used by the Thinking Lines web app.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
- Log in to your Dashboard
- Click API Keys in the left sidebar
- Click Create New Key and give it a name (e.g. "My App")
- 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
| Endpoint | Cost | Description |
|---|---|---|
POST /v1/videos/generate | 5 x max_beats | e.g. 8 beats = 40 credits |
POST /v1/vectors/generate | 5 credits | Generate one SVG illustration |
POST /v1/vectors/animate | 5 credits | Animate an existing vector |
GET /v1/credits | Free | Check 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.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
topic | string | Required | — | The topic to explain (e.g. "How black holes work") |
style | string | Optional | "normal" | Visual style of the images Values: "normal", "solid", "pencil" |
voice | string | Optional | "Rachel" | Voice name for narration (available via GET /voices) |
language | string | Optional | "en" | Language code for narration |
max_beats | integer | Optional | 8 | Number of scenes/beats to generate (1-12) |
video_mode | string | Optional | "usual" | Video type Values: "usual", "industrial", "cartoon" |
user_id | integer | Required | — | Your 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
WebSocket /ws/generate-vector
Generate a vector illustration via WebSocket. Streams progress as the SVG is created.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | Required | — | What to illustrate (e.g. "Minimal mountain logo") |
style | string | Optional | "colored" | Visual style Values: "colored", "non_colored", "sketch", "pencil", "infographic" |
aspect_ratio | string | Optional | "1:1" | Output dimensions Values: "1:1", "4:3", "16:9", "3:4" |
user_id | integer | Required | — | Your 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 completionGET /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.
/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).
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
topic | string | Required | — | Topic to explain |
style | string | Optional | "normal" | Image style Values: "normal", "dark", "colored" |
voice | string | Optional | null | Voice name (see GET /voices for available names) |
language | string | Optional | "en" | Language code |
max_beats | integer | Optional | 8 | Number of scenes (1-12). Cost = 5 x max_beats |
video_mode | string | Optional | "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.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | Required | — | What to illustrate |
style | string | Optional | "colored" | Visual style Values: "colored", "monochrome" |
aspect_ratio | string | Optional | "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.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
vector_id | integer | Required | — | ID 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
# }