Skip to main content

Your Product's Cost Structure

James pulled up the comparison table from Lesson 1. The number that kept pulling his attention was not the $12,300 that Architecture 1 cost. It was the $50-70 on the other side. "That number is suspiciously round," he said. "What is actually in it? I want to see every line."

Emma opened a spreadsheet. "Good instinct. A total without line items is a guess. Let me show you what Panaversity actually pays each month to keep TutorClaw running."

James leaned forward. This was the part he understood from years in operations: you cannot control costs you cannot see.


You are doing exactly what James is doing. You have a product that costs $50-70 per month to run. Now you need to see exactly where each dollar goes, what it buys, and which services carry the load.

The Operating Costs Table

Here is every component that makes up TutorClaw's monthly infrastructure bill:

ComponentServiceWhat It Does for TutorClawMonthly Cost
MCP ServerVPS (Hetzner/DigitalOcean)Runs the TutorClaw MCP server, handles streamable-http connections from learners' OpenClaw instances$40-60
Content StorageCloudflare R2 (10 GB free, zero egress)Stores all chapter content, lesson files, and learning materials$0
Content GatingCloudflare Workers (100K req/day free)Routes content requests, enforces access rules at the edge$0
Learner DatabaseManaged PostgreSQL (Neon)Stores learner profiles, progress, exchange counts, tier status$10
Code SandboxDocker containers on same VPSRuns student code submissions in isolated containersIncluded in VPS
PaymentsStripe (2.9% + $0.30 per transaction)Processes subscription payments, manages tier upgradesVariable
LLM TokensLearner's own API keyPowers the AI tutor conversations$0
TOTAL$50-70/month

Look at the three $0 lines. Content storage costs nothing because Cloudflare R2's free tier includes 10 GB of storage with zero egress fees; TutorClaw's total content is 5-10 MB. Content gating costs nothing because Cloudflare Workers' free tier allows 100,000 requests per day. LLM tokens cost nothing because the learner provides their own API key through OpenClaw.

That last $0 is the Great Inversion from Lesson 1 in a single row. The most expensive component of a traditional AI application (LLM inference) does not appear on the operator's bill at all.

Map It to Chapter 58

Every row in that table maps to a tool or component you designed in Chapter 58. In Ch58, you built everything locally with JSON files and local content. The production version swaps those local components for cloud services, but the tools stay the same:

  • MCP Server (VPS): Your TutorClaw server running on a cloud VPS instead of localhost. Same 9 tools, same streamable-http transport.
  • Content Storage (R2): Your local content/chapters/ directory, moved to Cloudflare R2 for global delivery. The get_chapter_content tool reads from R2 instead of local files.
  • Content Gating (Workers): Your check_tier() function, moved to a Cloudflare Worker at the edge. Same tier logic, different execution location.
  • Learner Database (PostgreSQL): Your data/learners.json and data/learner_state.json, migrated to Neon PostgreSQL. Same data, real database.
  • Code Sandbox (Docker): Your mock subprocess sandbox, replaced with isolated Docker containers. Same submit_code tool interface.
  • Payments (Stripe): The same Stripe integration you built in Ch58 Lesson 14. No change needed.
  • LLM Tokens: The learner's own OpenClaw, which calls the MCP server's tools using whatever model the learner has configured. No change from Ch58.

The key insight: every production component is a swap of something you already built locally. The tool interfaces do not change. The tests from Ch58 Lesson 12 still pass because they verify tool behavior, not storage implementation.

Your Turn: Add the Numbers

Before reading further, add the cost components yourself:

$40-60 (VPS) + $0 (R2) + $0 (Workers) + $10 (PostgreSQL) + $0 (Docker, same VPS) + $0 (LLM) = ?

Your total should fall between $50 and $70, depending on the VPS tier chosen. Stripe fees are excluded from this total because they scale with revenue, not infrastructure. You will calculate those in Lesson 4.

