Where Should AI Stop and Code Start? A developer's cost experiment comparing an LLM-powered support agent against deterministic code found that a refund-eligibility check run 50,000 times a day costs roughly $14,600 to $73,000 per year via Claude models versus about $0.000013 per year for a Java method, a gap of roughly a billion to one. The findings argue that high-frequency decisions with a right answer belong in software, while expensive model calls should be reserved for judgment calls that run once per conversation, such as parsing intent. The author notes the boundary was drawn as a correctness decision, not a cost one, and that the bill simply agrees. Why some decisions belong in AI—and others belong in five lines of code. Part 13 findings of an experiment: building an LLM-powered support agent with deterministic boundaries. The companion repo https://github.com/antoniolopescorreia/reliable-ai-support contains the full code. "Is this order eligible for a refund?" is four rules: delivered, paid, inside the return window, belongs to the customer. An LLM can answer that. It would probably answer correctly almost every time. The interesting question isn't whether it can — it's what it costs to ask, multiplied by how often you ask. Refund eligibility gets checked on every refund request, every status enquiry that mentions a return, and every retry. Say 50,000 checks a day for a mid-sized shop. $ ./gradlew checkCost One refund-eligibility check, 50,000 times a day PATH PER CALL PER DAY PER YEAR Claude Opus 5 $0.004000 $200.00 $73,000.00 Claude Sonnet 5 $0.001600 $80.00 $29,200.00 Claude Haiku 4.5 $0.000800 $40.00 $14,600.00 Java method $7.09e-13 $3.54e-08 $0.000013 Measured: ~70 ns per deterministic check The model rows are published per-token prices times an estimated prompt: the policy as a system prompt, the order as JSON, the request, a structured verdict back. Call it 500 tokens in, 60 out. The Java row is RefundEligibility.evaluate measured in a warmed-up loop and costed as rented CPU time. Seventy nanoseconds at $0.036 per vCPU-hour. The gap is about a billion to one. Not a percentage — a factor with nine zeros. The deterministic check's entire annual compute bill is roughly one thousandth of a cent. Nothing clever, which is the point: public static double perCall TokenPrice price, PromptSize prompt { return prompt.inputTokens / PER MILLION price.inputPerMillion + prompt.outputTokens / PER MILLION price.outputPerMillion ; } The prompt estimate lives in a value called PromptSize , not as a literal inside a formula, precisely so you can disagree with my token count and re-run the comparison with yours. Halve it and the cheapest model still costs $7,300 a year. There is no token estimate that makes this a close call. php flowchart LR D{"How often does this