Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Weekend Build Log: My 'Free' AI Side Project Almost Cost Me Real Money

Description and use

A concise Python script that summarizes Markdown files while respecting MonkeyCode’s free tier limits, using a single retry and input size guard.

Problem

Building an AI summarizer for Markdown files while staying within free tier limits and avoiding unexpected costs.

Outcome

A 15‑line Python script that safely summarizes Markdown files within free tier limits, avoiding quota overages and ensuring graceful failure.

Workflow

  • 1. Define MAX_CHARS to limit input size.
  • 2. Read Markdown file from disk.
  • 3. Construct prompt to summarize in 5 bullet points.
  • 4. Send request to MonkeyCode API with one retry and 30s timeout.
  • 5. Handle errors and write summary to output.md.
  • 6. Exit with clear error if file too large or API fails.

Evidence

I added one retry. Not five. I also set a hard timeout so a stuck request wouldn't hang forever.

Source

MAX_CHARS is a crude token proxy. It protects free quota from runaway inputs.

Source

  • Record date: 2026-09-08T05:59:47.501Z