The Revenue Model

Costs are one side of the equation. Here is the other:

TierPrice (PKR/month)Price (USD/month)What Unlocks
Free0$0PRIMM-Lite (offline shim), Chapters 1-5, 20 exchanges/day
Paid500~$1.75Full PRIMM-AI+ (MCP), all 30 chapters, code execution, 50 exchanges/day
Premium3,000~$10.50Personalized learning paths, unlimited exchanges, human tutor escalation
CorporateCustomCustomPer-org billing, cohort analytics, custom chapters

The pricing is set in Pakistani Rupees because TutorClaw's primary market is Pakistan. The USD equivalents are approximate conversions.

Notice the Free tier is not useless. It includes an offline shim skill (PRIMM-Lite) that works without the MCP server. The free learner gets real value; the limitation is scope (5 chapters) and depth (20 exchanges per day). The upgrade path is clear: more chapters, more exchanges, code execution.

How the Monetization Gate Works

The gate that enforces these tiers lives inside the MCP server, not in the learner's OpenClaw:

  1. get_learner_state returns exchanges_remaining and tier for the current learner
  2. When the learner hits their daily limit, get_chapter_content returns an upgrade prompt instead of lesson content
  3. get_upgrade_url returns a Stripe checkout link for the next tier

This is server-side enforcement. The learner's shim skill calls get_learner_state at the start of every session, but the skill itself contains no gating logic. Even if a learner modified their shim skill to skip the check, the MCP server would still enforce the limit on every subsequent tool call. The gate is tamper-proof because it runs on Panaversity's infrastructure, not the learner's.

Your Turn: Calculate the Break-Even

At the Paid tier price of $1.75/month, how many paying users does TutorClaw need to cover the $70/month infrastructure cost (using the high end of the range)?

$70 / $1.75 = 40 users

Forty paying users. That is the entire infrastructure break-even for a product serving 16,000 learners. At the Premium tier ($10.50/month), the number drops even further: $70 / $10.50 = 6.67, so 7 premium users cover the full infrastructure cost.

Unit Economics at Scale

With 16,000 learners split across the tiers (75% free, 19% paid, 6% premium):

SegmentLearnersRevenue/MonthMCP Server Cost Share
Free12,000$0~$5 (lightweight API calls)
Paid3,000$5,250~$15 (PRIMM-AI+ + code execution)
Premium1,000$10,500~$10 (personalized paths)
TOTAL16,000$15,750~$30

Total revenue: $15,750/month (using round learner counts from the table above). Operating cost: ~$50-70/month. That puts infrastructure-only margin at 99.5%. But infrastructure is not the whole picture: Stripe's fees add a significant cost that scales with revenue. In Lesson 4, you will run a Python calculator that includes Stripe's 2.9% percentage fee plus the $0.30 flat fee per transaction. The flat fee alone costs $1,200/month across 4,000 paying subscribers. The calculator reports a gross margin of ~89%, not 99.5%, because it accounts for all payment processing costs. The infrastructure margin is real, but the business margin is lower.

These Are Model Outputs, Not Predictions

The numbers in this chapter ($15,750 revenue, 16,000 learners, 75/19/6% tier split) are inputs to a financial model, not forecasts. They illustrate how the economics work at a specific scale with specific assumptions. Your results depend on your market, your execution, and your conversion rates. In Lesson 10, you will stress-test these assumptions and find where the model breaks.

The MCP server cost share column shows how the $30 of VPS compute distributes across tiers. Free learners make lightweight calls (progress lookups, basic content). Paid learners run the full PRIMM-AI+ pipeline with code execution. Premium learners add personalized learning path generation. The remaining $20-40 of the $50-70 total goes to the database ($10) and the VPS headroom for peak loads.

This table is the input for Lesson 4's Python calculator. In that lesson, you will plug these exact numbers into a script, run it, and see how the margins respond when you change the conversion rates.

