Skip to main content
aifinhub
AI in Markets Explainer

Agent-Cost Envelope

Agent-cost envelope = sum over (model_call_count × tokens_per_call × price_per_token) for a complete decision cycle. Includes prompt tokens, completion tokens, thinking-token charges (where applicable), and retry inflation when calls fail. The envelope is bounded by an explicit cap; without one, an agent in a degenerate loop can burn its monthly budget in hours.

By Orbyd Editorial · AI Fin Hub Team

On This Page

Definition

Agent-cost envelope

Agent-cost envelope = sum over (model_call_count × tokens_per_call × price_per_token) for a complete decision cycle. Includes prompt tokens, completion tokens, thinking-token charges (where applicable), and retry inflation when calls fail. The envelope is bounded by an explicit cap; without one, an agent in a degenerate loop can burn its monthly budget in hours.

Why it matters

LLM-driven trading agents are economically viable only when per-decision cost is below the per-decision edge. A research loop that costs $0.50 per query and produces a 5bps edge on a $100k position generates $5/decision — fine. The same loop on a $10k position generates $0.50 — break-even before slippage. Without an explicit cost envelope, agents run themselves into negative territory silently.

How it works

Map every model call in the agent loop. Estimate tokens per call (prompt + completion + thinking). Multiply by per-token price for each model used. Multiply by expected retry rate (typically 1.05-1.15x for production systems). Sum across the loop. Apply a hard cap at decision time — when reached, bail out with the partial answer rather than continuing to spend.

Example

Multi-step trading research agent, GPT-5 + Claude 4.6

Steps per decision

8

Avg tokens per step (in+out)

4,500

Blended price

$0.0045 / 1k tokens

Retry inflation

1.10x

Cost per decision

8 × 4.5 × 0.0045 × 1.10 = $0.18

$0.18 per decision is fine on positions over a few hundred dollars; ruinous on micro-positions. Set the envelope, log every decision, alert on breach.

Key Takeaways

1

Always set an explicit per-decision cost cap before deploying.

2

Log token usage per call — cost forensics after a runaway are otherwise impossible.

3

Retry budgets compound: a 10% retry rate over an 8-step loop is a 1.83x worst-case cost multiplier.

Try These Tools

Run the numbers next

FAQ

Questions people ask next

The short answers readers usually want after the first pass.

Depends entirely on the position size and edge. Rule of thumb: cost should be below 10% of expected per-decision PnL. For a $100k position with 5bps target, $5 cost is the upper bound; for a $10k position, $0.50. Below those numbers, the agent is paying for itself.

Sources & References

Related Content

Keep the topic connected

Planning estimates only — not financial, tax, or investment advice.