Recursion Budget

If your AI tool expands a topic into sub-topics, and expands those, the call count is a geometric series. One more level costs you more than everything you have already spent. Work it out before you press run.

Seeds you begin with
Levels of expansion
Children per node
Your hard stop

—

 

What each level costs

DepthCallsAdded by this levelvs. budget

Worst case, assuming every node expands to the full branching factor. Real runs are usually cheaper. Plan for this number anyway.

What it costs in money

—

 

Prices are yours to enter, deliberately. Model pricing changes often enough that any figure baked into a page like this would be wrong within months. The defaults are a placeholder in the shape of a small model, not a quote. Put your provider's current numbers in.

Three things worth knowing

The projection belongs in the UI, before the button

The number is trivial to compute and it is the only thing standing between a user and a surprise bill. Showing it afterwards is an apology, not a feature.

Make the budget a hard stop on requests, not a counter

Check and refuse before the call goes out. A counter you inspect afterwards has already spent the money. And the number you show the user should be the number they were billed for — if those two can drift apart, they will.

Decide what a half-finished run is worth

When the budget runs out mid-way you can keep the partial tree or throw it away. Both are defensible. What is not defensible is not having decided, because the calls are spent either way.

A trap worth naming. If your app has a demo or offline mode that skips the API, your budget tests probably pass without proving anything — the demo path never spends, so the cap is never exercised. Stub the client and count actual outbound requests instead. A test that cannot fail is not evidence.

If you are building the thing this page is about

The arithmetic above came out of building Wikibuilder, an AI encyclopedia builder that expands a topic into subtopics and expands those in turn — which is exactly the geometric series this calculator plots. It is sold as source, you supply your own API key, and you pay your provider per call. Its listing carries the same cost warning as this page, because a tool that can spend your money in a loop should say so before you buy it, not after. There is a demo if you would rather look than buy.

The other source products — a Flask grow-tent dashboard, a SwiftUI drive tracker, a dependency-free strategy game template — are listed at bookmonger.gumroad.com/tools, with what each one does not do stated on the page.