Try With AI

Exercise 1: Fixed vs. Variable Costs

Here is TutorClaw's operating cost breakdown:

- VPS (MCP Server): $40-60/month
- Cloudflare R2 (content storage): $0/month
- Cloudflare Workers (content gating): $0/month
- PostgreSQL (learner database): $10/month
- Docker sandbox: included in VPS
- LLM tokens: $0 (learner pays)

Which of these cost components scale with the number of learners,
and which are fixed? If learners doubled from 16,000 to 32,000,
which costs would change and by how much? At what learner count
would R2 or Workers exceed their free tiers?

What you are learning: The distinction between fixed and variable costs in an MCP-first architecture. Most of TutorClaw's costs are fixed (VPS, database). The components that would scale in a traditional architecture (LLM tokens, content egress) cost $0 because of the Great Inversion and Cloudflare's free tiers. Understanding which costs are fixed helps you predict how margins improve as the product grows.

Exercise 2: Break-Even at Different Tiers

TutorClaw's infrastructure costs $70/month (high end of range).

Paid tier: $1.75/month per user.
Premium tier: $10.50/month per user.

1. How many Paid-tier users cover the $70 infrastructure cost?
2. How many Premium-tier users cover it?
3. If only 5% of 16,000 learners converted to Paid (instead of 19%),
would TutorClaw still cover infrastructure costs from Paid alone?
4. What is the minimum conversion rate (Paid only, no Premium)
needed to cover $70/month?

What you are learning: Break-even analysis at the infrastructure level. Because TutorClaw's operating cost is so low, the break-even point is remarkably small: 40 Paid users or 7 Premium users. This exercise builds intuition for how Architecture 4's cost structure creates wide margins of safety, which you will stress-test with the Python calculator in Lesson 4.

Exercise 3: Cost Structure for a Different Product

Design a cost structure table for a different MCP-first product.
Pick one: a coding assistant, a customer support bot, or a
language learning tutor.

For each of TutorClaw's 7 components (VPS, R2, Workers,
PostgreSQL, Docker, Stripe, LLM), answer:
- Does your product need this component?
- If yes, would the cost be similar, higher, or lower?
- If no, what replaces it?

Add any new components your product needs that TutorClaw
does not have. Then estimate the total monthly operating cost
and compare it to TutorClaw's $50-70.

What you are learning: Transferability of the cost structure pattern. TutorClaw's seven components are not unique to education; most MCP-first products need a server, storage, a database, and payment processing. By designing a cost table for a different product, you learn to recognize which components are universal and which are domain-specific. This is how operators think about new product economics before writing a single line of code.


James was quiet for a moment, studying the tables. "Forty users," he said. "The entire infrastructure cost is covered by forty people paying less than two dollars a month. In my old warehouse job, the electricity bill alone was more than this."

"Utility bills," Emma said. "That is actually a good way to think about it. Every business has utility bills: electricity, water, insurance. You can trace each one to a specific system. This is the same exercise, just for a software product. VPS is your electricity. The database is your water meter. Stripe is your credit card terminal fee."

"And the LLM is like telling your customers to bring their own power tools," James said. "The warehouse provides the workspace and the expertise. The customer provides the equipment."

Emma paused. "I should be honest about something. I have not personally benchmarked Hetzner versus DigitalOcean versus Fly.io at the 16,000-learner scale. I know the theory: SSE connections, memory per connection, CPU for code execution. The $40-60 range is an architectural estimate based on published pricing and typical MCP server workloads. It is not a load-tested benchmark. If you wanted to verify that number, you would deploy to each provider and run a realistic traffic simulation." She tapped the revenue table. "But the economics are forgiving. Even if the VPS cost doubled to $120, the margin barely moves. You have the cost table and the revenue tiers. In the next lesson, you plug these numbers into a calculator and watch what happens when you change the inputs."

Flashcards Study Aid