From $86 to $16 a Month: Cutting AI Short-Video Costs with Code-Driven Stickman Animation

    For anyone producing short videos for overseas audiences, cost is hard to ignore. Scripts, voiceover, and editing can be localized, but generating the actual footage almost always depends on pay-as-you-go generative models. One author's bill had climbed to $86 a month, quotas burned through quickly, and results were unpredictable — faces and characters drifted between shots, and a single line change meant starting over and "gacha-rolling" again. This article follows the switch to a fully code-driven stickman explainer pipeline: a 15-second, 60fps, 900-frame clip now costs about $0.54 to render, and the monthly bill dropped to $16. It answers two questions — how to optimize AI short-video costs and what typically goes wrong with stickman animation — and walks through environment checks, skeleton baselines, joint kinematics examples, a runnable export script, and a full cost breakdown, while laying out where the approach does and doesn't apply.

    For anyone making short videos for overseas audiences, cost is impossible to ignore. Scripts, voiceover, and editing can all be localized as much as possible, but generating the actual video footage is still almost entirely handled by pay-as-you-go generative models. The author’s bill had once stalled at $86 per month, with quotas that never seemed to last. More frustrating was how uncontrollable the results were: shots frequently broke faces or mixed up characters, and changing a single line of dialogue meant tearing everything down and “gacha-rolling” again and again.

    Later, the author replaced the production pipeline with a purely code-driven stickman explainer animation. Using specifications defined in advance as a skill package, an AI coding tool generated and exported everything locally. In a real test, a single 15-second clip at 60fps (900 frames total) cost about $0.54 to produce, and the monthly bill dropped to $16. More importantly, because the animation is data-driven, changing a line of dialogue no longer means regenerating model assets.

    Using this practice as a thread, this article answers two questions: How do you optimize costs for AI-powered overseas short videos? And what typically goes wrong with stickman animation? It also provides environment checks, skeleton baselines, joint kinematics examples, a runnable export script, and a full cost breakdown, along with the boundaries of where this approach applies.

    1. Breaking Down the Problem: Where Generative Video Gets Expensive, and Why It “Always Breaks”

    To decide whether a new approach is worth switching to, you first need to understand where the original solution’s costs actually went. Spending on generative video models falls into three main categories:

    • Generation quota: Billed by the second or by the call. The longer the footage, the higher the resolution, and the more iterations, the greater the consumption.
    • Iteration waste: When a shot is inconsistent or the dialogue changes, most of the already-generated clips are thrown away, and all the earlier compute is sunk.
    • Opportunity cost: Time spent waiting for generation and picking results directly slows down the content team’s release cadence.

    Harder than cost is “controllability.” Generative models are essentially probabilistic: with the same prompt, a different random seed can change a character’s facial features, hairstyle, or clothing, and camera moves and pacing may not match expectations either. For short videos that need continuous narrative, consistent character appearance, and repeated output within the same series, this uncertainty only gets amplified.

    The author’s proposed solution: hand control over the visuals back from the “probabilistic model” to “deterministic code.” Stickman figures are made of simple lines and geometric shapes, with no facial detail and no need for realistic lighting, which makes them ideal for precise description in code. Bone proportions, joint angles, and motion paths are all written as data, so every rendered frame is reproducible, auditable, and rollback-able.

    2. The Core Tension: Getting an LLM to Write Code Is Easy; Getting It to Follow the Rules Is Hard

    It’s worth clearing up a common misconception: code-driven animation doesn’t mean abandoning large models entirely. Quite the opposite — in this pipeline, the AI coding tool acts as the “orchestrator”: understanding requirements, breaking them into scenes, writing scene and motion code, and calling local tools to complete rendering and export.

    The problem is that large models aren’t reliable when left to “improvise.” The author ran a deliberate comparison: without attaching any skill package, they had the tool write a stickman animation webpage from scratch.

    The prompt for the comparison could be written like this:

    1. First check whether the current directory's skill folder .agent\skills contains any
    2. stickman-animation-related skills (only look in the current directory).
    3. If there are none, do not call any skill yet. Write a single-page 15-second stickman
    4. explainer animation in stickman-demo\v1-no-skill.html in the current directory. The topic
    5. is "the pain points of a solo business making short videos for overseas audiences." Split it
    6. into 3 scenes, design it for a 16:9 desktop landscape screen, and skip any unnecessary
    7. decoration. When you're done, tell me the result and how long it took.

    After confirming there were no relevant skills in the current directory, the tool produced a single-file webpage of about 11.6 KB in roughly 64 seconds. Opening it in a browser and playing it back, the content cards for topic selection, shooting, and editing did appear, but the problems were also obvious:

    • Stiff head-to-body proportions: The character was sometimes tall and sometimes short across shots, with no consistent baseline.
    • Crooked arm lines: Joint positions were picked arbitrarily, producing arm angles that shouldn’t exist and arm lengths that varied.
    • Mixed-up logic: Animation logic and page structure were tangled together, so adjusting a single pose often dragged in the whole block of code.
    • Out-of-control pacing: Scene durations were all improvised on the spot, making it hard to align with the voiceover.

    This is the typical cost of “no spec”: every time, the large model re-imagines what a stickman should look like, with nothing constraining its spatial and motion intuition.

    An effective skill package solves exactly this problem. It is essentially a set of structured instructions for a specific task, usually centered on a specification document and bundled with reusable scripts, templates, and reference material. When a task begins, the AI coding tool loads the relevant skills on demand, effectively turning scattered requirements that used to live inside the prompt into an iterable engineering standard.

    In this practice, the skill package enforces four kinds of constraints:

    • Format constraints: Unified bone proportions, line widths, and coordinate origins, so the character “always looks the same.”
    • Motion constraints: Defined joint rotation methods and easing curves, so movements look natural and don’t clip through the body.
    • Process constraints: A fixed pipeline of “write scene data → render frame by frame → composite audio and video → self-check,” avoiding improvisation.
    • Tool constraints: A clearly defined local runtime environment and command-line invocation, so the export step can be automated.

    The floor of generation quality depends largely on how granular the specification is, not on how “smart” the model itself is. The closer the spec gets to an engineering standard, the more stable the output.

    It’s a good idea to add a minimal acceptance checklist once the skill package is in place:

    1. Are head-to-body proportions, line widths, and coordinate origins consistent?
    2. Are any joint angles out of range? Do the arms clip through the body?
    3. Is each scene’s duration aligned with the voiceover?
    4. Is the export resolution 1920×1080?
    5. Is the export frame rate 60fps?
    6. Does the 15-second clip correspond to 900 frames?
    7. Does the output avoid overwriting previous versions?

    3. Pre-Flight Environment Check: Get Your Local Rendering Environment Ready First

    This approach renders entirely locally, and the export step needs to call the local runtime and command-line tools. Before you start, confirm:

    • Node.js: Node.js 18 or newer is recommended for running skeleton definitions, scene data, and export scripts;
    • npm: Bundled with Node.js, used to install dependencies;
    • ffmpeg: Version 4.4 or newer is recommended for combining frame images into video and muxing in the voiceover;
    • Headless browser: Puppeteer or Playwright, used to render the animation frame by frame into images.

    Check commands:

    1. node -v
    2. # Expect output like v18.19.0 or newer
    3. npm -v
    4. ffmpeg -version
    5. # Check that it shows ffmpeg version 4.4 or newer
    6. npm ls puppeteer
    7. # If not installed yet, you can install it later with npm install puppeteer

    Installation commands by platform:

    1. # Initialize the project
    2. npm init -y
    3. # Install the headless browser rendering dependency
    4. npm install puppeteer

    Installing ffmpeg:

    1. # macOS
    2. brew install ffmpeg
    3. # Ubuntu / Debian
    4. sudo apt update && sudo apt install -y ffmpeg
    5. # Windows can use winget
    6. winget install Gyan.FFmpeg

    If you need to install Node.js:

    1. # macOS
    2. brew install node@18
    3. # Windows
    4. winget install OpenJS.NodeJS.LTS

    Once all tools are installed, make sure node, npm, and ffmpeg can all be called directly from the command line.

    4. Step 1: Define the Skeleton Baseline — Turn “Proportions” into Math

    The first cornerstone of the skill package is a skeleton definition that locks every dimension to a single baseline. The illustrative code below uses body height as the baseline unit and normalizes the lengths of the head, torso, and limbs to relative proportions:

    1. // Skeleton baseline: all lengths are based on body height H, so proportions stay constant in every shot
    2. const RIG = {
    3. H: 100, // normalized height
    4. headR: 14, // head radius = 0.14H
    5. neck: 86, // neck y coordinate
    6. hip: 50, // hip y coordinate
    7. shoulder: 80, // shoulder y coordinate
    8. shoulderW: 20, // left-right shoulder width
    9. upperArm: 22, // upper arm length
    10. foreArm: 20, // forearm length
    11. thigh: 26, // thigh length
    12. shin: 24, // shin length
    13. };

    A note on the coordinate system and angle units: the example above uses vertical coordinates to describe proportions; if your rendering engine uses a downward y-axis, you only need to flip it consistently. Angles in the scene data are best written as “degrees” for readability, then converted to “radians” before kinematics calculations.

    1. // Degree to radian: if the scene specifies 30 degrees, convert before calculating
    2. const rad = deg => deg * Math.PI / 180;
    3. const armL = rad(30);

    Then use forward kinematics to compute joint coordinates. Each limb segment starts from its parent joint and derives the next segment’s position by its joint angle:

    1. // Forward kinematics: from the parent joint and two angles, compute the end joint coordinates
    2. // a1, a2 are joint angles relative to the vertical, in radians
    3. function chain(origin, len1, len2, a1, a2) {
    4. const mid = {
    5. x: origin.x + len1 * Math.sin(a1),
    6. y: origin.y + len1 * Math.cos(a1),
    7. };
    8. const end = {
    9. x: mid.x + len2 * Math.sin(a1 + a2),
    10. y: mid.y + len2 * Math.cos(a1 + a2),
    11. };
    12. return { mid, end };
    13. }

    Once the skeleton is defined, the character’s height, head-to-body ratio, and limb lengths are all determined by the same data across every scene. Switching shots or changing poses only changes the joint angles, not “what he looks like.”

    5. Step 2: Package the Spec and Tools into a Skill Package

    Back in the AI coding tool’s command-line interface, enter the prompt to create the skill. What matters isn’t the wording but making the acceptance criteria explicit:

    1. In .agent\skills\stickman-animator in the current directory, create a skill package for making
    2. 60fps stickman explainer short clips. Besides writing the SKILL.md spec, bundle two kinds of
    3. scripts: first, a skeleton and joint-kinematics module to unify bone proportions and motion
    4. calculations; second, an export module that supports headless frame-by-frame rendering and calls
    5. a command-line transcoder to composite the video and mix in the voiceover. The spec must specify:
    6. unified bone proportions, line widths, and coordinate origins; joints may only rotate in the
    7. predefined way; each action must be described with an easing function; scene durations must be
    8. configurable; final export at 1920x1080 resolution, 60fps, H.264 encoding; a 15-second clip must
    9. export 900 frames.

    Once the skill package is in place, scenes and actions are reduced to pure data, and the part that actually needs “creation” is compressed to a minimum.

    Below is the scene data module scenes.js from the runnable example:

    1. // scenes.js
    2. module.exports = {
    3. scenes: [
    4. {
    5. duration: 5, // seconds
    6. pose: { armL: 30, armR: 30, lean: 0 },
    7. text: "Monthly quota burns fast",
    8. },
    9. {
    10. duration: 5,
    11. pose: { armL: 130, armR: 20, lean: -8 },
    12. text: "Faces break, characters clash",
    13. },
    14. {
    15. duration: 5,
    16. pose: { armL: 40, armR: 140, lean: 6 },
    17. text: "One line edit means re-rendering",
    18. },
    19. ],
    20. };

    The three scenes total 15 seconds. At 60fps:

    1. 15 seconds x 60fps = 900 frames

    Transitions between poses should be controlled by easing functions in the full skill package, to avoid mechanical, constant-speed motion:

    1. const ease = {
    2. linear: t => t,
    3. inOutCubic: t => (t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2),
    4. outBack: t => 1 + 2.70158 * Math.pow(t - 1, 3) + 1.70158 * Math.pow(t - 1, 2),
    5. };

    6. Step 3: Solidify the Export Pipeline so the Example Actually Runs

    The example below provides a minimal runnable pipeline. It reads scenes.js, generates PNGs frame by frame through Puppeteer, then calls ffmpeg to composite the video and mix in the voiceover.

    6.1 Prepare the voiceover file voice.wav

    The voiceover can be generated with a text-to-speech tool or recorded locally. Recommended:

    • File name: voice.wav
    • Duration: close to 15 seconds, or slightly shorter;
    • Sample rate: 44100 Hz or 48000 Hz;
    • Format: WAV.

    If you don’t have a voiceover yet, you can first use ffmpeg to generate 15 seconds of silence to get the pipeline running:

    1. ffmpeg -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -t 15 voice.wav

    For real production, replace it with the actual voiceover.

    6.2 Minimal render module render.js

    1. // render.js
    2. const fs = require("fs");
    3. const path = require("path");
    4. const puppeteer = require("puppeteer");
    5. function sceneAt(scenes, t) {
    6. let acc = 0;
    7. for (const s of scenes) {
    8. acc += s.duration;
    9. if (t < acc) return s;
    10. }
    11. return scenes[scenes.length - 1];
    12. }
    13. function xmlSafe(str) {
    14. return String(str || "").replace(/[<>&']/g, c => ({
    15. "<": "&lt;",
    16. ">": "&gt;",
    17. "&": "&amp;",
    18. "'": "&apos;",
    19. }[c]));
    20. }
    21. function svgForFrame(scene) {
    22. const pose = scene.pose || {};
    23. const armL = Number(pose.armL || 0);
    24. const armR = Number(pose.armR || 0);
    25. const lean = Number(pose.lean || 0);
    26. const text = xmlSafe(scene.text || "");
    27. return `<svg xmlns="http://www.w3.org/2000/svg" width="1920" height="1080">
    28. <rect width="100%" height="100%" fill="#0f172a"/>
    29. <text x="120" y="220" fill="#ffffff" font-size="72" font-family="sans-serif">
    30. ${text}
    31. </text>
    32. <g transform="translate(960 420) rotate(${lean}) scale(5)">
    33. <line x1="0" y1="0" x2="0" y2="-80" stroke="#fff" stroke-width="3"/>
    34. <circle cx="0" cy="-96" r="14" fill="none" stroke="#fff" stroke-width="3"/>
    35. <g transform="translate(0 -65) rotate(${armL})">
    36. <line x1="0" y1="0" x2="-38" y2="0" stroke="#fff" stroke-width="3"/>
    37. <line x1="-38" y1="0" x2="-60" y2="20" stroke="#fff" stroke-width="3"/>
    38. </g>
    39. <g transform="translate(0 -65) rotate(${armR})">
    40. <line x1="0" y1="0" x2="38" y2="0" stroke="#fff" stroke-width="3"/>
    41. <line x1="38" y1="0" x2="60" y2="20" stroke="#fff" stroke-width="3"/>
    42. </g>
    43. <line x1="0" y1="0" x2="0" y2="70" stroke="#fff" stroke-width="3"/>
    44. <line x1="0" y1="0" x2="-24" y2="70" stroke="#fff" stroke-width="3"/>
    45. <line x1="0" y1="0" x2="24" y2="70" stroke="#fff" stroke-width="3"/>
    46. </g>
    47. </svg>`;
    48. }
    49. async function renderFrames({ scenes, fps, totalFrames, outDir }) {
    50. fs.mkdirSync(outDir, { recursive: true });
    51. const browser = await puppeteer.launch({
    52. headless: true,
    53. args: ["--no-sandbox"],
    54. });
    55. const page = await browser.newPage();
    56. await page.setViewport({
    57. width: 1920,
    58. height: 1080,
    59. deviceScaleFactor: 1,
    60. });
    61. for (let i = 0; i < totalFrames; i++) {
    62. const t = i / fps;
    63. const scene = sceneAt(scenes, t);
    64. const svg = svgForFrame(scene);
    65. await page.setContent(svg, { waitUntil: "load" });
    66. const name = `frame_${String(i).padStart(5, "0")}.png`;
    67. await page.screenshot({ path: path.join(outDir, name) });
    68. }
    69. await browser.close();
    70. }
    71. module.exports = { renderFrames };

    This minimal implementation uses SVG to simplify drawing the stickman, in order to demonstrate the complete chain of “scene data → frame-by-frame images → video.” The full skill package can be replaced with Canvas, SVG animation, or a more complex skeleton system, but the export logic stays the same.

    6.3 Export script export.js

    1. // export.js
    2. const path = require("path");
    3. const { execFileSync } = require("child_process");
    4. const { scenes } = require("./scenes");
    5. const { renderFrames } = require("./render");
    6. const FPS = 60;
    7. // 15 seconds x 60fps = 900 frames
    8. const totalFrames = scenes.reduce(
    9. (sum, s) => sum + Math.round(s.duration * FPS),
    10. 0
    11. );
    12. (async () => {
    13. const stamp = new Date().toISOString().replace(/[:.]/g, "-");
    14. // Use a timestamp directory to avoid overwriting previous frame files
    15. const outDir = path.join(process.cwd(), `frames-${stamp}`);
    16. const output = path.join(process.cwd(), `out-${stamp}.mp4`);
    17. await renderFrames({
    18. scenes,
    19. fps: FPS,
    20. totalFrames,
    21. outDir,
    22. });
    23. execFileSync("ffmpeg", [
    24. "-y", // Overwrites same-named output, so a timestamped name is used here
    25. "-framerate", String(FPS),
    26. "-i", path.join(outDir, "frame_%05d.png"),
    27. "-i", "./voice.wav",
    28. "-c:v", "libx264",
    29. "-pix_fmt", "yuv420p",
    30. "-crf", "18",
    31. "-c:a", "aac",
    32. "-shortest",
    33. output,
    34. ], { stdio: "inherit" });
    35. console.log("Output file:", output);
    36. })().catch(err => {
    37. console.error(err);
    38. process.exit(1);
    39. });

    Run it like this:

    1. node export.js

    After a successful run, the current directory will contain something like:

    1. out-2025-01-01T10-00-00-000Z.mp4

    along with a frames-... directory containing 900 PNGs.

    Note: the -y parameter in ffmpeg overwrites output files with the same name. The example already uses a timestamp directory and a timestamped output file; for real production, it’s best to keep a backup strategy to avoid accidental overwrites.

    7. Results and Costs: Where the Savings Come From, and Where the Capability Ends

    In terms of output, once the skill package is in play, the head-to-body proportions and line widths stay consistent across scenes, transitions are natural, and the scene and logic layers are clearly separated, making changes and reuse easy. The overall look may not match a polished 2D animation, but as an explainer short with high information density and a fast update cadence, it’s already stable and reliable enough.

    In terms of cost, it’s important to distinguish two kinds of resources: compute resources and the AI coding tool’s usage resources. The main expense of code-driven animation is the local compute needed for rendering — a one-time hardware investment with relatively low marginal cost for repeated production. Generative video compute, by contrast, is billed by the cloud on demand, so every extra clip means another bill.

    The author’s real-world results for a single clip:

    • Spec: 15 seconds, 60fps, 1920×1080, 900 frames total;
    • Cost: about $0.54, mainly from the AI coding tool’s understanding, coding, and debugging calls;
    • Comparison: for the same information density, repeatedly “gacha-rolling” with a generative model often costs several times this per clip — not even counting the time cost of rework.

    The cost basis needs a special note, so that $0.54 and $16 aren’t mistaken for universal results:

    1. Number of clips per month: Assuming 30 15-second clips per month, 30 × $0.54 ≈ $16.2, which roughly matches the $16 monthly bill mentioned here.
    2. AI coding tool billing: The $0.54 mainly includes tool calls, code generation, and debugging costs; different tools and different plans significantly affect the unit price.
    3. Local compute and electricity: The example doesn’t count local electricity or hardware depreciation. If counted, an ordinary office computer’s monthly electricity cost is usually low, but it should be stated honestly.
    4. Rework rate: Changing dialogue no longer requires regenerating model assets, but it still needs re-rendering and re-export, which incur local compute and possible tool-call costs. If there’s an average of 0.5 re-renders per clip, the monthly cost may be slightly higher than $16, but still well below $86.
    5. Asset licensing costs: If voiceover, music, fonts, or textures are purchased, they need to be counted separately.

    A simplified table compares three approaches:

    Approach Main cost Rework cost Best fit
    Generative video Billed by the second or call; quotas are easy to overspend Broken faces, mixed-up characters, and dialogue changes can all require re-rolling, at high cost Realistic people, complex lighting, real scenes
    Code-driven animation Local compute, AI coding tool calls Dialogue changes need re-rendering, but no model assets are generated Explainers, knowledge content, episodic shorts
    Hybrid approach A little generated footage + a code-animation main body Smaller rework scope, predictable cost Intro atmosphere + main explanation

    If you move production capacity to the cloud for batch scheduling, you can also combine general cloud services like object storage, message queues, logging, and monitoring/alerting: tasks enter a queue and are consumed in parallel by rendering nodes, outputs are returned to storage, and failed tasks enter retry and alert workflows. This scales horizontally and makes overall costs easier to control.

    But the boundary must be clear: code-driven animation excels at “explaining clearly,” not at “looking real.” For realistic people, complex lighting, or real-scene camera moves, you still need generative models or even a 3D rendering pipeline. A more practical approach is hybrid orchestration: use a generative model to produce a few atmosphere clips or intro shots, and let code-driven animation handle the main explainer, with the two balanced by cost and benefit.

    8. Conclusion: Hand the Deterministic Visuals to Code

    What’s really worth borrowing from this practice isn’t the specific “stickman” topic, but a way of thinking: whatever can be described by rules and data should be handed to code for deterministic execution, leaving only the parts that genuinely need creativity to the model.

    The next time you’re frustrated by a video-generation bill, start by asking yourself: does this shot really have to come from “gacha-rolling”? If the answer is “no,” then writing the bones, proportions, scenes, durations, and export scripts into a skill package may be more stable, cheaper, and more repeatable than continuing to expand your generative-video budget.